/* Garvit Chaudhary portfolio — theme tokens + components */

:root {
  --sans: "Archivo", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1180px;
  --nav-h: 61px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --bg: #0b0d0c;
  --surface: #121614;
  --surface-2: #171d1a;
  --text: #e9ede9;
  --muted: #9ca69f;
  --faint: #788479;
  --line: #242b27;
  --line-strong: #3a443e;
  --danger: #ff7b72;
  --on-accent: #06150b;
  --grid-line: rgba(255, 255, 255, 0.05);
  --ed-bg: #0e1211;
  --ed-line: #232a27;
  --ed-dim: #93a09a;
  --ed-status: #0a0d0c;
  --num: #5a6760;
  --code-text: #dfe6e1;
  --syn-str: #fbbf24;
  --syn-cm: #8a9992;
  --acc-bright: #4ade80;
  --acc-deep: #0f7b4f;
  --accent: var(--acc-bright);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-softer: color-mix(in srgb, var(--accent) 7%, transparent);
  --tc: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

[data-accent="cyan"] { --acc-bright: #22d3ee; --acc-deep: #0e7490; }
[data-accent="amber"] { --acc-bright: #fbbf24; --acc-deep: #b45309; }
[data-accent="violet"] { --acc-bright: #a78bfa; --acc-deep: #6d28d9; }

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f6f2;
  --surface-2: #ebede7;
  --text: #121212;
  --muted: #5c5c56;
  --faint: #6b6b63;
  --line: #e2e3db;
  --line-strong: #c4c6bc;
  --danger: #c9372c;
  --on-accent: #ffffff;
  --grid-line: rgba(18, 18, 18, 0.06);
  --ed-bg: #f7f8f4;
  --ed-line: #dcdfd6;
  --ed-dim: #5f5f59;
  --ed-status: #eef0e9;
  --num: #7e847b;
  --code-text: #1c1c1a;
  --syn-str: #b45309;
  --syn-cm: #78837b;
  --accent: var(--acc-deep);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: var(--tc);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: var(--tc);
}

.topbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 13px clamp(20px, 5vw, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.scrollprog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 60;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: var(--tc);
}

.brand {
  font: 700 13.5px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 0;
  margin: -6px 0;
  transition: var(--tc);
}
.brand em { color: var(--accent); font-style: normal; }

.topnav {
  margin-left: auto;
  display: flex;
  gap: clamp(14px, 2.6vw, 28px);
}

.topnav a {
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 7px 2px;
  position: relative;
  transition: color 0.15s linear;
}
.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.topnav a:hover,
.topnav a:focus-visible { color: var(--text); }
.topnav a:hover::after,
.topnav a:focus-visible::after { transform: scaleX(1); }

.tctl {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
}

.tctl__mode {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--tc), border-color 0.2s ease, transform 0.2s ease;
}
.tctl__mode:hover { border-color: var(--accent); transform: rotate(-18deg); }
.tctl__mode svg { width: 16px; height: 16px; stroke: var(--text); fill: none; stroke-width: 1.7; stroke-linecap: round; }
.tctl__mode .i-sun { display: none; }
[data-theme="light"] .tctl__mode .i-sun { display: block; }
[data-theme="light"] .tctl__mode .i-moon { display: none; }

.tctl__dots { display: flex; gap: 16px; align-items: center; }

.tctl__dot {
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  padding: 0;
  cursor: pointer;
  background: var(--dot);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
/* hit area: the 13px dot itself is far below the 24px pointer-target floor */
.tctl__dot::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.tctl__dot[data-accent="green"] { --dot: #4ade80; }
.tctl__dot[data-accent="cyan"] { --dot: #22d3ee; }
.tctl__dot[data-accent="amber"] { --dot: #fbbf24; }
.tctl__dot[data-accent="violet"] { --dot: #a78bfa; }
.tctl__dot:hover { transform: scale(1.25); }
.tctl__dot[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--dot);
}

/* ---------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bgwall {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
}

.bgfloor {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -12%;
  height: 62%;
  background-image:
    linear-gradient(to right, var(--grid-line) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, var(--grid-line) 1.5px, transparent 1.5px);
  background-size: 54px 54px;
  transform: perspective(330px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent 72%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent 72%);
  animation: floor-drift 26s linear infinite;
}

@keyframes floor-drift { to { background-position: 0 54px, 0 54px; } }

/* Canvas UI grid — fixed whole-page backdrop; sections scroll over it */
.cgrid { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.cgrid__src { position: absolute; inset: 0; width: 100%; height: 100%; }
.cgrid__content { position: relative; width: 100%; height: 100%; }
.cgrid__out { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* The grid layer is fixed at z-index 0; all scrolling content must live in a
   stacking context above it, otherwise in-flow text paints underneath the
   fixed canvas. The topbar is sticky with z-index 50, so it already wins.
   overflow-x: clip (not hidden — that would break sticky) contains the
   full-bleed 100vw velocity ribbons so they never add a horizontal bar. */
main, .footer { position: relative; z-index: 1; }
main { overflow-x: clip; }

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 64px);
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  /* Fill the screen below the sticky topbar so the next section never
     bleeds into the first view; content still grows past it when taller.
     vh (not dvh) on purpose: it never shrinks mid-scroll, so no jump. */
  min-height: calc(100vh - var(--nav-h));
  padding: clamp(44px, 7vh, 84px) clamp(20px, 5vw, 40px) clamp(56px, 9vh, 96px);
}

.headline {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

.headline .label {
  display: block;
  font: 500 13px/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: none;
  color: var(--accent);
  margin-bottom: clamp(16px, 2.5vw, 24px);
}

.headline .ln { display: block; }

/* headline word rotate — MagicUI word-rotate.json ported to vanilla JS (js/main.js).
   The slot width follows the live word, so the line never leaves a gap and never
   collides with "demands." The swap itself is a 3D flip hinged on the baseline:
   the word folds forward toward the reader, the slot morphs, the next word
   rises from behind into place. */
.rot {
  display: inline-grid;
  justify-items: start;
  vertical-align: baseline;
  transition: width 0.24s ease;
  perspective: 600px;
}
.rot .rot__w {
  grid-area: 1 / 1;
  color: var(--accent);
  opacity: 0;
  transform: rotateX(90deg);
  transform-origin: 50% 100%;
  backface-visibility: hidden;
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}
.rot .rot__w.is-on { opacity: 1; transform: none; }

.desc {
  margin: clamp(20px, 3vw, 30px) 0 0;
  max-width: 58ch;
  font-size: clamp(15.5px, 1.25vw, 17px);
  line-height: 1.65;
  color: var(--muted);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(26px, 3.5vw, 36px);
}

/* motto — the tagline written the way the page already talks: a code comment */
.motto {
  margin: clamp(16px, 2vw, 24px) 0 0;
  font: 500 12.5px/1.6 var(--mono);
  letter-spacing: 0.03em;
  color: var(--faint);
  opacity: 0;
  transform: translateY(6px);
  animation: motto-in 0.7s 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.motto .hash { margin-right: 9px; color: var(--accent); opacity: 0.75; }
.motto b { position: relative; color: var(--accent); font-weight: 700; }
.motto b::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.6;
  transform: scaleX(0);
  transform-origin: left;
  animation: drawx 0.6s 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes motto-in { to { opacity: 1; transform: none; } }
@keyframes drawx { to { transform: scaleX(1); } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 14.5px/1 var(--sans);
  padding: 15px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn--solid {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn--solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -10px rgb(0 0 0 / 0.65);
}
.btn--line {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--line:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* ---------------------------------------------------------- editor / IDE */

.editor {
  border: 1px solid var(--ed-line);
  background: var(--ed-bg);
  border-radius: var(--r-md);
  overflow: hidden;
  min-width: 0;
  transition: var(--tc);
}

.editor__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--ed-line);
  font: 500 12.5px/1 var(--mono);
  color: var(--ed-dim);
}

.dots { display: inline-flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

.editor__file { display: inline-flex; align-items: center; gap: 7px; }
.editor__file::before { content: "●"; color: var(--accent); font-size: 9px; }

.ide { display: flex; min-width: 0; }

.ide__tree {
  width: 144px;
  flex: none;
  border-right: 1px solid var(--ed-line);
  padding: 13px 0;
  font: 500 12.5px/2.1 var(--mono);
  color: var(--ed-dim);
}
.ide__tree .hd {
  padding: 0 14px 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.ide__tree .dir { padding: 0 14px; color: var(--muted); }
.ide__tree .file {
  padding: 0 14px 0 28px;
  display: block;
  text-decoration: none;
  color: var(--ed-dim);
  transition: color 0.15s linear, background-color 0.15s linear;
}
.ide__tree a.file:hover { color: var(--text); background: var(--accent-softer); }
.ide__tree .file.on {
  box-shadow: inset 2px 0 0 var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.ide__main { flex: 1; min-width: 0; }

.code {
  margin: 0;
  padding: 15px 0;
  font: 400 13.5px/1.75 var(--mono);
  color: var(--code-text);
  overflow: hidden;
}
.code .l {
  display: block;
  padding: 0 8px 0 42px;
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  min-height: 1.75em;
}
.code .l::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  width: 34px;
  text-align: right;
  color: var(--num);
}
.code .l:hover { background: var(--accent-softer); }
.cm { color: var(--syn-cm); font-style: italic; }
.kw { color: var(--accent); font-weight: 700; }
.st { color: var(--syn-str); }
.fn { color: var(--code-text); font-weight: 600; }

.editor__status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 15px;
  border-top: 1px solid var(--ed-line);
  background: var(--ed-status);
  font: 500 12px/1.4 var(--mono);
  color: var(--ed-dim);
  transition: var(--tc);
}
.editor__status .tl {
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor__status .right { margin-left: auto; display: flex; gap: 14px; flex: none; }

/* ---------------------------------------------------------- sections */

.section {
  padding-block: clamp(52px, 8vh, 88px);
  position: relative;
}

.sec-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.sec-label .sl { color: var(--accent); font-weight: 700; }
.sec-label .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  transform: scaleX(1);
  transform-origin: left;
}
.js [data-reveal] .sec-label .rule,
.js [data-reveal] .block__label .rule {
  transform: scaleX(0);
  transition: transform 0.9s var(--ease) 0.2s;
}
.js [data-reveal].is-in .sec-label .rule,
.js [data-reveal].is-in .block__label .rule { transform: scaleX(1); }

.sec-title {
  margin: 0 0 clamp(26px, 4vw, 40px);
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.sec-title em {
  font-style: normal;
  color: var(--accent);
}
.sec-title + .sec-label { margin: -10px 0 clamp(26px, 4vw, 40px); }

/* ---------------------------------------------------------- work cards */

.pcards { display: grid; gap: clamp(20px, 3vw, 30px); }

.pcard {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: clamp(22px, 3vw, 34px);
  transition: border-color 0.3s ease, transform 0.35s var(--ease), background-color 0.25s ease;
}
.pcard:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-4px);
}
.pcard--flip .pcard__media { order: -1; }

.pcard__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.pcard__num {
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pcard__cat {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pcard h3 {
  margin: 0 0 14px;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 22ch;
}

.pcard__line {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}
.pcard__line b { color: var(--text); font-weight: 600; }

.metric {
  margin: 16px 0 0;
  font: 500 13px/1.55 var(--mono);
  color: var(--accent);
  max-width: 64ch;
}
.metric::before { content: "// "; }

.pillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pill {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.03em;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--surface-2);
  transition: var(--tc), border-color 0.2s ease;
}
a.pill:hover, .pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pcard__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.btn--ghost {
  position: relative;
  z-index: 1;
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px 18px;
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.btn--ghost svg { width: 15px; height: 15px; fill: currentColor; }

.go {
  position: relative;
  font: 600 14.5px/1 var(--sans);
  color: var(--accent);
  text-decoration: none;
}
.go::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease);
}
.go::after { content: ""; position: absolute; inset: -14px -10px; }
.go:hover::before,
.go:focus-visible::before { transform: scaleX(1); }
.go .arrow {
  display: inline-block;
  transition: transform 0.32s var(--ease);
}
.pcard:hover .go .arrow,
.go:hover .arrow,
.go:focus-visible .arrow { transform: translateX(5px); }

.pcard__media {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  isolation: isolate;
  /* horizontal drags belong to the decrypt lens (Chrome pointercancels them
     otherwise); vertical swipes still scroll the page */
  touch-action: pan-y;
}
.pcard__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}
.pcard:hover .pcard__media:not(.is-live) .pcard__video { transform: scale(1.03); }

.pcard__cipher {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.pcard__media.is-live .pcard__cipher { opacity: 1; }

.pcard__mediameta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  padding: 6px 9px;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  pointer-events: none;
}

.pcard__play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}
.pcard__play:hover,
.pcard__play:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.pcard__play svg { width: 12px; height: 12px; fill: currentColor; }
.pcard__play .ic-play { display: none; }
.pcard__media:not(.is-playing) .pcard__play .ic-play { display: block; }
.pcard__media:not(.is-playing) .pcard__play .ic-pause { display: none; }

/* ---------------------------------------------------------- about */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.bio { max-width: 62ch; }
.bio p {
  margin: 0 0 16px;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--muted);
}
.bio .lead { font-size: clamp(17.5px, 1.6vw, 20px); line-height: 1.55; color: var(--text); }
.bio b { color: var(--text); font-weight: 700; }
.bio strong { color: var(--accent); font-weight: 600; }

.term {
  margin-top: 28px;
  border: 1px solid var(--ed-line);
  background: var(--ed-bg);
  border-radius: var(--r-md);
  overflow: hidden;
  max-width: 560px;
  transition: var(--tc);
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--ed-line);
  font: 500 12.5px/1 var(--mono);
  color: var(--ed-dim);
}
.term__body {
  padding: 17px 20px 20px;
  font: 400 13.5px/1.95 var(--mono);
  overflow-x: auto;
}
.term__body .row { display: block; white-space: pre; }
.term .p { color: var(--accent); font-weight: 700; }
.term .cmd { color: var(--code-text); }
.term .val { color: var(--code-text); }
.term .ok { color: var(--accent); }
.term .muted { color: var(--ed-dim); }

.js .term .row {
  transform: translateY(5px);
  transition: transform 0.45s ease;
}
.js .term.is-in .row { transform: none; }
.js .term.is-in .row:nth-child(1) { transition-delay: 0.15s; }
.js .term.is-in .row:nth-child(2) { transition-delay: 0.45s; }
.js .term.is-in .row:nth-child(3) { transition-delay: 0.6s; }
.js .term.is-in .row:nth-child(4) { transition-delay: 0.75s; }
.js .term.is-in .row:nth-child(5) { transition-delay: 0.9s; }
.js .term.is-in .row:nth-child(6) { transition-delay: 1.05s; }

.js .term .cmd {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  vertical-align: bottom;
  white-space: nowrap;
}
.js .term.is-in .cmd { animation: type-in 0.8s steps(10) 0.2s forwards; }
@keyframes type-in { to { max-width: 12ch; } }

.side-block { margin-bottom: 30px; }
.side-label {
  margin: 0 0 14px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--accent);
}

.arrow-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}
.arrow-list li {
  font-size: 15.5px;
  color: var(--muted);
  padding-left: 26px;
  position: relative;
  max-width: 46ch;
}
.arrow-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

.stack .pill { display: inline-block; }

/* timeline */

.tl-head { margin-top: clamp(40px, 6vh, 64px); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 780px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding: 0 0 34px 36px;
}
.tl-item:last-child { padding-bottom: 4px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-date {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
}
.tl-title {
  margin: 9px 0 4px;
  font-size: clamp(17px, 1.7vw, 19.5px);
  font-weight: 700;
  line-height: 1.3;
}
.tl-org {
  font: 500 13px/1.5 var(--mono);
  color: var(--accent);
  display: block;
  margin-bottom: 7px;
}
.tl-desc {
  margin: 0 0 11px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 66ch;
}
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tl-tags .pill { font-size: 12px; padding: 5px 9px; }

/* -------------------------------------------- velocity ribbons (about) */

/* Full-bleed clipper: padding-block gives the rotated band's corners room
   so they are only clipped horizontally (ends), never top/bottom — it must
   scale with width (the 2.2° rise at 100vw ≈ 2vw), not height. */
.vel-clip {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding-block: clamp(10px, 2vw, 56px);
  margin-block: clamp(12px, 2vh, 22px);
  overflow: hidden;
}

.vel {
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-block: 1px solid var(--line);
  padding-block: clamp(14px, 2vh, 22px);
  transform: rotate(-2.2deg);
}
.vel--down { transform: rotate(2.2deg); }

/* The ribbons carry their own spacing; trim the generic section padding so
   the gaps above the top band and below the bottom band stay balanced with
   the neighbouring sections. */
#about { padding-block: clamp(30px, 5vh, 56px); }

.vel__track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.vel__row {
  display: flex;
  align-items: center;
  gap: clamp(30px, 4.5vw, 64px);
  padding-right: clamp(30px, 4.5vw, 64px);
  white-space: nowrap;
  font-weight: 800;
  font-size: clamp(1.45rem, 3.1vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.vel__star {
  font-size: 0.42em;
  font-style: normal;
  color: var(--accent);
}

/* ---------------------------------------------------------- contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(30px, 4vw, 60px);
  align-items: start;
}

.contact-intro {
  margin: 0 0 22px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 56ch;
}

.form input,
.form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: 400 15px/1.5 var(--sans);
  padding: 13px 15px;
  transition: var(--tc), border-color 0.2s ease, box-shadow 0.2s ease;
}
.form input::placeholder,
.form textarea::placeholder { color: var(--faint); }
.form input:focus,
.form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea { min-height: 150px; resize: vertical; }

.form__grid { display: grid; gap: 18px; }

.field label {
  display: block;
  padding: 6px 0;
  margin: -6px 0 2px;
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: var(--tc);
}
.field .req { color: var(--accent); }

.field__error {
  display: block;
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--danger);
}
.field.is-error input,
.field.is-error textarea { border-color: var(--danger); }
.field.is-error input:focus,
.field.is-error textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.form__note {
  margin: 0;
  font-size: 13.5px;
  color: var(--faint);
  max-width: 46ch;
}

.form__status {
  margin: 16px 0 0;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-softer);
  font-size: 14.5px;
  color: var(--text);
}
.form__status.is-error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.connect { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.conn-card {
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 16px;
  text-decoration: none;
  transition: var(--tc), border-color 0.2s ease, transform 0.25s ease;
}
a.conn-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-3px);
}
.conn-card__ic {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  transition: var(--tc), border-color 0.2s ease;
}
.conn-card__ic svg { width: 19px; height: 19px; fill: var(--muted); transition: fill 0.2s ease; }
a.conn-card:hover .conn-card__ic { border-color: var(--accent); }
a.conn-card:hover .conn-card__ic svg { fill: var(--accent); }
.conn-card__tx { min-width: 0; }
.conn-card__t { display: block; font-size: 15.5px; font-weight: 600; }
.conn-card__s {
  display: block;
  font: 400 13px/1.5 var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-card__go { margin-left: auto; color: var(--faint); font-family: var(--mono); transition: transform 0.25s var(--ease), color 0.2s ease; }
a.conn-card:hover .conn-card__go { color: var(--accent); transform: translateX(4px); }

.conn-card--avail {
  display: block;
  background: var(--surface-2);
}
.conn-card--avail .side-label { margin-bottom: 8px; }
.conn-card--avail p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.55; max-width: 40ch; }

/* ---------------------------------------------------------- footer */

.footer {
  padding: 34px 0 44px;
}
.footer__row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__nav { display: flex; gap: 20px; margin-left: auto; }
.footer__nav a {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 0;
  margin: -6px 0;
  transition: color 0.15s linear;
}
.footer__nav a:hover { color: var(--accent); }
.footer__social { display: flex; gap: 14px; }
.footer__social a { display: grid; place-items: center; padding: 6px; margin: -6px; }
.footer__social svg { width: 17px; height: 17px; fill: var(--muted); transition: fill 0.2s ease; }
.footer__social a:hover svg { fill: var(--accent); }

.footer__meta {
  display: flex;
  gap: 12px 26px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 400 12.5px/1.6 var(--mono);
  color: var(--faint);
}

/* ---------------------------------------------------------- doc / detail pages */

.doc { padding-bottom: clamp(40px, 6vh, 70px); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(26px, 4vw, 40px);
  padding: 5px 4px;
  margin-inline: -4px;
  font: 600 14.5px/1 var(--sans);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.back:hover { color: var(--accent); }
.back svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.doc__cat {
  margin: clamp(26px, 4vw, 38px) 0 14px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc__title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.doc__lede {
  margin: 18px 0 0;
  font-size: clamp(16px, 1.5vw, 18.5px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 60ch;
}

.doc__id {
  margin-top: 14px;
  font: 400 12.5px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
}

.block {
  margin-top: clamp(38px, 6vh, 58px);
}
.block__label {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 18px;
}
.block__label .sl { color: var(--accent); font-weight: 700; }
.block__label .rule { flex: 1; height: 1px; background: var(--line); transform-origin: left; }

.block__text {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 60ch;
}
.block__text b { color: var(--text); font-weight: 600; }

.arrows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.arrows li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 64ch;
}
.arrows li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-family: var(--mono);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}
.checklist li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 64ch;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
}

.impact {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-softer);
  border-radius: var(--r-md);
  padding: 17px 20px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  max-width: 60ch;
  transition: var(--tc);
}
.impact::before {
  content: "// ";
  font-family: var(--mono);
  color: var(--accent);
}

.doc__note {
  margin: 16px 0 0;
  font: 400 13.5px/1.65 var(--mono);
  color: var(--faint);
  max-width: 56ch;
}
.doc__note b { color: var(--muted); font-weight: 600; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 20px 0 0;
}
.meta-grid > div {
  background: var(--surface);
  padding: 15px 17px;
  transition: var(--tc);
}
.meta-grid dt {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.meta-grid dd {
  margin: 0;
  font: 400 14px/1.55 var(--mono);
  color: var(--text);
  word-break: break-word;
}
.meta-grid dd a { color: var(--accent); text-decoration: none; padding: 4px 0; margin: -4px 0; }
.meta-grid dd a:hover { text-decoration: underline; }

.doc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(34px, 5vh, 50px);
}

.docnav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(38px, 6vh, 58px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.docnav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.25s var(--ease);
}
.docnav a:hover { transform: translateY(-2px); }
.docnav .k {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}
.docnav .t { font-size: 16.5px; font-weight: 700; color: var(--text); }
.docnav a:last-child { text-align: right; margin-left: auto; }

/* media */

.plate {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  transition: var(--tc);
}
.plate img { width: 100%; height: auto; }
.plate figcaption,
.gallery figcaption {
  padding: 11px 15px;
  font: 400 12.5px/1.6 var(--mono);
  letter-spacing: 0.03em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--surface);
  max-width: 64ch;
  transition: var(--tc);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 22px);
  margin-top: clamp(16px, 2vw, 22px);
}
.gallery figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  transition: var(--tc), border-color 0.25s ease;
}
.gallery figure:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.gallery img { width: 100%; height: auto; }

/* recorder */

.recorder {
  margin-top: clamp(16px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  transition: var(--tc);
}
.recorder__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
  padding: 12px;
}
.recorder__stage img,
.recorder__stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.recorder__stage video { object-fit: contain; }
.recorder__play {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: auto;
  padding: 10px;
  border: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.34);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}
