/* ============================================================
   Sujal Charak — Portfolio
   Refined technical · dark · engineer-credible
   ============================================================ */

@import url('tokens/fonts.css');

/* ---------- Tokens ---------- */
:root {
  /* surfaces */
  --bg:          #0a0b0d;
  --bg-2:        #0e1013;
  --surface:     #131619;
  --surface-2:   #181c21;
  --surface-3:   #1e232a;

  /* lines */
  --line:        rgba(255,255,255,0.07);
  --line-2:      rgba(255,255,255,0.12);
  --line-3:      rgba(255,255,255,0.20);

  /* text */
  --text:        #e9ebee;
  --text-dim:    #a4abb4;
  --text-mute:   #6c737c;
  --text-faint:  #4a5057;

  /* accent — refined electric green */
  --accent:      #5fe87a;
  --accent-2:    #84f09a;
  --accent-dim:  #3aa657;
  --accent-glow: rgba(95,232,122,0.16);
  --accent-soft: rgba(95,232,122,0.09);

  /* fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-sans:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px; --sp-11: 192px;

  /* radii */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 22px;

  /* layout */
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px); /* @kind spacing */

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
}

/* ---------- 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; } }

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

/* page-wide ambient: faint dot grid + top glow */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #06140a; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; z-index: 1; padding: clamp(72px, 11vw, 150px) 0; }
.section--tight { padding: clamp(56px, 8vw, 110px) 0; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

.kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before {
  content: ""; width: 22px; height: 1px; background: var(--accent-dim);
}
.kicker--plain { color: var(--text-mute); }
.kicker--plain::before { background: var(--line-3); }

.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .index {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute);
  letter-spacing: 0.12em; margin-bottom: 18px; display: block;
}
.section-head h2 { font-size: clamp(1.9rem, 4vw, 3rem); color: var(--text); }
.section-head .lead {
  margin-top: 18px; max-width: 56ch; color: var(--text-dim);
  font-size: clamp(1rem, 1.5vw, 1.15rem); text-wrap: pretty;
}

.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10,11,13,0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  height: 68px; display: grid; align-items: center;
  grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 2vw, 24px);
}
.nav__inner > .brand { justify-self: start; }
.nav__inner > .nav__actions { justify-self: end; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
/* hamburger toggle — mobile only */
.nav__toggle {
  display: none; flex: none; width: 38px; height: 38px;
  align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--text); background: var(--bg-2);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.nav__toggle:hover { border-color: var(--accent-dim); color: var(--accent); }
.nav__toggle svg { width: 19px; height: 19px; }
.nav__toggle .ic-close { display: none; }
.nav.open .nav__toggle .ic-menu { display: none; }
.nav.open .nav__toggle .ic-close { display: block; }
.brand {
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em; transition: color .2s var(--ease);
}
.brand:hover { color: var(--accent); }

/* mail action, top right */
.nav__mail {
  flex: none; width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  color: var(--accent); background: var(--bg-2);
  transition: border-color .22s var(--ease), background .22s var(--ease), transform .22s var(--ease);
}
.nav__mail svg { width: 17px; height: 17px; }
.nav__mail:hover { border-color: var(--accent-dim); background: var(--accent-soft); transform: translateY(-1px); }

/* scroll progress rail */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 110; pointer-events: none; }
.progress span {
  display: block; height: 100%; background: var(--accent);
  transform-origin: 0 50%; transform: scaleX(0); opacity: .9;
}

.nav__links {
  display: flex; align-items: center;
  justify-content: center; gap: 4px;
}
.nav__links a {
  font-family: var(--font-mono); font-size: 14px; color: var(--text-dim);
  padding: 9px 16px; border-radius: var(--r-sm); transition: color .2s, background .2s;
  position: relative; letter-spacing: 0.01em;
}
.nav__links a .n { color: var(--text-faint); margin-right: 8px; }
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a.active { color: var(--accent); }
.nav__links a.active .n { color: var(--accent-dim); }
.nav__links a[href="#top"] { display: none; } /* Home: dropdown-only, hidden on desktop */
@media (max-width: 720px) {
  .nav__inner { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; height: auto; padding-top: 10px; padding-bottom: 10px; position: relative; }
  .brand { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__mail { width: 38px; height: 38px; }
  .nav__links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border: 1px solid var(--line-2);
    border-radius: var(--r-sm); padding: 8px; margin: 0;
    box-shadow: 0 26px 54px -26px rgba(0,0,0,0.92);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
    z-index: 60;
  }
  .nav.open .nav__links { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav__links a {
    display: flex; align-items: center; padding: 13px 14px;
    font-size: 15px; border-radius: 7px; letter-spacing: 0.02em;
  }
  .nav__links a[href="#top"] { display: flex; }
  .nav__links a:hover, .nav__links a.active { background: var(--surface); }
  .nav__links a .n { display: none; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
  letter-spacing: 0.01em; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--accent); color: #06140a; }
.btn--primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--line-3); background: var(--surface); }
.btn--sm { padding: 8px 15px; font-size: 12.5px; }

