/* ═══════════════════════════════════════════════════════════
   MANAN SHAH — PORTFOLIO
   Dusk flight world as the HERO, opaque reading sheets for the
   content. Instrument Sans + Serif italics + Inter + Geist Mono.

   Readability contract (2026-10, don't regress):
   the 3D world is a spectacle at the top of the page and a quiet
   texture everywhere below it. Content never floats on live
   water: every text-bearing section sits on `.sheet`, a near
   opaque surface. The canvas itself is dimmed by scroll (see
   `.world-dim` + the opacity ramp in main.js).
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ground */
  --void: #0a0b16;
  --void-2: #12142a;

  /* surfaces: one sheet, one raised tier. No glass-on-glass. */
  --panel: rgba(10, 11, 22, 0.94);
  --raise: rgba(28, 30, 54, 0.58);
  --raise-hi: rgba(36, 39, 68, 0.72);

  /* ink ramp, warm throughout, measured over sun glare */
  --ink: #f7f5f0;
  --ink-dim: #dcd8d0;
  --ink-faint: #aba69c;

  --accent: #ffab70;
  --accent-soft: rgba(255, 171, 112, 0.14);
  --green: #5ddba0;
  --amber: #fbbf24;

  --line: rgba(246, 243, 236, 0.13);
  --line-soft: rgba(246, 243, 236, 0.07);

  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --radius: 20px;
  --measure: 64ch;
}

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

html {
  scroll-behavior: auto;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #1a120a; }

/* visible focus everywhere: readability includes keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #1a120a;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: translateY(0); }

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.16em;
  font-variant-ligatures: none;
}
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
}

/* ═══════════ CANVAS + ATMOSPHERE ═══════════ */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* the world recedes: opacity is driven by scroll in main.js, so the
   hero is vivid and everything below it is a calm backdrop */
.world-dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(130% 110% at 50% 30%, rgba(8, 9, 18, 0.74), rgba(6, 7, 14, 0.94));
  will-change: opacity;
}

/* static grain: the old version animated the whole viewport every 200ms,
   which cost a full-screen repaint for an effect nobody can see move */
.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 100% 85% at 50% 45%, transparent 62%, rgba(6, 7, 14, 0.6) 100%);
}

.webgl-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to bottom, #0b0c1e 0%, #1b1638 45%, #55304a 72%, #b06a52 84%, #0a0b16 86%, #0a0b16 100%);
}

/* ═══════════ PRELOADER ═══════════ */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--void);
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader-inner { text-align: center; width: min(320px, 70vw); }
.preloader-count {
  font-size: 0.95rem;
  color: var(--ink-dim);
  letter-spacing: 0.3em;
  margin-bottom: 1rem;
}
.preloader-bar { height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.preloader-bar span { display: block; height: 100%; width: 0%; background: var(--accent); }
.preloader-label {
  margin-top: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
}

/* ═══════════ ENTER OVERLAY ═══════════ */

.enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(10, 11, 22, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  text-align: center;
  padding: 1.5rem;
}
.enter-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
}
.enter-role {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.22em;
}
.enter-mission {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
}
.enter-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.enter-silent {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0.3rem 0.6rem;
}
.enter-silent:hover { color: var(--ink-dim); }

/* ═══════════ CHECKPOINT TOAST ═══════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 3.2rem;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 11, 22, 0.9);
  backdrop-filter: blur(12px);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 760px);
}
.toast-check { color: var(--accent); font-size: 0.9rem; }
@media (max-width: 860px) { .toast { display: none; } }

/* ═══════════ HUD ═══════════ */

