/* ============================================================
   Manav Jain — portfolio
   Concept: "Signal" — vital-waveform motif over deep ink
   ============================================================ */

:root {
  /* surfaces */
  --ink:    #08090b;
  --ink-2:  #0d0f13;
  --ink-3:  #14171d;
  --line:   rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.04);

  /* text */
  --text:   #ecece6;
  --muted:  #8b909a;
  --faint:  #5a5f69;

  /* accents */
  --signal: #c8ff3d;            /* electric lime — the vital pulse */
  --signal-soft: rgba(200, 255, 61, 0.14);
  --signal-line: rgba(200, 255, 61, 0.32);
  --ember:  #ff6a3d;            /* warm secondary, used sparingly */

  /* type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint vertical grain over the whole page */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.022) 1px, transparent 0);
  background-size: 36px 36px;
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; }
em { font-style: normal; color: var(--signal); }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--signal); color: #000; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { position: relative; z-index: 1; padding: 130px 0; }

/* ---------------- scroll progress ---------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: var(--line); z-index: 200;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--signal), #9fe000);
  box-shadow: 0 0 12px var(--signal-line);
}

/* ---------------- custom cursor ---------------- */
.cursor, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 300; border-radius: 50%; mix-blend-mode: difference; will-change: transform; }
.cursor { width: 7px; height: 7px; background: #fff; transform: translate(-50%, -50%); }
.cursor-ring {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,0.6);
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s, border-color .25s;
}
.cursor-ring.is-hover { width: 56px; height: 56px; border-color: var(--signal); background: var(--signal-soft); }
@media (hover: none), (max-width: 820px) { .cursor, .cursor-ring { display: none; } }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  transition: background .4s var(--ease), padding .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  padding: 12px 28px;
}
.nav__brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.04em; }
.nav__mark {
  font-size: 15px; color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; line-height: 1;
}
.nav__pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 var(--signal-line); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200,255,61,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(200,255,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,255,61,0); }
}
.nav__links { display: flex; align-items: center; gap: 30px; font-size: 14px; }
.nav__links a { color: var(--muted); transition: color .25s; position: relative; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0;
  background: var(--signal); transition: width .3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  color: var(--text) !important; border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 100px; transition: all .25s;
}
.nav__cta:hover { background: var(--signal); color: #000 !important; border-color: var(--signal); }
.nav__menu { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav__menu span { width: 22px; height: 1.6px; background: var(--text); transition: transform .3s var(--ease), opacity .3s; }
.nav__menu.is-open span:first-child { transform: translateY(3.3px) rotate(45deg); }
.nav__menu.is-open span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

/* ---------------- hero ---------------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 28px 80px;
  overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,255,61,0.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(255,106,61,0.05), transparent 60%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto; }

.hero__eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.18em;
  color: var(--muted); display: inline-flex; align-items: center; gap: 12px; margin-bottom: 26px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); }

.hero__name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 16vw, 12rem); line-height: 0.86; letter-spacing: -0.03em;
  color: var(--text); margin-bottom: 34px;
}
.hero__name-line { display: block; }
.hero__cursor {
  display: inline-block; width: clamp(0.35rem, 1.4vw, 1rem); height: clamp(2.6rem, 11vw, 8rem);
  background: var(--signal); margin-left: 0.12em; vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite; box-shadow: 0 0 22px var(--signal-line);
}
@keyframes blink { 50% { opacity: 0; } }

.hero__tagline {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 4vw, 2.7rem); line-height: 1.15; letter-spacing: -0.02em;
  max-width: 19ch; margin-bottom: 22px;
}
.cycler { display: inline-block; position: relative; color: var(--signal); }
.cycler__word { display: inline-block; transition: transform .5s var(--ease), opacity .5s var(--ease); }
.cycler__word.is-out { transform: translateY(-0.7em); opacity: 0; }
.cycler__word.is-in { animation: wordIn .5s var(--ease); }
@keyframes wordIn { from { transform: translateY(0.7em); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.hero__sub { color: var(--muted); font-size: clamp(0.98rem, 2vw, 1.12rem); max-width: 52ch; margin-bottom: 42px; }
.link-underline { color: var(--text); border-bottom: 1px solid var(--signal-line); transition: border-color .25s, color .25s; }
.link-underline:hover { border-color: var(--signal); color: var(--signal); }

.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  padding: 14px 24px; border-radius: 100px; cursor: pointer;
  transition: transform .3s var(--ease), background .3s, color .3s, border-color .3s, box-shadow .3s;
  border: 1px solid transparent;
}
.btn svg { transition: transform .3s var(--ease); }
.btn--primary { background: var(--signal); color: #07080a; }
.btn--primary:hover { box-shadow: 0 12px 40px -10px var(--signal-line); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); }

.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.25em; color: var(--faint);
  text-transform: uppercase;
}
.hero__scroll-line { width: 1px; height: 46px; background: linear-gradient(var(--signal), transparent); position: relative; overflow: hidden; }
.hero__scroll-line::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 40%; background: var(--signal); animation: scrolldot 2s var(--ease) infinite; }
@keyframes scrolldot { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }

/* ---------------- reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

/* ---------------- manifesto ---------------- */
.manifesto { padding: 120px 0; }
.manifesto__text {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 4.6vw, 3.2rem); line-height: 1.32; letter-spacing: -0.015em;
  color: var(--faint); max-width: 24ch;
}
@media (min-width: 720px) { .manifesto__text { max-width: none; } }
.reveal-word { display: inline-block; color: var(--faint); opacity: 0.25; transition: opacity .5s var(--ease), color .5s var(--ease); margin-right: 0.16em; }
.reveal-word.lit { opacity: 1; color: var(--text); }
.reveal-word.accent.lit { color: var(--signal); }

/* ---------------- stats ---------------- */
.stats { padding: 80px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stat { border-left: 1px solid var(--line); padding-left: 22px; }
.stat__num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1; letter-spacing: -0.03em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat__num .suf { color: var(--signal); }
.stat__label { font-size: 15px; color: var(--text); margin-top: 14px; }
.stat__note { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); margin-top: 6px; letter-spacing: 0.02em; }

/* ---------------- section heads ---------------- */
.section-head { margin-bottom: 64px; max-width: 640px; }
.section-head__index { font-family: var(--font-mono); font-size: 12px; color: var(--signal); letter-spacing: 0.2em; }
.section-head__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.025em; margin: 12px 0 14px; }
.section-head__sub { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }

/* ---------------- work grid ---------------- */
.work__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; transition: transform .35s var(--ease), border-color .35s, background .35s;
  transform-style: preserve-3d;
}
.card:hover { border-color: var(--signal-line); background: var(--ink-3); }
.card--feature { grid-column: span 2; background: linear-gradient(150deg, var(--ink-3), var(--ink-2)); }
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.card__tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--signal); background: var(--signal-soft); padding: 5px 10px; border-radius: 100px; }
.card__year { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 1.9rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.card--feature .card__title { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.card__desc { color: var(--muted); font-size: 15px; max-width: 56ch; }
.card--feature .card__desc { font-size: 16.5px; }
.card__meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.card__meta li { font-family: var(--font-mono); font-size: 11px; color: var(--faint); border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; }
.card__glow {
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, var(--signal-soft), transparent 70%);
  opacity: 0; transition: opacity .4s; pointer-events: none; transform: translate(-50%, -50%);
  left: var(--mx, 50%); top: var(--my, 50%);
}
.card:hover .card__glow { opacity: 1; }

/* ---------------- timeline ---------------- */
.timeline { list-style: none; }
.tl { display: grid; grid-template-columns: 40px 1fr; }
.tl__line { position: relative; display: flex; justify-content: center; }
.tl__line::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl:first-child .tl__line::before { top: 22px; }
.tl:last-child .tl__line::before { bottom: auto; height: 22px; }
.tl__node {
  position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--faint); margin-top: 16px; transition: all .35s var(--ease);
}
.tl.is-active .tl__node, .tl:hover .tl__node { border-color: var(--signal); background: var(--signal); box-shadow: 0 0 0 5px var(--signal-soft); }
.tl__body { padding: 0 0 44px 26px; }
.tl__head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 12px 0; gap: 20px; }
.tl__role { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 3vw, 1.7rem); letter-spacing: -0.02em; }
.tl__role span { color: var(--signal); }
.tl__when { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.tl__chev { width: 11px; height: 11px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .35s var(--ease), border-color .35s; flex-shrink: 0; }
.tl__head[aria-expanded="true"] .tl__chev { transform: rotate(-135deg); border-color: var(--signal); }
.tl__detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.tl__head[aria-expanded="true"] + .tl__detail { grid-template-rows: 1fr; }
.tl__detail-inner { overflow: hidden; }
.tl__detail-inner p { color: var(--muted); margin: 6px 0 14px; max-width: 64ch; }
.tl__detail-inner ul { list-style: none; display: grid; gap: 9px; max-width: 70ch; }
.tl__detail-inner li { position: relative; padding-left: 20px; color: var(--muted); font-size: 15px; }
.tl__detail-inner li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 1px; background: var(--signal); }

