/* =====================================================
   Somil Srivastava — Portfolio v2
   Editorial dark theme · Syne + Instrument Serif + Space Grotesk
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Instrument+Serif:ital@0;1&family=Space+Grotesk:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Tokens ===== */
:root {
  --bg: #0b0b0d;
  --bg-soft: #101013;
  --card: #141418;
  --card-hover: #18181d;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);

  --text: #ececea;
  --muted: #98988f;
  --faint: #5b5b55;

  --accent: #d9f24f;
  --accent-soft: rgba(217, 242, 79, 0.12);
  --accent-ink: #0b0b0d;

  --font-display: 'Syne', sans-serif;
  --font-serif: 'Instrument Serif', serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --wrap: 1200px;
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) var(--bg);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 10px; }
::selection { background: var(--accent); color: var(--accent-ink); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

/* ===== Film grain ===== */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(10) infinite;
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3%, -2%); }
  30% { transform: translate(2%, -4%); }
  50% { transform: translate(-4%, 3%); }
  70% { transform: translate(3%, 2%); }
  90% { transform: translate(-2%, 4%); }
}

/* ===== Progress bar ===== */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 1500;
}

/* ===== Cursor ring (desktop only) ===== */
.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(217, 242, 79, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1400;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease),
              border-color 0.25s var(--ease), background 0.25s var(--ease),
              opacity 0.3s ease;
  opacity: 0;
}

.cursor-ring.is-active {
  width: 64px;
  height: 64px;
  background: rgba(217, 242, 79, 0.06);
  border-color: var(--accent);
}

@media (hover: none), (pointer: coarse) {
  .cursor-ring { display: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s ease,
              color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.btn svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.btn:hover svg { transform: translate(2px, -2px); }

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-solid:hover {
  box-shadow: 0 0 0 6px var(--accent-soft), 0 12px 32px rgba(217, 242, 79, 0.18);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-big {
  padding: 18px 34px;
  font-size: 1.05rem;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 22px 0;
  transition: padding 0.4s var(--ease), background 0.4s ease,
              border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  padding: 12px 0;
  background: rgba(11, 11, 13, 0.75);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom-color: var(--line-soft);
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease);
}

.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-reg {
  font-size: 0.6em;
  vertical-align: super;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 100px;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--faint);
  transition: color 0.25s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active .nav-num, .nav-link:hover .nav-num { color: var(--accent); }

.nav-cta { padding: 11px 22px; font-size: 0.88rem; }

/* Contact appears only in the overlay menu (desktop has the CTA button) */
.nav-link-contact { display: none; }

/* Mobile menu button */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  padding: 0 10px;
  z-index: 1001;
}

.menu-btn span {
  height: 1.5px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
  transform-origin: center;
}

.menu-btn.open span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 140px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 78% 18%, rgba(217, 242, 79, 0.07), transparent 65%),
    radial-gradient(ellipse 45% 40% at 12% 85%, rgba(217, 242, 79, 0.04), transparent 60%);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black 20%, transparent 75%);
  opacity: 0.6;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 9px 18px;
  border-radius: 100px;
  margin-bottom: 36px;
  background: rgba(255, 255, 255, 0.02);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 5.4vw, 4.9rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.ht-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.ht-inner {
  display: block;
  animation: line-rise 1s var(--ease) var(--d, 0s) backwards;
}

@keyframes line-rise {
  from { transform: translateY(115%); }
  to   { transform: translateY(0); }
}

@media (max-width: 440px) {
  .ht-line { white-space: normal; }
}

.hero-title em {
  color: var(--accent);
  font-size: 1.04em;
  letter-spacing: -0.01em;
  padding-right: 0.06em;
}

.hero-sub {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 44px;
  line-height: 1.8;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

/* Word rotator */
.word-rotator {
  display: inline-grid;
  vertical-align: bottom;
  overflow: hidden;
  height: 1.8em;
  align-items: center;
}

.wr-word {
  grid-area: 1 / 1;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15em;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(110%);
  transition: transform 0.6s var(--ease), opacity 0.4s ease;
}

.wr-word.is-active { opacity: 1; transform: translateY(0); }
.wr-word.is-leaving { opacity: 0; transform: translateY(-110%); }

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

/* Hero stats */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
}

.hstat { position: relative; }

.hstat-num, .hstat-plus {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hstat-plus { color: var(--accent); }

.hstat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-top: 2px;
}