.hud { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.hud-item {
  position: absolute;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: rgba(246, 243, 236, 0.4);
  font-family: var(--font-mono);
}
.hud-tl { top: 5.6rem; left: 2rem; }
.hud-tr { top: 5.6rem; right: 2rem; }
.hud-bl { bottom: 1.5rem; left: 2rem; }
.hud-br { bottom: 1.5rem; right: 2rem; }
@media (max-width: 1100px) { .hud { display: none; } }

/* ═══════════ NAV ═══════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.6rem);
  background: rgba(10, 11, 22, 0.72);
  backdrop-filter: blur(16px) saturate(130%);
  border-bottom: 1px solid var(--line-soft);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav-links a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 0.9rem; }
.nav-resume {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  transition: background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.nav-resume:hover { background: var(--accent-soft); border-color: var(--accent); }
@media (max-width: 900px) { .nav-links { display: none; } }

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.audio-toggle:hover { border-color: rgba(255, 255, 255, 0.28); color: var(--ink); }
.audio-label { font-size: 0.68rem; letter-spacing: 0.16em; white-space: nowrap; }
.audio-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.audio-bars i {
  width: 2px;
  height: 3px;
  background: currentColor;
  display: block;
}
.audio-toggle.is-on { color: var(--accent); border-color: var(--accent-soft); }
.audio-toggle.is-on .audio-bars i {
  animation: eq 0.6s ease-in-out infinite alternate;
}
.audio-toggle.is-on .audio-bars i:nth-child(1) { animation-delay: 0s; }
.audio-toggle.is-on .audio-bars i:nth-child(2) { animation-delay: 0.15s; }
.audio-toggle.is-on .audio-bars i:nth-child(3) { animation-delay: 0.3s; }
.audio-toggle.is-on .audio-bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { from { height: 3px; } to { height: 11px; } }
/* the fixed nav has no page to borrow width from: at phone widths its
   own content was 6px wider than the viewport, which scrolled the page
   sideways. Tighten it rather than letting it push the document. */
@media (max-width: 560px) {
  .audio-label { display: none; }
  .nav { padding: 0.9rem 1rem; gap: 0.6rem; }
  .nav-logo { font-size: 0.95rem; }
  .nav-right { gap: 0.5rem; }
  .nav-resume { padding: 0.4rem 0.65rem; letter-spacing: 0.1em; }
  .audio-toggle { padding: 0.4rem 0.6rem; }
}

/* ═══════════ LAYOUT / SECTIONS ═══════════ */

main { position: relative; z-index: 10; }

.section {
  position: relative;
  scroll-margin-top: 5.5rem;
  padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1rem, 4vw, 3rem);
  max-width: 1280px;
  margin: 0 auto;
}

/* THE reading surface. Every text-bearing section gets one, so content
   never composites over live water. Near opaque on purpose. */
.sheet {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 4vw, 3.6rem);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.sheet-flat { padding: clamp(1.4rem, 3vw, 2.4rem); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4.5vh, 3.4rem);
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line-soft);
}
.section-head-tight { border-bottom: none; padding-bottom: 0; margin-bottom: 1.6rem; }
.section-index {
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.028em;
}
.section-note {
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-left: auto;
  letter-spacing: 0.16em;
}
@media (max-width: 860px) { .section-note { display: none; } }

/* split animation targets */
.char { display: inline-block; transform: translateY(115%); opacity: 0; }
.w-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
.w-inner { display: inline-block; transform: translateY(112%); }

/* ═══════════ HERO ═══════════ */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: none;
  padding-left: clamp(1.2rem, 7vw, 8rem);
  padding-right: clamp(1.2rem, 7vw, 8rem);
}
/* scrim instead of a sheet: the hero is where the world is allowed to win */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 80% at 34% 50%, rgba(8, 9, 18, 0.94), rgba(8, 9, 18, 0.6) 58%, transparent 86%);
}
.hero > * { position: relative; }
.hero-kicker {
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 1.9rem;
  letter-spacing: 0.2em;
}
/* no text-shadow here: the word-mask spans would clip it into boxes */
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.6vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: -0.034em;
  max-width: 19ch;
}
.hero-title em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.hero-sub {
  max-width: 54ch;
  margin-top: 1.9rem;
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  line-height: 1.75;
  color: var(--ink-dim);
  text-shadow: 0 1px 24px rgba(6, 7, 14, 0.95);
}
.hero-cta { display: flex; gap: 0.8rem; margin-top: 2.4rem; flex-wrap: wrap; }

