/* ============================================================
   SIGNED DISTANCE — Aroosh Bhakhri portfolio
   near-black · one cyan · hairlines · huge quiet type
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #05070A;
  --surface: #0B0F14;
  --hairline: #1A2129;
  --cyan: #3FE0FF;
  --violet: #6E5BFF;
  --text: #E8EEF2;
  --muted: #86929E;
  --body-dim: #B9C3CC;

  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Consolas", monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --content-max: 1320px;
  --gutter: 24px;
}

@media (prefers-contrast: more) {
  :root { --hairline: #2A333D; --muted: #9DA9B5; }
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(63, 224, 255, 0.25); color: var(--text); }

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

a { color: var(--text); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
samp, code { font-family: var(--font-mono); }
img, canvas, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- reveal grammar ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 60ms; }
.reveal.d2 { transition-delay: 120ms; }
.reveal.d3 { transition-delay: 180ms; }
.reveal.d4 { transition-delay: 240ms; }

.no-js .reveal { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms linear;
}
/* blur lives on a pseudo-element: backdrop-filter on .nav itself would make it
   the containing block for the fixed mobile overlay and trap it in the bar */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 7, 10, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 200ms linear;
  pointer-events: none;
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav.scrolled::before { opacity: 1; }

.nav-brand {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-brand::before { content: "▮ "; color: var(--cyan); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
  background-image: linear-gradient(var(--cyan), var(--cyan));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 160ms var(--ease-out), color 160ms linear;
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.active {
  color: var(--text);
  background-size: 100% 1px;
}
.nav-links a.nav-cta { color: var(--cyan); }

/* nav dials — motion (global sim time) and res (hero render scale) */
.nav-ctls {
  display: flex;
  align-items: center;
  gap: 24px;
}
.motion-ctl, .res-ctl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.motion-label samp {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.motion-val {
  font-size: 11px;
  color: var(--cyan);
  min-width: 38px;
}
.nav-ctls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 16px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.nav-ctls input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--hairline);
}
.nav-ctls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--cyan);
}
.nav-ctls input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--hairline);
}
.nav-ctls input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--cyan);
}
.no-js .nav-ctls { display: none; }
.no-webgl .res-ctl { display: none; }

@media (max-width: 719px) {
  .nav-ctls { gap: 14px; }
  .nav-ctls input[type="range"] { width: 84px; }
}
@media (max-width: 559px) {
  .motion-label { display: none; }
  .res-ctl { display: none; } /* the hero stats readout still shows res */
  .nav-ctls input[type="range"] { width: 72px; }
}

.nav-toggle {
  display: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  z-index: 102;
}