.hstat-sep {
  width: 1px;
  height: 44px;
  background: var(--line);
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.portrait-card {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  transform: rotate(2.5deg);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  border: 1px solid var(--line);
}

.portrait-card:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 0 6px var(--accent-soft);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 35%;
  filter: grayscale(35%) contrast(1.05);
  transition: filter 0.6s ease, transform 0.8s var(--ease);
}

.portrait-card:hover .portrait-img {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.04);
}

.portrait-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(11, 11, 13, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
}

/* Rotating badge */
.orbit-badge {
  position: absolute;
  top: -34px;
  right: 2px;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
}

.orbit-badge svg {
  position: absolute;
  inset: 0;
  animation: rotate-badge 14s linear infinite;
}

.orbit-badge text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  fill: var(--muted);
}

.orbit-badge-center {
  color: var(--accent);
  font-size: 1.3rem;
}

@keyframes rotate-badge { to { transform: rotate(360deg); } }

/* Scroll cue */
.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  transition: color 0.25s ease;
}

.hero-scroll svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bounce-down 1.8s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.hero-scroll:hover { color: var(--accent); }

/* ===== Marquee ===== */
.marquee {
  border-block: 1px solid var(--line-soft);
  padding: 20px 0;
  overflow: hidden;
  background: var(--bg-soft);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-track span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
  text-transform: uppercase;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee-scroll { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: 130px 0; }

.section-head { margin-bottom: 64px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.section-title em {
  color: var(--muted);
  font-size: 1.05em;
}

/* ===== About / Bento ===== */
.bento {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: auto auto;
  gap: 18px;
}

.bento-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 36px;
  transition: border-color 0.35s ease, background 0.35s ease, transform 0.5s var(--ease);
}

.bento-card:hover {
  border-color: var(--line);
  background: var(--card-hover);
  transform: translateY(-4px);
}

.bento-bio { grid-row: span 2; }

.bento-bio p {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.85;
}

.bento-bio p:last-child { margin-bottom: 0; }

.bio-lede {
  font-size: 1.28rem;
  line-height: 1.6 !important;
  color: var(--text) !important;
  font-weight: 400;
}

mark {
  background: none;
  color: var(--accent);
  font-weight: 500;
}

.bento-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--faint);
  margin-bottom: 20px;
}

.facts { list-style: none; }

.facts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
}

.facts li:last-child { border-bottom: none; padding-bottom: 0; }
.facts li span { color: var(--faint); }
.facts li strong { color: var(--text); font-weight: 500; text-align: right; }

.bento-now .now-text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 18px;
}

.bento-now strong { color: var(--text); font-weight: 500; }

.now-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.now-chips span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 6px 13px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.now-chips span:hover { color: var(--accent); border-color: var(--accent); }

.mini-socials { display: flex; flex-direction: column; gap: 10px; }

.mini-social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease, transform 0.35s var(--ease);
}

.mini-social svg {
  width: 15px; height: 15px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

.mini-social:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.mini-social:hover svg { transform: translate(2px, -2px); }

/* ===== Work ===== */
.work-list {
  border-top: 1px solid var(--line);
}

.work-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 40px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.35s ease, padding 0.4s var(--ease);
  cursor: default;
}

.work-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}

.work-row:hover {
  background: var(--bg-soft);
  padding-left: 36px;
}

.work-row:hover::before { transform: scaleY(1); }

.work-idx {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--faint);
  transition: color 0.3s ease;
}

.work-row:hover .work-idx { color: var(--accent); }

.work-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.work-row:hover .work-title { color: var(--accent); }

.work-desc {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 640px;
  margin-bottom: 16px;
  line-height: 1.75;
}

.work-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.work-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.work-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  padding: 7px 15px;
  border-radius: 100px;
  border: 1px solid rgba(217, 242, 79, 0.25);
  background: var(--accent-soft);
}

.work-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.4s var(--ease);
}

.work-arrow svg {
  width: 17px; height: 17px;
  stroke: var(--muted); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.3s ease, transform 0.35s var(--ease);
}

.work-row:hover .work-arrow {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}

.work-row:hover .work-arrow svg { stroke: var(--accent-ink); }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.skill-col {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 40px 34px;
  transition: border-color 0.35s ease, transform 0.5s var(--ease), background 0.35s ease;
}

.skill-col:hover {
  transform: translateY(-6px);
  border-color: var(--line);
  background: var(--card-hover);
}