.scroll-hint {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
}
.scroll-hint-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: hint-drop 2.4s ease-in-out infinite;
}
@keyframes hint-drop {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (max-width: 860px) { .scroll-hint { display: none; } }

/* ═══════════ BUTTONS ═══════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn span { position: relative; z-index: 1; }
.btn-primary { background: var(--accent); color: #1a120a; font-weight: 500; }
.btn-primary:hover { background: #ffc396; }
.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(246, 243, 236, 0.03);
}
.btn-ghost:hover { border-color: rgba(246, 243, 236, 0.55); background: rgba(246, 243, 236, 0.07); }

/* ═══════════ ABOUT ═══════════ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.about-photo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--raise);
}
.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.03);
}
.about-photo figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.7rem 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  background: linear-gradient(to top, rgba(6, 7, 14, 0.92), transparent);
}

.about-text {
  max-width: var(--measure);
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--ink-dim);
}
.about-text .word-inner { display: inline-block; }

.about-facts {
  margin-top: 2.4rem;
  display: grid;
  gap: 0.2rem;
  border-top: 1px solid var(--line-soft);
}
.fact {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.98rem;
  color: var(--ink);
}
@media (max-width: 620px) { .fact { grid-template-columns: 1fr; gap: 0.2rem; } }
.fact-k { font-size: 0.66rem; color: var(--accent); letter-spacing: 0.18em; align-self: center; }

/* ═══════════ STATS ═══════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  padding: clamp(1.2rem, 3vw, 2rem);
  background: var(--panel);
  text-align: left;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.stat-num sup { font-size: 0.4em; color: var(--accent); top: -0.7em; }
.stat-label {
  margin-top: 0.9rem;
  font-size: 0.66rem;
  line-height: 1.7;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* ═══════════ EXPERIENCE ═══════════ */

.job {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: clamp(1.4rem, 4vw, 3rem);
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 1px solid var(--line-soft);
}
.job:first-of-type { border-top: none; padding-top: 0; }
@media (max-width: 860px) { .job { grid-template-columns: 1fr; gap: 1rem; } }

.job-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.job-year { font-size: 2.2rem; line-height: 1; color: var(--accent); }
.job-dates { font-size: 0.66rem; color: var(--ink-faint); letter-spacing: 0.14em; }
@media (max-width: 860px) {
  .job-meta { flex-direction: row; align-items: baseline; gap: 1rem; }
}

.job-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.job-focus {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  font-weight: 400;
}
.job-org {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
}
.job-points { list-style: none; margin-top: 1.6rem; max-width: 76ch; }
.job-points li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.72;
}
.job-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}
.job-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1.5rem; }
.job-tags span,
.card-tags span {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  background: var(--raise);
}

/* ═══════════ PROJECTS (readable grid, no scroll hijack) ═══════════ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.1rem;
}
@media (max-width: 520px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.3rem, 2.4vw, 1.8rem);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.card:hover {
  background: var(--raise-hi);
  border-color: rgba(255, 171, 112, 0.34);
  transform: translateY(-3px);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-index { font-size: 0.66rem; color: var(--ink-faint); letter-spacing: 0.18em; }
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.42rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: dot-pulse 2.4s ease-in-out infinite;
}
.dot-amber { background: var(--amber); animation: none; }
.dot-green { background: var(--green); animation: none; }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.card-desc {
  color: var(--ink-dim);
  font-size: 0.97rem;
  line-height: 1.72;
  flex: 1;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.card-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.card-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  transition: background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.card-link:hover { background: var(--accent-soft); border-color: var(--accent); }
.card-link-sub { color: var(--ink-dim); border-color: var(--line); }
.card-link-sub:hover { background: rgba(246, 243, 236, 0.07); border-color: var(--ink-faint); }
.card-link-static {
  align-self: flex-start;
  color: var(--ink-faint);
  border-color: var(--line-soft);
  background: none;
}
.card-cta {
  background: linear-gradient(150deg, rgba(255, 171, 112, 0.1), var(--raise) 60%);
  border-color: rgba(255, 171, 112, 0.26);
}
.card-cta .card-title { color: var(--accent); }

/* ═══════════ SKILLS ═══════════ */

