/* ============ tokens ============ */
:root {
  --bg: #06080f;
  --bg-2: #0a0e1a;
  --ink: #f4f6fb;
  --ink-soft: #aeb6c8;
  --ink-faint: #6b7488;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --blue: #0a84ff;
  --indigo: #5e5ce6;
  --pink: #ff375f;
  --teal: #30d158;
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --radius: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: default;
}

.serif { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; }

::selection { background: var(--blue); color: #fff; }

a { color: inherit; text-decoration: none; }

/* ============ background fx ============ */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: radial-gradient(120% 120% at 50% 0%, var(--bg-2), var(--bg) 60%); }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; will-change: transform; }
.blob-1 { width: 46vw; height: 46vw; background: radial-gradient(circle, var(--blue), transparent 70%); top: -12vw; left: -8vw; animation: drift1 22s var(--ease) infinite alternate; }
.blob-2 { width: 40vw; height: 40vw; background: radial-gradient(circle, var(--indigo), transparent 70%); top: 30vh; right: -10vw; animation: drift2 26s var(--ease) infinite alternate; }
.blob-3 { width: 38vw; height: 38vw; background: radial-gradient(circle, var(--pink), transparent 72%); bottom: -16vw; left: 30vw; opacity: 0.32; animation: drift3 30s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-9vw, -6vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(6vw, -8vh) scale(0.9); } }

.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.4;
}
.noise {
  position: absolute; inset: 0; opacity: 0.035; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* cursor glow */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 460px; height: 460px; z-index: -1;
  border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(10, 132, 255, 0.16), transparent 60%);
  transition: opacity 0.4s; opacity: 0;
}

/* scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 200;
  background: linear-gradient(90deg, var(--blue), var(--indigo), var(--pink));
}

/* ============ nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  transition: padding 0.4s var(--ease), background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(6, 8, 15, 0.6); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-logo { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.35);
}
.logo-text { font-size: 15px; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { font-size: 14px; color: var(--ink-soft); position: relative; transition: color 0.25s; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0;
  background: var(--ink); transition: width 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  padding: 9px 18px; border-radius: 100px; color: var(--ink) !important;
  background: var(--card); border: 1px solid var(--line-strong);
  transition: background 0.25s, transform 0.25s var(--ease);
}
.nav-cta:hover { background: var(--card-hover); transform: translateY(-1px); }
.nav-burger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-burger span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.3s; }

/* ============ layout ============ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vh, 160px) clamp(20px, 5vw, 40px); }
.section-tag {
  display: inline-block; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 22px;
}
.section-title { font-size: clamp(30px, 5vw, 58px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; max-width: 16ch; }
.section-title em { color: var(--ink); }

/* ============ hero ============ */
.hero {
  position: relative; min-height: 100vh; display: grid;
  grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 40px;
  max-width: var(--maxw); margin: 0 auto; padding: 120px clamp(20px, 5vw, 40px) 60px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft);
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 100px; background: var(--card);
  margin-bottom: 28px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(48, 209, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); } }

.hero-title { font-size: clamp(40px, 7.5vw, 92px); font-weight: 800; letter-spacing: -0.04em; line-height: 0.98; margin-bottom: 26px; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title em { font-size: 1.02em; }
.hero-sub { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-soft); max-width: 46ch; margin-bottom: 36px; }
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; border-radius: 100px;
  font-size: 15px; font-weight: 500; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}
.btn svg { transition: transform 0.3s var(--ease); }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--indigo)); color: #fff; box-shadow: 0 12px 34px rgba(10, 132, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(10, 132, 255, 0.45); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--card-hover); transform: translateY(-2px); }

.hero-stats { display: flex; gap: clamp(24px, 4vw, 52px); }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; display: inline; }
.stat-plus { font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; color: var(--blue); vertical-align: top; }
.stat-label { font-size: 13px; color: var(--ink-faint); margin-top: 8px; }