@media (max-width: 719px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 101;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    background: var(--bg);
    visibility: hidden;
    opacity: 0;
    transition: opacity 200ms linear, visibility 0s 200ms;
  }
  .nav-links.open { visibility: visible; opacity: 1; transition: opacity 200ms linear; }
  .nav-links a {
    font-family: var(--font-display);
    font-stretch: 115%;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
  }
  .nav-links li {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
  }
  .nav-links.open li { opacity: 1; transform: none; }
  .nav-links.open li:nth-child(1) { transition-delay: 40ms; }
  .nav-links.open li:nth-child(2) { transition-delay: 80ms; }
  .nav-links.open li:nth-child(3) { transition-delay: 120ms; }
  .nav-links.open li:nth-child(4) { transition-delay: 160ms; }
  .nav-links.open li:nth-child(5) { transition-delay: 200ms; }

  /* no JS on a phone: the toggle is inert, so show the links as a plain row */
  .no-js .nav { height: auto; flex-wrap: wrap; row-gap: 4px; padding-top: 12px; padding-bottom: 12px; background: rgba(5, 7, 10, 0.92); border-bottom: 1px solid var(--hairline); }
  .no-js .nav-toggle { display: none; }
  .no-js .nav-links {
    position: static;
    visibility: visible;
    opacity: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 16px;
    width: 100%;
    background: none;
    transition: none;
  }
  .no-js .nav-links li { opacity: 1; transform: none; }
  .no-js .nav-links a { font-family: var(--font-mono); font-size: 11px; font-weight: 400; font-stretch: normal; color: var(--muted); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

#sdf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.hero-poster {
  position: absolute;
  inset: 0;
  display: none;
  background:
    radial-gradient(40% 34% at 74% 66%, rgba(63, 224, 255, 0.08) 0%, transparent 70%),
    radial-gradient(90% 80% at 72% 68%, #0B1018 0%, var(--bg) 62%);
}
.no-js .hero-poster, .no-webgl .hero-poster { display: block; }
.no-js #sdf, .no-webgl #sdf { display: none; }

.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
.hero-inner a { pointer-events: auto; }

.hero-eyebrow samp {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.hero-name {
  margin-top: 20px;
  font-size: clamp(3rem, 10vw, 8.5rem);
  font-stretch: 120%;
  font-weight: 820;
  line-height: 0.95;
  text-transform: uppercase;
}

.hero-headline {
  margin-top: 18px;
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-headline .accent { font-style: normal; color: var(--cyan); }

.hero-sub {
  margin-top: 20px;
  max-width: 52ch;
  color: var(--body-dim);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 22px;
  border-radius: 3px;
  transition: border-color 160ms linear, color 160ms linear, background 160ms linear;
}
.btn-ghost { border: 1px solid var(--hairline); color: var(--text); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--cyan); }
.btn-link { color: var(--cyan); padding: 12px 0; }
.btn-link:hover, .btn-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

.hero-meta {
  position: absolute;
  z-index: 2;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.hero-loc { top: 84px; right: var(--gutter); }
.hero-stats { bottom: 24px; left: var(--gutter); min-height: 1em; }

.scroll-cue {
  position: absolute;
  z-index: 2;
  bottom: 24px;
  left: 50%;
  width: 24px;
  height: 48px;
  display: flex;
  justify-content: center;
}
.scroll-cue span {
  display: block;
  width: 1px;
  height: 100%;
  background: linear-gradient(var(--muted), transparent);
  animation: cue-slide 2.2s var(--ease-out) infinite;
  transform-origin: top;
}
@keyframes cue-slide {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- sections ---------- */
.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 120px var(--gutter);
}

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

.section-eyebrow samp {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.section-title {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

/* ---------- 01 / proof ---------- */
.proof { padding-bottom: 80px; }

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.proof-grid .stat {
  padding: 8px 28px;
  border-left: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.proof-grid .stat:first-child { border-left: none; padding-left: 0; }

.stat-number {
  font-family: var(--font-display);
  font-stretch: 120%;
  font-weight: 800;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-underline {
  display: block;
  width: 100%;
  height: 1px;
  margin: 16px 0;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 400ms var(--ease-out) 300ms;
}
.stat.visible .stat-underline { transform: scaleX(1); }
.no-js .stat-underline { transform: scaleX(1); }

.stat-label { color: var(--body-dim); font-size: 0.9rem; line-height: 1.5; }
.stat-receipt { margin-top: 12px; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }

@media (max-width: 959px) {
  .proof-grid { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .proof-grid .stat:nth-child(3) { border-left: none; padding-left: 0; }
}
@media (max-width: 559px) {
  .proof-grid { grid-template-columns: 1fr; }
  .proof-grid .stat { border-left: none; padding: 0 0 32px; border-bottom: 1px solid var(--hairline); }
  .proof-grid .stat:last-child { border-bottom: none; padding-bottom: 0; }
}

/* ---------- wavelines ---------- */
.waveline {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 72px;
}
.waveline canvas { width: 100%; height: 100%; }
.no-js .waveline { height: 33px; }
.no-js .waveline::before { content: ""; display: block; height: 1px; margin-top: 16px; background: var(--hairline); }
.no-js .waveline canvas { display: none; }

/* ---------- 02 / field work ---------- */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  margin-bottom: 24px;
}

.featured h3 {
  margin-top: 14px;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
}
.featured p { margin-top: 16px; color: var(--body-dim); font-size: 0.975rem; }
.featured strong { color: var(--text); font-weight: 500; }

.card-kicker samp { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; }

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.card-tech li {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
}

/* system board */
.board { min-width: 0; align-self: center; }
.board svg { width: 100%; height: auto; }

.b-guide { fill: none; stroke: none; }
.b-wire {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 1200ms var(--ease-out);
}
.featured.visible .b-wire { stroke-dashoffset: 0; }
.b-wire.b-dashed {
  stroke-dasharray: 4 4;
  stroke-dashoffset: 0;
  opacity: 0;
  transition: opacity 800ms linear 900ms;
}
.featured.visible .b-wire.b-dashed { opacity: 1; }
.no-js .b-wire { stroke-dashoffset: 0; opacity: 1; }

.b-node rect { fill: var(--surface); stroke: var(--hairline); }
.b-node text, .b-group text, .b-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--muted);
  text-anchor: middle;
  letter-spacing: 0.08em;
}
.b-node.b-key rect { stroke: rgba(63, 224, 255, 0.55); }
.b-node.b-key text { fill: var(--text); }
.b-group rect { fill: none; stroke: var(--hairline); }
.b-tag { font-size: 8px; }
.b-pulse { fill: var(--cyan); }
.no-js .b-pulse { display: none; }

.board figcaption { margin-top: 14px; }
.board figcaption samp { font-size: 11px; color: var(--muted); }
.no-js .board figcaption { display: none; }

@media (max-width: 959px) {
  .featured { grid-template-columns: 1fr; padding: 28px; gap: 32px; }
}

/* cards */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 28px;
  overflow: hidden;
  transition: border-color 200ms linear,
              opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.card:hover, .card:focus-within { border-top-color: var(--cyan); }

.card h3 { margin-top: 12px; font-size: 1.3rem; }
.card > p { margin-top: 12px; color: var(--body-dim); font-size: 0.95rem; }

.vignette {
  position: relative;
  margin: -28px -28px 22px;
  border-bottom: 1px solid var(--hairline);
  aspect-ratio: 5 / 2;
  overflow: hidden;
}
.vignette-canvas {
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}
.vignette-caption {
  position: absolute;
  left: 14px;
  bottom: 10px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  pointer-events: none;
}
.no-js .vignette { display: none; }

@media (max-width: 719px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- 03 / experience ---------- */
.timeline { display: flex; flex-direction: column; }

.tl-entry {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 4fr) minmax(0, 7fr);
  gap: 0 40px;
  padding: 44px 0;
  border-bottom: 1px solid var(--hairline);
}
.tl-entry:last-child { border-bottom: none; }

.tl-spine { position: relative; }
.tl-spine i {
  position: absolute;
  top: 6px;
  bottom: 0;
  width: 1px;
  background: var(--hairline);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 800ms var(--ease-out), opacity 400ms linear;
}
.tl-spine i:nth-child(1) { left: 11px; }
.tl-spine i:nth-child(2) { left: 15px; opacity: 0; }
.tl-spine i:nth-child(3) { left: 19px; opacity: 0; }
.tl-entry.visible .tl-spine i { transform: scaleY(1); }
.tl-entry.visible .tl-spine i:nth-child(2),
.tl-entry.visible .tl-spine i:nth-child(3) { opacity: 1; transition-delay: 400ms; }
.no-js .tl-spine i { transform: scaleY(1); opacity: 1; }

.tl-dot {
  position: absolute;
  top: 6px;
  left: 15px;
  width: 9px;
  height: 9px;
  transform: translate(-4px, -4px);
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--hairline);
  transition: background 400ms linear 500ms, border-color 400ms linear 500ms;
}
.tl-entry.visible .tl-dot { background: var(--cyan); border-color: var(--cyan); }
.tl-entry.visible .tl-dot.current { background: var(--violet); border-color: var(--violet); }
.no-js .tl-dot { background: var(--cyan); border-color: var(--cyan); }

.tl-marker {
  display: inline-block;
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}
.tl-head h3 { font-size: 1.35rem; }
.tl-role {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.tl-bullets { display: flex; flex-direction: column; gap: 12px; }
.tl-bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--body-dim);
  font-size: 0.95rem;
}
.tl-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--muted);
}

@media (max-width: 959px) {
  .tl-entry { grid-template-columns: 32px minmax(0, 1fr); }
  .tl-entry .tl-spine { grid-row: 1 / span 2; }
  .tl-bullets { grid-column: 2; margin-top: 20px; }
}

/* ---------- 04 / stack — constellation ---------- */
.constellation { position: relative; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.legend-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  transition: color 160ms linear, border-color 160ms linear;
}
.legend-btn:hover, .legend-btn:focus-visible { border-color: var(--cyan); color: var(--text); }
.legend-btn.active { color: var(--cyan); border-color: var(--cyan); }

#constellationCanvas {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chips { position: relative; }

.chip-group { margin-bottom: 36px; }
.chip-group-name { margin-bottom: 14px; }
.chip-group-name samp { font-size: 11px; color: var(--muted); letter-spacing: 0.14em; font-weight: 400; }

.skill-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  padding: 9px 15px;
  margin: 0 8px 8px 0;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  transition: border-color 160ms linear, opacity 300ms linear;
}
.skill-chip:hover, .skill-chip:focus-visible { border-color: var(--cyan); }
.skill-chip.selected { border-color: var(--cyan); color: var(--cyan); }
.skill-chip.dim { opacity: 0.22; }
.skill-chip.dim:hover, .skill-chip.dim:focus-visible { opacity: 1; }