/* arrow nudge */
.btn .arr { transition: transform .22s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding-top: 140px; padding-bottom: clamp(72px, 10vw, 130px); overflow: hidden; }
.hero::after {
  content: ""; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 560px; pointer-events: none; z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, var(--accent-glow), transparent 70%);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 1; }

/* two-column intro: text + portrait */
.hero__grid {
  display: grid; grid-template-columns: 1.18fr 0.82fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
@media (max-width: 900px){
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
}
.hero__text { min-width: 0; }

.hero__tagline {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text); padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 4px;
  background: var(--bg-2); margin-bottom: 30px;
}
.hero__pin {
  width: 14px; height: 14px; color: var(--accent); flex: none;
  margin-left: -2px;
}
@keyframes pulse { 0%{transform:scale(.6);opacity:.9} 100%{transform:scale(2.2);opacity:0} }

@media (max-width: 560px){
  .hero__tagline {
    white-space: normal; align-items: flex-start; gap: 8px;
    font-size: 10.5px; letter-spacing: 0.1em; line-height: 1.5;
    padding: 9px 13px; max-width: 100%;
  }
  .hero__pin { margin-top: 1px; }
}

.hero h1 {
  font-size: clamp(2.5rem, 4.8vw, 4.2rem);
  line-height: 1.0; letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__pitch {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.3; letter-spacing: -0.015em;
  color: var(--text-dim); max-width: 30ch; text-wrap: balance; margin-bottom: 24px;
}
.hero__lead {
  font-size: clamp(1rem, 1.5vw, 1.13rem); color: var(--text-dim);
  max-width: 56ch; line-height: 1.62; text-wrap: pretty; margin-bottom: 36px;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* hero portrait */
.hero__portrait { position: relative; margin: 0; justify-self: end; width: 100%; max-width: 420px; }
@media (max-width: 900px){ .hero__portrait { justify-self: start; max-width: 360px; } }
.hero__portrait img {
  width: 100%; height: auto; display: block; border-radius: var(--r);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.85);
}
.hero__portrait::after {
  content: ""; position: absolute; left: 16px; top: 16px; width: 30px; height: 30px;
  border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); opacity: .9;
}
.hero__portrait figcaption {
  margin-top: 14px; font-size: 11px; color: var(--text-mute);
  letter-spacing: 0.13em; text-transform: uppercase;
  display: flex; align-items: center; gap: 9px; justify-content: flex-start;
}
.hero__portrait figcaption::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }

/* ---- pri-sim panel (hero right column) ---- */
.sim {
  margin: 0; justify-self: end; width: 100%; max-width: 430px;
  background: #08090b; border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0,0,0,0.85);
  container-type: inline-size;
}
@media (max-width: 900px){ .sim { justify-self: start; max-width: 400px; } }
.sim__bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.sim__bar .d { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.sim__bar .t { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim__stage { position: relative; }
.sim__hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  color: var(--text); background: rgba(8,9,11,0.78);
  border: 1px solid var(--line-2); border-radius: 100px; padding: 6px 12px;
  pointer-events: none; opacity: 1;
  transition: opacity .5s var(--ease);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sim__hint.off { opacity: 0; }
.sim canvas { display: block; width: 100%; aspect-ratio: 1 / 1; cursor: crosshair; touch-action: manipulation; }
.sim__hud {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px;
  border-top: 1px solid var(--line); background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-mute);
}
.sim__hud > span { white-space: nowrap; flex: none; }
/* squeeze points: tighten first, then drop the most technical readout */
@container (max-width: 400px) {
  .sim__hud { gap: 6px 9px; font-size: 10px; letter-spacing: 0.06em; }
  .sim__hud button { padding: 4px 8px; font-size: 10px; }
}
@container (max-width: 348px) {
  .sim__hud .sim__eps { display: none; }
}
.sim__hud b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.sim__phase { display: inline-flex; align-items: center; gap: 7px; color: var(--text-dim); }
.sim__phase::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.sim__phase[data-state="learn"]::before { background: var(--accent-dim); }
.sim__phase[data-state="learned"] { color: var(--accent); }
.sim__phase[data-state="learned"]::before { background: var(--accent); }
.sim__hud button {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 5px 10px; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.sim__hud button:hover { color: var(--accent); border-color: var(--accent-dim); }
.sim__cap {
  padding: 12px 14px; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55;
  color: var(--text-dim); background: var(--bg-2);
}

/* credential strip — instrument readout */
.creds {
  margin-top: clamp(52px, 7vw, 88px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); overflow: hidden;
  counter-reset: cred;
}
.cred {
  position: relative; background: var(--bg-2); padding: 26px 22px 24px;
  counter-increment: cred;
  transition: background .25s var(--ease);
}
.cred::before {
  content: "0" counter(cred);
  position: absolute; top: 14px; right: 16px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--text-faint);
}
.cred::after {
  content: ""; position: absolute; top: 0; left: 22px;
  width: 18px; height: 2px; background: var(--accent-dim); opacity: .65;
  transition: opacity .25s var(--ease), background .25s var(--ease), width .25s var(--ease);
}
.cred:hover { background: var(--surface); }
.cred:hover::after { background: var(--accent); opacity: 1; width: 28px; }
.cred .num {
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(1.15rem, 1.6vw, 1.32rem);
  color: var(--text); letter-spacing: -0.01em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.cred .num .u { color: var(--accent); }
.cred .lab {
  margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-mute); letter-spacing: 0.05em; line-height: 1.6;
  text-transform: uppercase;
}
@media (max-width: 1040px) { .creds { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .creds { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .creds { grid-template-columns: 1fr; } }

/* ============================================================
   WORK
   ============================================================ */
.work-grid { display: grid; gap: 18px; }

.proj {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease), background .3s;
}
.proj:hover { border-color: var(--line-2); transform: translateY(-3px); background: var(--surface-2); }

/* featured project — two columns */
.proj--feature { grid-template-columns: 1.15fr 1fr; }
@media (max-width: 880px){ .proj--feature { grid-template-columns: 1fr; } }
/* reversed feature: visual on the left, body on the right */
.proj--feature-rev { grid-template-columns: 1fr 1.15fr; }
@media (max-width: 880px){ .proj--feature-rev { grid-template-columns: 1fr; } }
.proj--feature-rev .proj__visual { border-left: none; border-right: 1px solid var(--line); order: 0; }
@media (max-width: 880px){
  .proj--feature-rev { display: flex; flex-direction: column; }
  .proj--feature-rev .proj__visual { border-right: none; border-bottom: 1px solid var(--line); order: 2; }
}

/* ---- Mobile: stack every feature as a clean flex column (prevents the
   visual panel's min-height:100% from overlapping the body text) ---- */
@media (max-width: 880px){
  .proj--feature { display: flex; flex-direction: column; }
  .proj--feature .proj__visual { min-height: 0; }
  .proj--feature .proof { height: auto; min-height: 0; }
  .proj--feature .proof img { height: auto; }
  .proj--feature .proof.proof--diagram img { max-height: 70vh; }
  /* header row: let the id + long badge wrap instead of cramming on one line */
  .proj__top { flex-wrap: wrap; justify-content: flex-start; gap: 8px 12px; }
}

.proj__body { padding: clamp(26px, 3vw, 40px); display: flex; flex-direction: column; }
.proj__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.proj__id { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); letter-spacing: 0.1em; }
.proj__badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-dim); background: var(--accent-soft);
  padding: 5px 10px; border-radius: 100px; white-space: nowrap;
}
.proj__badge--mute { color: var(--text-dim); border-color: var(--line-2); background: transparent; }

.proj h3 { font-size: clamp(1.35rem, 2.4vw, 1.95rem); margin-bottom: 6px; color: var(--text); }
.proj .role { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); margin-bottom: 18px; }
.proj p { color: var(--text-dim); font-size: 15px; line-height: 1.62; max-width: 60ch; text-wrap: pretty; }