/* phone */
.hero-device { position: relative; display: grid; place-items: center; perspective: 1400px; }
.phone {
  position: relative; width: 270px; height: 560px; border-radius: 46px; padding: 12px;
  background: linear-gradient(160deg, #1c2333, #0c1018);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: rotateY(-16deg) rotateX(6deg); transform-style: preserve-3d;
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: rotateY(-16deg) rotateX(6deg) translateY(-16px); } }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; background: #05070c; border-radius: 100px; z-index: 3; }
.phone-screen {
  width: 100%; height: 100%; border-radius: 36px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #0c1322, #0a0f1c); padding: 46px 18px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.screen-status { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.screen-greeting { margin: 6px 2px 4px; }
.screen-greeting p { font-size: 13px; color: var(--ink-faint); }
.screen-greeting h3 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.screen-card { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; font-size: 12.5px; color: var(--ink-soft); }
.sc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); margin-right: 7px; }
.sc-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.sc-row strong { font-size: 18px; color: var(--ink); }
.sc-bar { height: 6px; border-radius: 100px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.sc-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--blue), var(--indigo)); border-radius: 100px; }
.sc-3 { display: flex; align-items: center; gap: 12px; }
.sc-emoji { font-size: 22px; }
.sc-3 strong { display: block; color: var(--ink); font-size: 14px; }
.sc-3 small { color: var(--ink-faint); font-size: 11px; }
.screen-tabbar { margin-top: auto; display: flex; justify-content: space-around; padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; color: var(--ink-faint); }
.screen-tabbar .active { color: var(--blue); }
.device-glow { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(94, 92, 230, 0.4), transparent 70%); filter: blur(40px); z-index: -1; }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); }
.mouse { display: block; width: 24px; height: 38px; border: 2px solid var(--line-strong); border-radius: 14px; position: relative; }
.mouse i { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 4px; height: 7px; border-radius: 4px; background: var(--ink-soft); animation: scrolldot 1.8s infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 12px); } }

/* ============ marquee ============ */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; overflow: hidden; background: rgba(255, 255, 255, 0.015); }
.marquee-track { display: flex; gap: 30px; width: max-content; animation: scroll-x 34s linear infinite; font-size: clamp(20px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; color: var(--ink-faint); }
.marquee-track span:nth-child(2n) { color: var(--blue); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ============ about ============ */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(30px, 6vw, 80px); align-items: start; }
.about-body p { color: var(--ink-soft); font-size: 17px; margin-bottom: 20px; }
.about-body strong { color: var(--ink); }
.about-list { list-style: none; margin-top: 28px; display: grid; gap: 14px; }
.about-list li { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 15px; }
.about-list span { color: var(--teal); font-size: 16px; }

/* ============ work ============ */
.work .section-title { margin-bottom: 50px; }
.work-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.work-card {
  position: relative; padding: 34px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); overflow: hidden; transition: border-color 0.4s, transform 0.4s var(--ease), background 0.4s;
  transform-style: preserve-3d;
}
.work-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(10, 132, 255, 0.12), transparent 60%);
}
.work-card:hover { border-color: var(--line-strong); background: var(--card-hover); transform: translateY(-4px); }
.work-card:hover::before { opacity: 1; }
.work-num { position: absolute; top: 26px; right: 30px; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.work-icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 12px 30px color-mix(in srgb, var(--g1) 35%, transparent);
}
.work-card h3 { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.work-card p { color: var(--ink-soft); font-size: 15px; margin-bottom: 20px; }
.work-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.work-tags span { font-size: 12.5px; padding: 5px 12px; border-radius: 100px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--ink-soft); }