.recorder__play:hover { background: rgba(0, 0, 0, 0.55); }
.recorder__play span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  transition: transform 0.3s var(--ease), background-color 0.2s ease;
}
.recorder__play:hover span { transform: scale(1.08); background: rgba(255, 255, 255, 0.12); }
.recorder__play svg { width: 18px; height: 18px; fill: #ffffff; margin-left: 3px; }
.recorder__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  transition: var(--tc);
}

/* ---------------------------------------------------------- reveal motion */

.js [data-reveal] {
  transform: translateY(16px);
  transition: transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal].is-in {
  transform: none;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); padding-top: 30px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .pcard { grid-template-columns: minmax(0, 1fr); }
  .pcard--flip .pcard__media { order: 0; }
  .pcard__media { aspect-ratio: 16 / 9; max-height: 56vh; }
}

@media (max-width: 760px) {
  .gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .topbar__inner { row-gap: 8px; }
  .topnav { order: 3; width: 100%; margin-left: 0; gap: 18px; }
  .tctl { margin-left: auto; }
  .ide__tree { display: none; }
  .editor__status .right { display: none; }
  .pcard__actions { gap: 12px; }
  .pcard__media { aspect-ratio: 16 / 9; max-height: 46vh; }
  .pcard__mediameta { left: 8px; bottom: 8px; font-size: 9.5px; padding: 5px 7px; }
  .pcard__play { right: 8px; bottom: 8px; width: 30px; height: 30px; }
  .docnav { flex-direction: column; }
  .docnav a:last-child { text-align: left; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .js [data-reveal] .sec-label .rule,
  .js [data-reveal] .block__label .rule { transform: scaleX(1) !important; }
  .js .term .row { opacity: 1 !important; transform: none !important; }
  .js .term .cmd { max-width: none !important; animation: none !important; }
  .motto { opacity: 1 !important; transform: none !important; animation: none !important; }
  .motto b::after { transform: none !important; animation: none !important; }
}