.proj__meta { margin-top: auto; padding-top: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim);
  border: 1px solid var(--line); padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--bg-2);
}

/* feature highlights list */
.hl { list-style: none; display: grid; gap: 12px; margin-top: 24px; }
.hl li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.6; color: var(--text-dim); }
.hl li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent); transform: rotate(45deg);
}
.hl li b { color: var(--text); font-weight: 500; }

/* feature side panel — terminal-ish */
.proj__visual {
  background: var(--bg-2); border-left: 1px solid var(--line);
  padding: clamp(22px, 2.6vw, 34px); display: flex; flex-direction: column; gap: 0;
  min-height: 100%;
}
@media (max-width: 880px){ .proj__visual { border-left: none; border-top: 1px solid var(--line); } }
.term {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85;
  background: #08090b; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  position: relative;
}
.term__bar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.term__bar .c { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.term__bar .t { margin-left: 8px; font-size: 11.5px; color: var(--text-mute); }
.term__body { padding: 16px 18px; flex: 1; overflow: hidden; }
.term__body .ln { white-space: pre-wrap; color: var(--text-dim); }
.term__body .pr { color: var(--accent); }
.term__body .cm { color: var(--text-faint); }
.term__body .ky { color: #7db4ff; }
.term__body .st { color: var(--accent-2); }
.term__body .nm { color: #e6c07b; }

/* live-proof photo (replaces synthetic terminal in feature card) */
.proof { position: relative; margin: 0; height: 100%; min-height: 280px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #08090b; }
.proof img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 40px 18px 16px; display: flex; flex-direction: column; gap: 7px;
  background: linear-gradient(to top, rgba(6,7,9,0.93) 12%, rgba(6,7,9,0.55) 60%, transparent);
}
.proof__live {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.proof__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.proof__txt { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--text-dim); }
.proof__zoom { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.proof.proof--diagram { background: #0a0d12; }
.proof.proof--diagram img { object-fit: contain; }
@media (max-width: 880px){ .proof { min-height: 240px; } }

/* app-window screenshot frame (for UI captures) */
.proj__visual--shot { padding: clamp(18px, 2.2vw, 30px); display: flex; align-items: stretch; justify-content: center; }
.shot { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 360px; max-height: 560px; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: #0e0f12; box-shadow: 0 20px 50px -30px rgba(0,0,0,0.8); }
.shot__bar { flex: none; height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.shot__bar .d { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.shot__bar .t { margin-left: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* vertical scroll gallery — full screenshots, spaced + titled, click to zoom */
.shot__img { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; background: #0b0c0e; -webkit-overflow-scrolling: touch; padding: 16px; display: flex; flex-direction: column; gap: 26px; }
.shot__frame { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--text-dim); }
.shot__n { font-size: 10.5px; color: #0b0c0e; background: var(--accent); border-radius: 4px; padding: 2px 6px; font-weight: 600; }
.shot__zoom {
  display: block; width: 100%; padding: 0; border: 1px solid rgba(255,255,255,0.09); border-radius: var(--r-sm);
  overflow: hidden; cursor: zoom-in; background: #fff; position: relative;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.shot__zoom:hover { border-color: var(--accent-dim); }
.shot__zoom::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(8,9,11,0.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") center / 15px no-repeat;
  opacity: 0; transition: opacity .2s var(--ease); backdrop-filter: blur(3px);
}
.shot__zoom:hover::after { opacity: 1; }
.shot__zoom img { width: 100%; height: auto; display: block; }
.shot__img::-webkit-scrollbar { width: 10px; }
.shot__img::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.shot__img::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 5px; }
.shot__img:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Mobile: stop the screenshot gallery from being a short fixed-height scroll box
   (which left a big empty gap). Let it grow and flow with the page instead. */
@media (max-width: 880px){
  .shot { height: auto; max-height: none; min-height: 0; }
  .shot__img { overflow-y: visible; -webkit-overflow-scrolling: auto; }
}
.shot__cap { flex: none; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); background: var(--surface); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.5; color: var(--text-dim); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 4vw, 60px); background: rgba(5,6,8,0.92); backdrop-filter: blur(8px);
  animation: lbIn .2s var(--ease-out);
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox__fig { margin: 0; display: flex; flex-direction: column; gap: 14px; max-width: 100%; max-height: 100%; }
.lightbox__img {
  max-width: 92vw; max-height: 82vh; width: auto; height: auto; object-fit: contain;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
  background: #fff;
}
.lightbox__pdf {
  width: 92vw; max-width: 980px; height: 82vh; overflow-y: auto;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #26282c; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9);
  padding: 16px; display: flex; flex-direction: column; gap: 16px; align-items: center;
  -webkit-overflow-scrolling: touch;
}
.lightbox__pdf[hidden] { display: none; }
.lightbox__pdf canvas { max-width: 100%; height: auto; border-radius: 4px; box-shadow: 0 10px 28px -10px rgba(0,0,0,0.65); background: #fff; }
.lightbox__loading { margin: auto; color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; padding: 48px 24px; text-align: center; line-height: 1.6; }
.lightbox__loading a { color: var(--accent); }

/* video / audio demos in the lightbox */
.lightbox__media { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 92vw; max-height: 82vh; }
.lightbox__media[hidden] { display: none; }
.lightbox__video { max-width: 92vw; max-height: 78vh; width: auto; height: auto; border-radius: var(--r); border: 1px solid var(--line-2); background: #000; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9); }
.audiodemo { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: clamp(36px,6vw,56px) clamp(28px,6vw,72px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9); min-width: min(460px, 86vw); max-width: 86vw; }
.audiodemo__icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); border: 1px solid var(--accent-dim); background: var(--accent-soft); }
.audiodemo__icon svg { width: 30px; height: 30px; }
.audiodemo__label { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-align: center; letter-spacing: 0.01em; line-height: 1.5; max-width: 38ch; }
.audiodemo__label b { color: var(--text); font-weight: 600; }
.lightbox__audio { width: min(420px, 80vw); }
.lightbox__frame { width: 92vw; max-width: 1040px; height: 88vh; border: 1px solid var(--line-2); border-radius: var(--r); background: #16181b; box-shadow: 0 30px 80px -30px rgba(0,0,0,0.9); }
.lightbox__frame[hidden] { display: none; }
.lightbox__cap { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); text-align: center; letter-spacing: 0.02em; }
.lightbox__close {
  position: absolute; top: clamp(16px, 3vw, 28px); right: clamp(16px, 3vw, 28px);
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.lightbox__close:hover { border-color: var(--accent-dim); color: var(--accent); }
.lightbox__close svg { width: 20px; height: 20px; }

/* confidential / patent note */
.proj__note {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 22px;
  font-size: 13.5px; line-height: 1.55; color: var(--text-mute);
  border-top: 1px solid var(--line); padding-top: 20px; max-width: 60ch;
}
.proj__note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-dim); }
.proj__note a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); }
.proj__note a:hover { color: var(--accent-2); }
.proj--sm .proj__body { padding: clamp(24px, 2.6vw, 32px); }
.proj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px){ .proj-row { grid-template-columns: 1fr; } }
.proj-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 960px){ .proj-row--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px){ .proj-row--3 { grid-template-columns: 1fr; } }
.proj-row--2x2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px){ .proj-row--2x2 { grid-template-columns: 1fr; } }
/* multiple footer links on a card */
.proj__links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp { display: grid; grid-template-columns: 200px 1fr; gap: clamp(20px, 4vw, 56px); }
@media (max-width: 720px){ .exp { grid-template-columns: 1fr; gap: 8px; } }
.exp + .exp { margin-top: 8px; padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid var(--line); }
.exp__when { font-family: var(--font-mono); font-size: 13px; color: var(--text-mute); padding-top: 6px; }
.exp__role { font-family: var(--font-display); font-size: clamp(1.2rem,2vw,1.55rem); font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.exp__org { font-family: var(--font-mono); font-size: 13.5px; color: var(--accent); margin-top: 8px; }
.exp__org .loc { color: var(--text-mute); }
.exp ul { list-style: none; margin-top: 20px; display: grid; gap: 13px; }
.exp ul li { position: relative; padding-left: 22px; color: var(--text-dim); font-size: 15px; line-height: 1.6; max-width: 72ch; }
.exp ul li::before { content: "—"; position: absolute; left: 0; color: var(--accent-dim); }
.exp ul li b { color: var(--text); font-weight: 500; }
.exp__lead { margin-top: 16px; color: var(--text); font-size: 15.5px; line-height: 1.62; max-width: 72ch; text-wrap: pretty; }
.exp__stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.exp__stack .tag {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute);
  border: 1px solid var(--line-2); border-radius: 100px; padding: 5px 12px; background: var(--surface);
}
.exp__stack .tag--link {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line-2));
  text-decoration: none; transition: background .18s ease, border-color .18s ease;
}
.exp__stack .tag--link:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: clamp(36px, 6vw, 72px); align-items: start; }
@media (max-width: 820px){ .about { grid-template-columns: 1fr; gap: 36px; } }
.about__media { position: relative; margin: 0; }
.about__media img {
  width: 100%; height: auto; display: block; border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px -24px rgba(0,0,0,0.8);
}
.about__media::after {
  content: ""; position: absolute; left: 14px; top: 14px; width: 26px; height: 26px;
  border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); opacity: .85;
}
.about__media figcaption {
  margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 9px;
}
.about__media figcaption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (max-width: 820px){ .about__media { max-width: 340px; } }
.about__text { display: flex; flex-direction: column; gap: clamp(24px, 3vw, 34px); }
.about__lead { font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.02em; color: var(--text); text-wrap: balance; }
.about__lead em { font-style: normal; color: var(--accent); }
.about__body p { color: var(--text-dim); font-size: 15.5px; line-height: 1.7; text-wrap: pretty; }
.about__body p + p { margin-top: 18px; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 820px){ .skills { grid-template-columns: 1fr; } }
.skill-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 26px; transition: border-color .3s; }
.skill-card:hover { border-color: var(--line-2); }
.skill-card h4 { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.skill-card h4 .ix { color: var(--text-faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim); background: var(--bg-2); border: 1px solid var(--line); padding: 6px 11px; border-radius: var(--r-sm); transition: color .2s, border-color .2s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }

/* ============================================================
   EDUCATION + writing
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px){ .edu-grid { grid-template-columns: 1fr; } }
.edu { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 28px; }
.edu .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); margin-bottom: 14px; }
.edu h4 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text); margin-bottom: 8px; letter-spacing: -0.01em; }
.edu .deg { color: var(--text-dim); font-size: 14.5px; }
.edu .deg .pill { display:inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--accent); border: 1px solid var(--accent-dim); padding: 2px 8px; border-radius: 100px; margin-left: 8px; vertical-align: middle; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { position: relative; z-index: 1; padding: clamp(80px,11vw,150px) 0 0; }
.contact__inner { border-top: 1px solid var(--line); padding-top: clamp(56px, 8vw, 96px); }
.contact h2 { font-size: clamp(2.2rem, 6vw, 4.4rem); letter-spacing: -0.03em; line-height: 1.02; max-width: 14ch; }
.contact h2 a { color: var(--accent); position: relative; white-space: nowrap; }
.contact h2 a::after { content:""; position:absolute; left:0; right:0; bottom:4px; height:2px; background: var(--accent-dim); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.contact h2 a:hover::after { transform: scaleX(1); }
.contact__lead { margin-top: 26px; color: var(--text-dim); font-size: clamp(1rem,1.6vw,1.2rem); max-width: 52ch; text-wrap: pretty; }

.links { margin-top: clamp(40px,6vw,64px); display: flex; flex-wrap: wrap; gap: 12px; }
/* Phones: long mono handles (email, github) can't break, so give each card
   the full row instead of letting them crowd the screen edge. */
@media (max-width: 480px){
  .links { flex-direction: column; align-items: stretch; }
  .link-card { justify-content: flex-start; }
}
.link-card {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 13.5px; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 13px 18px;
  transition: border-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease); background: var(--surface);
}
.link-card:hover { border-color: var(--accent-dim); color: var(--accent); transform: translateY(-2px); }
.link-card svg { width: 17px; height: 17px; opacity: .9; }
.link-card .ext { color: var(--text-faint); transition: transform .22s var(--ease); }
.link-card:hover .ext { transform: translate(2px,-2px); color: var(--accent-dim); }
.link-card--accent { background: var(--accent); color: #06140a; border-color: var(--accent); }
.link-card--accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #06140a; }
.link-card--accent svg { opacity: 1; }

/* project repo link */
.proj__link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim);
  border: 1px solid var(--line-2); padding: 9px 14px; border-radius: var(--r-sm);
  background: var(--bg-2); transition: color .2s var(--ease), border-color .2s var(--ease);
}
.proj__link:hover { color: var(--accent); border-color: var(--accent-dim); }
.proj__link svg { width: 14px; height: 14px; }
.proj__link .ext { width: 12px; height: 12px; opacity: .55; transition: transform .2s var(--ease); }
.proj__link:hover .ext { transform: translate(2px,-2px); color: var(--accent-dim); }

