/* DESIGN TOKENS */
:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #161618;
  --bg-card-hover: #1c1c1f;
  --surface: #1a1a1e;
  --border: #27272a;
  --border-light: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #3b82f6;
  --accent-dim: rgba(59,130,246,0.12);
  --accent-hover: #2563eb;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --container-padding: clamp(20px, 5vw, 80px);
  --max-width: 1200px;
}

/* RESET & BASE */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg-primary); color: var(--text-primary); line-height: 1.7; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.accent { color: var(--accent); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--container-padding); }

/* PRELOADER */
.preloader { position: fixed; inset: 0; z-index: 9999; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; }
.preloader-inner { text-align: center; }
.preloader-text { font-size: clamp(48px, 10vw, 96px); font-weight: 900; letter-spacing: -4px; background: linear-gradient(135deg, #fff 0%, #3b82f6 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.preloader-bar { width: 200px; height: 2px; background: var(--border); margin: 24px auto 0; border-radius: 2px; overflow: hidden; }
.preloader-bar-fill { width: 0%; height: 100%; background: var(--accent); border-radius: 2px; }

/* NAV */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0 var(--container-padding); background: rgba(10,10,11,0.4); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease; }
.nav.scrolled { background: rgba(10,10,11,0.82); backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8); border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-inner { max-width: var(--max-width); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14px; color: var(--text-secondary); transition: color 0.2s; font-weight: 400; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--text-primary); }
.nav-cta { background: var(--accent); color: white !important; padding: 8px 20px; border-radius: 999px; font-weight: 500; transition: background 0.2s, transform 0.2s; }
.nav-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s; }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* HERO */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; padding: 0; overflow: hidden; }
.hero-bg-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 70%); }
.hero-bg-glow { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); width: 800px; height: 800px; background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 60%); pointer-events: none; }
.hero-container { display: grid; grid-template-columns: 1fr 420px; align-items: center; gap: 60px; min-height: 100vh; padding-top: 80px; padding-bottom: 80px; }
.hero-content { position: relative; z-index: 2; }
.hero-badge-wrapper { overflow: hidden; margin-bottom: 20px; }
.hero-badge { display: inline-block; font-size: 15px; color: var(--text-secondary); padding: 8px 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-secondary); }