.skill-col-idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 22px;
}

.skill-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.skill-col-desc {
  color: var(--faint);
  font-size: 0.88rem;
  margin-bottom: 28px;
  line-height: 1.7;
}

.skill-list { list-style: none; }

.skill-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: color 0.25s ease, padding-left 0.3s var(--ease);
}

.skill-list li::before {
  content: '✦';
  color: var(--faint);
  font-size: 0.6rem;
  transition: color 0.25s ease;
}

.skill-list li:hover {
  color: var(--text);
  padding-left: 6px;
}

.skill-list li:hover::before { color: var(--accent); }
.skill-list li:last-child { border-bottom: none; }

/* ===== Journey / Timeline ===== */
.timeline {
  border-top: 1px solid var(--line);
  max-width: 900px;
}

.tl-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}

.tl-when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  padding-top: 6px;
}

.tl-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-now {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 11px;
  border-radius: 100px;
  font-weight: 500;
}

.tl-org {
  color: var(--accent);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.tl-desc {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 620px;
  line-height: 1.8;
}

/* ===== Contact ===== */
.contact {
  text-align: center;
  padding-bottom: 0;
}

.contact-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  text-wrap: balance;
}

.contact-title em { color: var(--accent); }

.contact-sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 110px;
}

.marquee-contact { border-bottom: none; }

.marquee-contact .marquee-track span {
  font-size: 2rem;
  color: transparent;
  -webkit-text-stroke: 1px var(--faint);
  transition: color 0.3s ease;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy, .footer-time {
  font-size: 0.82rem;
  color: var(--faint);
}

.footer-time { font-family: var(--font-mono); font-size: 0.75rem; }

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease);
}

.to-top svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Reveal animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(32px); filter: blur(5px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.reveal-load { animation: rise-in 0.9s var(--ease) var(--d, 0s) backwards; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { order: -1; }
  .portrait-card { width: min(280px, 80%); }
  .hero { padding-top: 120px; }
  .hero-scroll { display: none; }
  .bento { grid-template-columns: 1fr; }
  .bento-bio { grid-row: auto; }
  .skills-grid { grid-template-columns: 1fr; }

  /* Overlay menu (tablet + mobile) */
  .menu-btn { display: flex; }

  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 13, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  .nav-links.open { opacity: 1; pointer-events: auto; }

  .nav-links .nav-link {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
  }

  .nav-links .nav-link-contact { display: flex; }
}

@media (max-width: 768px) {
  .section { padding: 90px 0; }
  .wrap, .nav-inner { padding-inline: 22px; }

  .nav-cta { display: none; }

  .work-row { grid-template-columns: 1fr; gap: 18px; padding: 32px 12px; }
  .work-row:hover { padding-left: 24px; }
  .work-idx { font-size: 0.75rem; }
  .work-meta { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }

  .tl-item { grid-template-columns: 1fr; gap: 12px; padding: 36px 0; }

  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hstat-sep { display: none; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .orbit-badge { display: none; }
  .contact-actions { flex-direction: column; align-items: stretch; padding: 0 8px; }
}


/* =====================================================
   v3 layer — preloader, masked reveals, cursor, extras
   ===================================================== */

/* ===== Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1);
}

body.loaded .preloader {
  transform: translateY(-100%);
  pointer-events: none;
}

body.is-loading { overflow: hidden; }

.pre-center { text-align: center; }

.pre-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 6rem);
  letter-spacing: -0.03em;
  line-height: 1;
  overflow: hidden;
  padding-bottom: 0.1em;
}

.pre-letter {
  display: inline-block;
  transform: translateY(115%);
  animation: line-rise 0.7s var(--ease) forwards;
}

.pre-letter:nth-child(1) { animation-delay: 0.05s; }
.pre-letter:nth-child(2) { animation-delay: 0.11s; }
.pre-letter:nth-child(3) { animation-delay: 0.17s; }
.pre-letter:nth-child(4) { animation-delay: 0.23s; }
.pre-letter:nth-child(5) { animation-delay: 0.29s; }
.pre-letter:nth-child(6) { animation-delay: 0.35s; }

.pre-dot { color: var(--accent); }

.pre-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 18px;
  opacity: 0;
  animation: fade-in 0.6s ease 0.5s forwards;
}

@keyframes fade-in { to { opacity: 1; } }

.pre-count {
  position: absolute;
  bottom: 34px;
  right: 40px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.4rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.pre-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.pre-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

/* Pause page-entrance animations until preloader finishes */
body.is-loading .reveal-load,
body.is-loading .ht-inner,
body.is-loading .pre-count { animation-play-state: paused; }
body.is-loading .reveal-load { animation-play-state: paused; }
body.is-loading .ht-inner { animation-play-state: paused; }

/* ===== Masked title lines ===== */
.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}

.line-inner {
  display: block;
  transform: translateY(115%);
  transition: transform 1s var(--ease);
}

.line-mask:nth-child(2) .line-inner { transition-delay: 0.12s; }
.line-mask:nth-child(3) .line-inner { transition-delay: 0.24s; }

.reveal.visible .line-inner,
.section-head.visible .line-inner { transform: translateY(0); }

/* ===== Cursor dot ===== */
.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 1401;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease, width 0.25s var(--ease), height 0.25s var(--ease);
}