.footer { z-index: 1; position: relative; margin-top: clamp(80px,11vw,140px); padding: 34px 0; border-top: 1px solid var(--line); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 560px){
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer__sep { gap: 20px; }
}
.footer__inner span { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); }
.footer__inner .top { cursor: pointer; transition: color .2s; }
.footer__inner .top:hover { color: var(--accent); }
.footer__sep { display: inline-flex; align-items: center; gap: 22px; }
.footer__link { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-mute); transition: color .2s; }
.footer__link:hover { color: var(--accent); }

/* ============================================================
   REVEAL animation
   ============================================================ */
.reveal { opacity: 1; transform: none; }
.js .reveal { animation: revealUp .62s var(--ease-out) both; }
@keyframes revealUp { from { opacity: .25; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.reveal[data-d="1"]{ animation-delay: .07s; }
.reveal[data-d="2"]{ animation-delay: .14s; }
.reveal[data-d="3"]{ animation-delay: .21s; }
.reveal[data-d="4"]{ animation-delay: .28s; }
@media (prefers-reduced-motion: reduce){ .js .reveal { animation: none; } }

/* ============================================================
   TWEAKS — expressive controls
   Accent palette is driven by CSS vars set on :root via JS.
   Voice + Atmosphere react to data-attributes on :root.
   ============================================================ */

/* ---- Headline voice : recasts every display-font element ---- */
:root[data-voice="terminal"] { --font-display: 'IBM Plex Mono', ui-monospace, monospace; }
:root[data-voice="terminal"] h1,
:root[data-voice="terminal"] h2,
:root[data-voice="terminal"] h3,
:root[data-voice="terminal"] h4,
:root[data-voice="terminal"] .hero__pitch,
:root[data-voice="terminal"] .about__lead,
:root[data-voice="terminal"] .exp__role,
:root[data-voice="terminal"] .edu h4 {
  letter-spacing: -0.005em; font-weight: 500;
}
:root[data-voice="terminal"] .hero h1 { line-height: 1.08; }

:root[data-voice="quiet"] { --font-display: 'IBM Plex Sans', system-ui, sans-serif; }
:root[data-voice="quiet"] h1,
:root[data-voice="quiet"] h2,
:root[data-voice="quiet"] h3 { letter-spacing: -0.028em; font-weight: 600; }

/* ---- Atmosphere : ambient intensity from flat to CRT ---- */
/* Minimal — strip the glow, grid and shadows for an editorial calm */
:root[data-atmo="minimal"] body::before { display: none; }
:root[data-atmo="minimal"] .hero::after { opacity: 0; }
:root[data-atmo="minimal"] .proj,
:root[data-atmo="minimal"] .skill-card,
:root[data-atmo="minimal"] .edu { box-shadow: none; }
:root[data-atmo="minimal"] .hero__portrait img { box-shadow: 0 12px 32px -24px rgba(0,0,0,0.7); }
:root[data-atmo="minimal"] .proj:hover,
:root[data-atmo="minimal"] .link-card:hover { transform: none; }

/* Maximal — amplify glow, grid, scanlines, accent bloom */
:root[data-atmo="maximal"] body::before {
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.045) 1px, transparent 1px);
}
:root[data-atmo="maximal"] .hero::after {
  opacity: 1; width: 1120px; height: 720px; filter: blur(8px);
}
:root[data-atmo="maximal"] .hero h1 em,
:root[data-atmo="maximal"] .accent,
:root[data-atmo="maximal"] .kicker,
:root[data-atmo="maximal"] .section-head .index {
  text-shadow: 0 0 22px var(--accent-glow);
}
:root[data-atmo="maximal"] .hero__tagline .pulse {
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px var(--accent);
}
:root[data-atmo="maximal"] .term::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: repeating-linear-gradient(0deg, var(--accent-soft) 0 1px, transparent 1px 3px);
}
:root[data-atmo="maximal"] .proj:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 26px 60px -34px var(--accent-glow);
}
:root[data-atmo="maximal"] .hero__portrait img,
:root[data-atmo="maximal"] .skill-card:hover,
:root[data-atmo="maximal"] .edu:hover { border-color: var(--accent-dim); }