/* physics mode: chips float free, canvas draws links */
.constellation.physics #constellationCanvas { display: block; }
.constellation.physics .chips { height: 62vh; min-height: 480px; }
.constellation.physics .chip-group { margin: 0; }
.constellation.physics .chip-group-name { display: none; }
.constellation.physics .skill-chip {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  will-change: transform;
  cursor: grab;
  transition: border-color 160ms linear, opacity 300ms linear;
}
.constellation.physics .skill-chip.dragging { cursor: grabbing; border-color: var(--cyan); }

.skill-proof { margin-top: 28px; min-height: 1.6em; }
.skill-proof samp { font-size: 12px; color: var(--muted); }
.skill-proof samp::before { content: "> "; color: var(--cyan); }

/* ---------- 05 / runtime — about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 56px;
  align-items: start;
}

.about-text p { max-width: 68ch; color: var(--body-dim); }
.about-text strong { color: var(--text); font-weight: 500; }

.runtime-params { margin-top: 36px; }
.runtime-params .param {
  display: grid;
  grid-template-columns: minmax(96px, 160px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}
.runtime-params dd samp { overflow-wrap: anywhere; }
.runtime-params .param:last-child { border-bottom: 1px solid var(--hairline); }
.runtime-params dt samp { font-size: 12px; color: var(--cyan); }
.runtime-params dd samp { font-size: 12px; color: var(--body-dim); }

.bella {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 16px;
}
#bellaCanvas { width: 100%; aspect-ratio: 4 / 3; touch-action: pan-y; }
.bella figcaption { margin-top: 12px; }
.bella figcaption samp { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.no-js .bella { display: none; }

@media (max-width: 959px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .bella { max-width: 420px; }
}

/* ---------- 06 / contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 56px;
  align-items: start;
}

.contact-sub { margin-top: 18px; color: var(--body-dim); }

.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 32px;
}
.contact-email samp {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  color: var(--text);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
  transition: border-color 160ms linear;
}
.contact-email:hover samp, .contact-email:focus-visible samp { border-color: var(--cyan); }
.contact-email .ch { display: inline-block; will-change: transform; }

.contact-meta { margin-top: 24px; }
.contact-meta samp { font-size: 12px; color: var(--muted); }

/* mcp console */
.mcp-console {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}