/* Name: mask reveal */
.hero-name { font-size: clamp(72px, 10vw, 140px); font-weight: 900; letter-spacing: -6px; line-height: 0.95; margin-bottom: 24px; position: relative; }
.hero-name-line { display: block; overflow: hidden; padding-bottom: 8px; }
.hero-name-text { display: inline-block; background: linear-gradient(135deg, #ffffff 0%, #60a5fa 50%, #ffffff 100%); background-size: 200% 200%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; will-change: transform, opacity; }

/* Subtitle: clip reveal */
.hero-subtitle-mask { overflow: hidden; margin-bottom: 20px; }
.hero-subtitle { font-size: clamp(20px, 3vw, 32px); font-weight: 300; color: var(--text-secondary); letter-spacing: 2px; will-change: transform, opacity; }

/* Description */
.hero-desc-mask { overflow: hidden; margin-bottom: 40px; }
.hero-desc { font-size: 16px; color: var(--text-muted); max-width: 500px; line-height: 1.8; will-change: transform, opacity; }

.hero-actions { display: flex; gap: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(59,130,246,0.3); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* Scroll hint */
.hero-scroll-hint { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; }
.hero-scroll-hint span { font-size: 10px; letter-spacing: 3px; color: var(--text-muted); }
.scroll-line { width: 1px; height: 40px; background: var(--border-light); position: relative; overflow: hidden; }
.scroll-line::after { content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 100%; background: var(--accent); animation: scrollDown 1.5s ease-in-out infinite; }
@keyframes scrollDown { 0% { top: -100%; } 100% { top: 100%; } }

/* PROFILE CARD */
.hero-profile-card { display: flex; justify-content: center; align-items: center; z-index: 2; }
.profile-card { width: 340px; perspective: 1000px; }
.pc-card { position: relative; width: 100%; height: 440px; border-radius: 24px; overflow: hidden; cursor: default; transform-style: preserve-3d; transition: transform 0.15s ease-out; }
.pc-glow { position: absolute; inset: -2px; border-radius: 26px; opacity: 0; background: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(59,130,246,0.4), transparent 40%); transition: opacity 0.3s; z-index: 0; }
.pc-card:hover .pc-glow { opacity: 1; }
.pc-border { position: absolute; inset: 0; border-radius: 24px; padding: 1px; background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; z-index: 3; pointer-events: none; }
.pc-bg { position: absolute; inset: 0; z-index: 0; }
.pc-bg-pattern { position: absolute; inset: 0; background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 24px 24px; }
.pc-bg-gradient { position: absolute; inset: 0; background: linear-gradient(165deg, rgba(59,130,246,0.15) 0%, rgba(99,102,241,0.08) 50%, rgba(15,15,18,0.95) 100%); }
.pc-shine { position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent); transform: skewX(-20deg); transition: left 0.6s ease; z-index: 2; pointer-events: none; }
.pc-card:hover .pc-shine { left: 150%; }
.pc-content { position: relative; z-index: 4; padding: 40px 30px 0; text-align: center; }
.pc-avatar { width: 100px; height: 100px; margin: 0 auto 20px; position: relative; }
.pc-avatar-ring { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; background: linear-gradient(135deg, var(--accent), #8b5cf6) border-box; -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pc-avatar-img { width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; color: white; }
.pc-details { text-align: center; }
.pc-details h3 { font-weight: 700; font-size: 28px; margin: 0 0 4px; background: linear-gradient(135deg, #fff, #93c5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.pc-details p { font-weight: 400; font-size: 14px; color: var(--text-secondary); margin: 0; }
.pc-user-info { position: absolute; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.06); backdrop-filter: blur(30px); border-top: 1px solid rgba(255,255,255,0.06); border-radius: 0 0 24px 24px; padding: 14px 18px; }
.pc-user-details { display: flex; align-items: center; gap: 10px; }
.pc-mini-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.pc-mini-avatar-img { width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: white; }
.pc-user-text { display: flex; flex-direction: column; gap: 2px; }
.pc-handle { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.9); }
.pc-status { font-size: 12px; color: rgba(255,255,255,0.5); }
.pc-contact-btn { border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px 16px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); cursor: pointer; transition: all 0.2s ease; backdrop-filter: blur(10px); background: transparent; }
.pc-contact-btn:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }

/* SECTIONS */
.section { padding: 120px 0; position: relative; }
.section-alt { background: var(--bg-secondary); }
.section-header { margin-bottom: 60px; }
.section-label { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent); letter-spacing: 2px; margin-bottom: 16px; }
.section-title-reveal { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -2px; line-height: 1.1; }
.title-line { display: block; overflow: hidden; }
.title-line > * { display: inline; }
.about-headline { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -2px; line-height: 1.15; margin-bottom: 40px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 60px; }
.about-text p { font-size: 16px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }
.about-terminal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.terminal-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #eab308; }
.terminal-dot.green { background: #22c55e; }
.terminal-title { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; margin-left: auto; }
.terminal-body { padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.terminal-body code { display: block; color: var(--text-secondary); margin-bottom: 12px; }
.t-green { color: #22c55e; }
.terminal-body pre { color: var(--text-muted); white-space: pre-wrap; line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.stat { text-align: center; padding: 32px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.3s, transform 0.3s; }
.stat:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-number { font-size: 48px; font-weight: 800; color: var(--text-primary); letter-spacing: -2px; }
.stat-plus { font-size: 28px; color: var(--accent); font-weight: 600; }
.stat-label { display: block; font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* SKILLS */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.skill-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: border-color 0.3s, transform 0.3s; }
.skill-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.skill-icon { font-size: 32px; margin-bottom: 16px; }
.skill-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span { font-size: 12px; padding: 4px 12px; background: var(--accent-dim); color: var(--accent); border-radius: 999px; }

/* WORK */
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.work-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color 0.3s, transform 0.3s; }
.work-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.work-image { height: 220px; overflow: hidden; background: var(--surface); }
.work-image-reveal { width: 100%; height: 100%; overflow: hidden; }
.work-image-reveal img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.work-card:hover .work-image-reveal img { transform: scale(1.08); }
.work-info { padding: 24px; }
.work-tag { font-size: 12px; color: var(--accent); font-weight: 500; margin-bottom: 8px; display: block; }
.work-info h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.work-info p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* CONTACT */
.contact-headline { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -2px; line-height: 1.15; margin-bottom: 16px; }
.contact-desc { font-size: 16px; color: var(--text-muted); margin-bottom: 40px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.contact-item { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; color: var(--text-secondary); transition: border-color 0.3s, color 0.2s, transform 0.3s; white-space: nowrap; }
.contact-item:hover { border-color: var(--accent); color: var(--text-primary); transform: translateY(-2px); }
.contact-icon { font-size: 18px; }

/* FOOTER */
.footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer-left p { font-size: 13px; color: var(--text-muted); }
.footer-icp { font-size: 12px; color: var(--text-muted); margin-top: 4px; opacity: 0.7; }
.back-to-top { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--text-muted); opacity: 0; transition: opacity 0.3s; }

/* SPLIT TEXT */
.split-parent { overflow: hidden; display: inline-block; }
.split-parent.split-full-width { display: block; overflow: visible; }
.split-char, .split-word { display: inline-block; opacity: 0; transform: translateY(100%); will-change: transform, opacity; }
.split-line { overflow: hidden; }
.split-line > .split-word, .split-line > .split-char { display: inline; }

/* TIMELINE */
.timeline-section { margin-top: 80px; }
.timeline-heading { font-size: 20px; font-weight: 600; color: var(--text-secondary); margin-bottom: 32px; letter-spacing: 1px; }
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px; background: linear-gradient(to bottom, var(--accent), rgba(59,130,246,0.1)); }
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-dot { position: absolute; left: -32px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; border-radius: 50%; background: var(--bg-primary); border: 2px solid var(--accent); z-index: 2; transition: box-shadow 0.3s, transform 0.3s; }
.timeline-item:hover .timeline-dot { box-shadow: 0 0 12px rgba(59,130,246,0.5); transform: translateY(-50%) scale(1.2); }
.timeline-card { background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(99,102,241,0.04)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 20px 24px; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s; }
.timeline-item:hover .timeline-card { border-color: rgba(59,130,246,0.3); transform: translateX(4px); box-shadow: 0 4px 24px rgba(59,130,246,0.08); }
.timeline-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.timeline-date { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent); letter-spacing: 0.5px; }

/* SYS STATUS */
.sys-status { width: 280px; background: rgba(10,10,11,0.88); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 16px 18px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.sys-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sys-prompt { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.sys-grid { display: flex; flex-direction: column; gap: 6px; }
.sys-row { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 8px; align-items: center; }
.sys-row-wide { grid-template-columns: auto 1fr auto 1fr; }
.sys-key { color: var(--text-muted); }
.sys-val { color: var(--text-secondary); text-align: right; }
.sys-green { color: #22c55e !important; }
.sys-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 10px 0; }
.sys-meta { display: flex; flex-direction: column; gap: 4px; }
.sys-meta-row { display: flex; justify-content: space-between; }
.sys-datetime { text-align: right; margin-top: 4px; color: var(--text-secondary); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-container { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero-profile-card { order: -1; }
  .profile-card { width: 280px; }
  .pc-card { height: 380px; }
  .hero-content { display: flex; flex-direction: column; align-items: center; }
  .hero-desc { text-align: center; }
  .hero-actions { justify-content: center; }
}
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: rgba(10,10,11,0.95); backdrop-filter: blur(20px); flex-direction: column; padding: 24px; gap: 20px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .stat-number { font-size: 36px; }
  .work-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero-container { min-height: auto; padding-top: 100px; padding-bottom: 60px; }
  .hero-name { letter-spacing: -3px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-left { text-align: center; }
}
@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  .hero-name { letter-spacing: -2px; }
  .sys-status { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .split-char, .split-word { opacity: 1; transform: none; }
}