.cursor-dot.is-active { width: 10px; height: 10px; }

@media (hover: none), (pointer: coarse) {
  .cursor-dot { display: none; }
}

/* ===== Section indicator ===== */
.section-indicator {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.loaded .section-indicator { opacity: 1; }

.section-indicator #si-current { color: var(--accent); }

.si-track {
  width: 1px;
  height: 72px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.si-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  transition: height 0.3s ease;
}

@media (max-width: 1240px) {
  .section-indicator { display: none; }
}

/* ===== Work preview (follows cursor) ===== */
.work-preview {
  position: fixed;
  top: 0; left: 0;
  width: 210px;
  height: 140px;
  border-radius: var(--r-md);
  pointer-events: none;
  z-index: 950;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(217, 242, 79, 0.32), transparent 55%),
    radial-gradient(120% 120% at 85% 90%, rgba(217, 242, 79, 0.12), transparent 55%),
    #1a1a1f;
  border: 1px solid rgba(217, 242, 79, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75) rotate(-4deg);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}

.work-preview.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(3deg);
}

.wp-idx {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.wp-cta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text);
}

@media (hover: none), (pointer: coarse) {
  .work-preview { display: none; }
}

/* ===== Marquee skew (JS-driven) ===== */
.marquee { transition: transform 0.2s ease-out; will-change: transform; }

/* ===== Footer giant signature ===== */
.footer { overflow: hidden; }

.footer-giant {
  text-align: center;
  padding: 40px 20px 10px;
  line-height: 0.8;
}

.fg-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6.2vw, 6.2rem);
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.14);
  transition: color 0.6s ease, -webkit-text-stroke-color 0.6s ease;
  cursor: default;
}

@media (hover: hover) {
  .fg-text:hover {
    color: var(--accent);
    -webkit-text-stroke-color: transparent;
  }
}

@media (max-width: 560px) {
  .footer-giant { padding: 32px 12px 8px; }

  .fg-text {
    white-space: normal;
    font-size: clamp(1.6rem, 10vw, 2.6rem);
    line-height: 1;
    display: block;
  }
}

/* =====================================================
   v4 layer — GSAP / Lenis / WebGL support
   ===================================================== */

/* Hero WebGL canvas */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}

.hero .wrap, .hero-scroll { z-index: 2; }

/* Split characters */
.char {
  display: inline-block;
  will-change: transform;
}

/* When GSAP is driving, disable the CSS fallback animations */
html.gsap-on .reveal-load { animation: none; opacity: 1; }
html.gsap-on .ht-inner { animation: none; transform: none; }
html.gsap-on .line-inner { transition: none; }
html.gsap-on .reveal { transition: none; opacity: 1; transform: none; }

/* Lenis smooth-scroll recommended styles */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ===== Mobile performance: drop GPU-heavy layers on touch devices ===== */
@media (hover: none), (pointer: coarse) {
  .grain { display: none; }
  #hero-canvas { display: none; }
  .marquee { will-change: auto; }

  /* Blur filters are the main scroll-jank source on phones — use solid fills */
  .nav.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(11, 11, 13, 0.96);
  }

  .nav-links {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(11, 11, 13, 0.99);
  }

  .portrait-tag {
    backdrop-filter: none;
    background: rgba(11, 11, 13, 0.85);
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .grain { display: none; }
  .line-inner, .ht-inner, .pre-letter { transform: none; }
  .preloader { display: none; }
  body.is-loading { overflow: auto; }
  .work-preview { display: none; }
}