.mcp-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hairline);
}
.mcp-titlebar samp { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.mcp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: mcp-pulse 2.4s ease-in-out infinite;
}
@keyframes mcp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.mcp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.mcp-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--body-dim);
  padding: 7px 12px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  transition: border-color 160ms linear, color 160ms linear;
}
.mcp-chip:hover, .mcp-chip:focus-visible { border-color: var(--cyan); color: var(--text); }
.mcp-chip.active { border-color: var(--cyan); color: var(--cyan); }

.mcp-output {
  padding: 18px;
  min-height: 240px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  overflow-x: auto;
}
.mcp-line { display: block; white-space: pre-wrap; word-break: break-word; }
.mcp-line.meta { color: var(--muted); }
.mcp-line.req { color: var(--text); }
.mcp-line.res { color: var(--muted); }
.mcp-line.cta { color: var(--cyan); }
.mcp-caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: mcp-pulse 1s steps(2) infinite;
}

.mcp-transcript { padding: 0 18px 18px; font-family: var(--font-mono); font-size: 12px; line-height: 1.75; }
.mcp-transcript[hidden] { display: none; }
.no-js .mcp-transcript[hidden] { display: block; }
.no-js .mcp-chips { display: none; }
.no-js .mcp-hint { display: none; }
.no-js .legend { display: none; }
.no-js .skill-proof { display: none; }