/* ============ skills ============ */
.skills .section-title { margin-bottom: 50px; }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 56px; }
.skill-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.skill-head span:first-child { font-size: 16px; font-weight: 500; }
.skill-pct { font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.skill-bar { height: 6px; border-radius: 100px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.skill-bar i { display: block; height: 100%; width: 0; border-radius: 100px; background: linear-gradient(90deg, var(--blue), var(--indigo)); transition: width 1.3s var(--ease); }

/* ============ timeline ============ */
.journey .section-title { margin-bottom: 56px; }
.timeline { position: relative; display: grid; gap: 8px; }
.timeline::before { content: ""; position: absolute; left: 92px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 36px; padding: 18px 0; }
.tl-year { font-size: 15px; font-weight: 700; color: var(--ink); padding-top: 2px; }
.tl-content { position: relative; padding-left: 4px; }
.tl-content::before { content: ""; position: absolute; left: -41px; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--bg), 0 0 16px var(--blue); }
.tl-content h3 { font-size: 19px; font-weight: 600; margin-bottom: 6px; letter-spacing: -0.01em; }
.tl-content p { color: var(--ink-soft); font-size: 15px; max-width: 60ch; }

/* ============ contact ============ */
.contact { padding-bottom: clamp(60px, 8vh, 110px); }
.contact-card {
  position: relative; text-align: center; padding: clamp(48px, 7vw, 90px) clamp(24px, 5vw, 60px);
  border-radius: 34px; border: 1px solid var(--line-strong); overflow: hidden;
  background: linear-gradient(160deg, rgba(10, 132, 255, 0.08), rgba(94, 92, 230, 0.05));
}
.contact-card .section-tag { color: var(--blue); }
.contact-title { font-size: clamp(32px, 5.5vw, 62px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 20px; }
.contact-sub { color: var(--ink-soft); font-size: 18px; max-width: 52ch; margin: 0 auto 40px; }
.contact-actions { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.contact-socials { display: flex; gap: 28px; }
.contact-socials a { font-size: 15px; color: var(--ink-soft); position: relative; transition: color 0.25s; }
.contact-socials a:hover { color: var(--ink); }
.contact-socials a::after { content: ""; position: absolute; left: 0; bottom: -3px; height: 1px; width: 0; background: var(--ink); transition: width 0.3s var(--ease); }
.contact-socials a:hover::after { width: 100%; }

/* ============ footer ============ */
.footer {
  max-width: var(--maxw); margin: 0 auto; padding: 40px clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; color: var(--ink-faint); font-size: 14px;
}
.to-top { color: var(--ink-soft); transition: color 0.25s; }
.to-top:hover { color: var(--ink); }

/* ============ legal pages ============ */
.legal { max-width: 820px; margin: 0 auto; padding: 150px clamp(20px, 5vw, 40px) 90px; }
.legal-head { margin-bottom: 48px; }
.legal-back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); margin-bottom: 28px; transition: color 0.25s, transform 0.25s var(--ease); }
.legal-back:hover { color: var(--ink); transform: translateX(-3px); }
.legal h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 14px; }
.legal h1 em { color: var(--ink); }
.legal-updated { font-size: 14px; color: var(--ink-faint); }
.legal h2 { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -0.02em; margin: 46px 0 14px; }
.legal h2 .legal-no { color: var(--blue); font-variant-numeric: tabular-nums; margin-right: 12px; }
.legal p, .legal li { color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.legal p { margin-bottom: 16px; }
.legal ul { list-style: none; display: grid; gap: 10px; margin: 4px 0 20px; }
.legal ul li { position: relative; padding-left: 22px; }
.legal ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.legal a:not(.legal-back) { color: var(--ink); border-bottom: 1px solid var(--line-strong); transition: border-color 0.25s; }
.legal a:not(.legal-back):hover { border-color: var(--ink); }
.legal strong { color: var(--ink); font-weight: 600; }
.legal-contact { margin-top: 22px; padding: 26px 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: grid; gap: 10px; }
.legal-contact div { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-soft); }
.legal-contact span { color: var(--blue); font-size: 16px; width: 20px; text-align: center; }
.footer-legal { display: flex; gap: 18px; }
.footer-legal a { color: var(--ink-faint); transition: color 0.25s; }
.footer-legal a:hover { color: var(--ink-soft); }

/* ============ reveal anim ============ */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-text] { display: inline-block; opacity: 0; transform: translateY(105%); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.hero-title .in [data-reveal-text], [data-reveal-text].in { opacity: 1; transform: none; }

/* stagger children inside a revealed container */
.reveal[data-reveal].in { transition-delay: 0.05s; }

/* ============ responsive ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .hero { grid-template-columns: 1fr; padding-top: 130px; min-height: auto; }
  .hero-device { margin-top: 40px; order: 2; }
  .about-grid, .work-list, .skills-grid { grid-template-columns: 1fr; }
  .about-grid { gap: 30px; }
  .timeline::before { left: 70px; }
  .tl-item { grid-template-columns: 70px 1fr; gap: 26px; }
  .tl-content::before { left: -31px; }
  .footer { justify-content: center; text-align: center; }
}
@media (max-width: 520px) {
  .hero-stats { gap: 22px; }
  .hero-actions { width: 100%; }
  .btn { flex: 1; justify-content: center; }
  .phone { width: 230px; height: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  [data-reveal], [data-reveal-text] { opacity: 1 !important; transform: none !important; }
}