/* ---------------- skills ---------------- */
.skills__tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.skills__tab {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 100px;
  padding: 9px 20px; cursor: pointer; transition: all .25s;
}
.skills__tab:hover { color: var(--text); border-color: var(--faint); }
.skills__tab.is-active { background: var(--signal); color: #000; border-color: var(--signal); }
.skills__panels { position: relative; min-height: 180px; }
.skills__panel { display: none; }
.skills__panel.is-active { display: block; animation: fadeUp .5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.skills__lead { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 26px; max-width: 26ch; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
  border: 1px solid var(--line); background: var(--ink-2); border-radius: 8px; padding: 9px 14px;
  transition: transform .25s var(--ease), border-color .25s, color .25s, background .25s;
}
.chip:hover { transform: translateY(-3px); border-color: var(--signal); color: var(--signal); background: var(--signal-soft); }

/* ---------------- proof ---------------- */
.proof__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.proof__item {
  position: relative; display: block;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px; transition: border-color .3s, background .3s, transform .3s var(--ease);
}
a.proof__item:hover { border-color: var(--signal-line); background: var(--ink-3); transform: translateY(-4px); }
.proof__kicker { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--signal); }
.proof__item h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 1.6rem); letter-spacing: -0.02em; margin: 12px 0 10px; }
.proof__item p { color: var(--muted); font-size: 15px; max-width: 50ch; }
.proof__arrow { position: absolute; top: 28px; right: 30px; font-size: 22px; color: var(--faint); transition: transform .3s var(--ease), color .3s; }
a.proof__item:hover .proof__arrow { color: var(--signal); transform: translate(4px, -4px); }

/* ---------------- contact ---------------- */
.contact { text-align: center; padding: 150px 0 130px; }
.contact__inner { display: flex; flex-direction: column; align-items: center; }
.contact__eyebrow { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.16em; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.contact__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 8vw, 6rem); line-height: 0.98; letter-spacing: -0.03em; margin: 26px 0 44px; }
.contact__email {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.2rem, 4vw, 2.4rem);
  letter-spacing: -0.02em; color: var(--text); padding-bottom: 8px;
  border-bottom: 2px solid var(--signal-line); transition: border-color .3s, color .3s;
}
.contact__email:hover { color: var(--signal); border-color: var(--signal); }
.contact__email svg { transition: transform .3s var(--ease); }
.contact__email:hover svg { transform: translate(5px, -5px); }
.contact__socials { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 56px; }
.contact__socials a { font-family: var(--font-mono); font-size: 13.5px; color: var(--muted); position: relative; transition: color .25s; }
.contact__socials a::after { content: ""; position: absolute; left: 0; bottom: -5px; height: 1px; width: 0; background: var(--signal); transition: width .3s var(--ease); }
.contact__socials a:hover { color: var(--text); }
.contact__socials a:hover::after { width: 100%; }

/* ---------------- footer ---------------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; position: relative; z-index: 1; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.footer__mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.02em; }

/* ---------------- responsive ---------------- */
@media (max-width: 920px) {
  .work__grid { grid-template-columns: repeat(2, 1fr); }
  .card--feature { grid-column: span 2; }
}
@media (max-width: 820px) {
  .section { padding: 90px 0; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 26px;
    background: rgba(10,11,14,0.96); backdrop-filter: blur(18px);
    padding: 0 40px; transform: translateX(100%); transition: transform .45s var(--ease);
    font-size: 22px; border-left: 1px solid var(--line);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__menu { display: flex; z-index: 101; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 36px 20px; }
  .work__grid { grid-template-columns: 1fr; }
  .card--feature { grid-column: span 1; }
  .proof__grid { grid-template-columns: 1fr; }
  .br-mobile { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .stats__grid { grid-template-columns: 1fr; }
  .contact__socials { gap: 18px; }
}