/* comfortable touch targets on coarse pointers */
@media (pointer: coarse) {
  .mcp-chip, .legend-btn { padding: 12px 14px; }
  .skill-chip { padding: 12px 16px; }
  .nav-toggle { padding: 12px 14px; }
}

@media (max-width: 959px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  border-top: 1px solid var(--hairline);
}
.footer-copy { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.footer-colophon samp { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.footer-top {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  transition: color 160ms linear;
}
.footer-top:hover, .footer-top:focus-visible { color: var(--cyan); }

@media (max-width: 719px) {
  .footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- error page ---------- */
.error-page { min-height: 60vh; padding-top: 160px; }
.error-page .accent { color: var(--cyan); }
.error-sub { margin-top: 20px; max-width: 52ch; color: var(--body-dim); }
.error-meta { margin: 18px 0 28px; }
.error-meta samp { font-size: 12px; color: var(--muted); }
.error-page .btn { margin-top: 12px; }

/* ---------- error ui ---------- */
#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  color: #111;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---------- responsive: small screens ---------- */
@media (max-width: 719px) {
  :root { --gutter: 20px; }
  .section { padding: 72px var(--gutter); }
  .section-head { margin-bottom: 40px; }
  .hero-loc { display: none; }
}

/* ---------- motion off (?motion=0 opt-out; class set by main.js) ---------- */
html.motion-off { scroll-behavior: auto; }
html.motion-off *, html.motion-off *::before, html.motion-off *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
}
html.motion-off .reveal { opacity: 1; transform: none; }
html.motion-off .b-wire { stroke-dashoffset: 0; opacity: 1; }
html.motion-off .tl-spine i { transform: scaleY(1); opacity: 1; }
html.motion-off .tl-entry .tl-dot { background: var(--cyan); border-color: var(--cyan); }
html.motion-off .tl-entry .tl-dot.current { background: var(--violet); border-color: var(--violet); }
html.motion-off .stat-underline { transform: scaleX(1); }
html.motion-off .scroll-cue span { animation: none; }
html.motion-off .mcp-dot, html.motion-off .mcp-caret { animation: none; }