.marquee-wrap {
  /* full bleed inside the sheet: pull back out through its padding */
  margin: 0 calc(-1 * clamp(1.8rem, 4vw, 3.6rem)) clamp(1.8rem, 4vw, 2.8rem);
  border-bottom: 1px solid var(--line-soft);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee {
  overflow: hidden;
  padding: 0.7rem 0;
  white-space: nowrap;
}
.marquee + .marquee { border-top: 1px solid var(--line-soft); }
.marquee-inner {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  will-change: transform;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}
.skill-block {
  padding: 1.3rem 1.4rem;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.skill-block:hover {
  border-color: rgba(255, 171, 112, 0.32);
  background: var(--raise-hi);
  transform: translateY(-3px);
}
.skill-block-title {
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.skill-block p { color: var(--ink-dim); font-size: 0.97rem; line-height: 1.72; }

/* ═══════════ EDUCATION ═══════════ */

.edu-rows { border-top: 1px solid var(--line-soft); }
.edu-row {
  display: grid;
  grid-template-columns: 5rem 1fr 1.1fr;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line-soft);
  transition: padding-left 0.35s ease, background 0.35s ease;
}
.edu-row:hover { padding-left: 0.8rem; background: linear-gradient(90deg, rgba(246, 243, 236, 0.03), transparent 70%); }
@media (max-width: 860px) { .edu-row { grid-template-columns: 1fr; gap: 0.3rem; } }
.edu-year { font-size: 1.4rem; color: var(--accent); }
.edu-school {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.edu-degree { color: var(--ink-faint); font-size: 0.92rem; }

.edu-achievements {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.achievement {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.achievement-num {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}
.achievement p { color: var(--ink-faint); font-size: 0.93rem; line-height: 1.66; }
.achievement strong { color: var(--ink); font-weight: 600; display: block; }

/* ═══════════ CONTACT ═══════════ */

.contact {
  min-height: 92vh;
  display: flex;
  align-items: center;
  max-width: none;
  padding-left: clamp(1.2rem, 7vw, 8rem);
  padding-right: clamp(1.2rem, 7vw, 8rem);
}
.contact-inner { position: relative; width: 100%; }
.contact-inner::before {
  content: "";
  position: absolute;
  inset: -16% -10%;
  pointer-events: none;
  background: radial-gradient(70% 80% at 30% 50%, rgba(8, 9, 18, 0.94), rgba(8, 9, 18, 0.6) 56%, transparent 86%);
}
.contact-inner > * { position: relative; }
.contact-kicker {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 1.6rem;
}
.contact-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 4.8rem);
  line-height: 1.06;
  letter-spacing: -0.034em;
  max-width: 18ch;
}
.contact-title em {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  color: var(--accent);
}
.contact-email {
  display: inline-block;
  margin-top: 2.2rem;
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  transition: color 0.25s ease, border-color 0.25s ease;
  word-break: break-all;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 2.4rem; }
.contact-meta {
  margin-top: 2.8rem;
  font-size: 0.66rem;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  line-height: 1.9;
}

/* ═══════════ FOOTER ═══════════ */

.footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line-soft);
  background: rgba(10, 11, 22, 0.86);
  backdrop-filter: blur(12px);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.footer-mid { text-align: center; }
@media (max-width: 860px) { .footer-mid { display: none; } }

/* ═══════════ POLISH: glass light + hover sheen ═══════════ */

/* No -webkit-box-reflect on the big titles. It paints a mirrored copy of
   the headline into the space below it, which is exactly where the hero
   paragraph and the contact email live: the ghost text read as a render
   bug. The scrims carry the depth instead. */

.card::before,
.skill-block::before,
.achievement::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(246, 243, 236, 0.05), transparent 18%),
    radial-gradient(130% 65% at 88% -12%, rgba(255, 171, 112, 0.05), transparent 55%);
}
.skill-block, .achievement { position: relative; }
.card > *, .skill-block > *, .achievement > * { position: relative; }

.about-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 70% at 12% -8%, rgba(246, 243, 236, 0.08), transparent 50%);
}

.job { transition: background 0.45s ease; }
.job:hover { background: linear-gradient(90deg, rgba(246, 243, 236, 0.025), transparent 72%); }

/* ═══════════ REDUCED MOTION / NO-JS SAFETY ═══════════ */

@media (prefers-reduced-motion: reduce) {
  #scene, .grain, .world-dim { display: none !important; }
  .webgl-fallback { display: block !important; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  .char, .w-inner { transform: none; opacity: 1; }
}

/* mobile: backdrop-filter is the single most expensive thing on the page */
@media (max-width: 860px) {
  .sheet, .nav, .footer, .enter-overlay { backdrop-filter: none; }
  .sheet { background: rgba(9, 10, 20, 0.97); }
  .nav { background: rgba(9, 10, 20, 0.95); }
  .stat { background: rgba(9, 10, 20, 0.97); }
}
