/* ==========================================================================
   deepwell.at — "the instrument panel of an artist"
   Dark graphite base · warm amber signal · Archivo (variable wdth/wght) + JetBrains Mono
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-wdth-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #26272b;        /* space gray */
  --bg-rgb: 38 39 43;
  --bg-raise: #2c2d31;
  --bg-panel: #313236;
  --bg-hover: #37383d;
  --line: rgb(255 255 255 / 0.08);
  --line-2: rgb(255 255 255 / 0.15);
  --line-3: rgb(255 255 255 / 0.3);

  /* text */
  --fg: #ece8e1;
  --fg-2: #b2b4ba;
  --fg-3: #8a8e96;

  /* signal */
  --amber: #ffb020;
  --amber-hot: #ffc861;
  --amber-deep: #c9780a;
  --amber-glow: rgb(255 176 32 / 0.16);
  --slate: #848e9f; /* legacy tone from the previous site */

  /* type */
  --f-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-name: "Unbounded", var(--f-sans);
  --f-head: var(--f-name);   /* headlines; set to var(--f-sans) to return to Archivo */
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* layout */
  --gutter: clamp(16px, 4.5vw, 56px);
  --maxw: 1240px;
  --hud-h: 56px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hud-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-weight: 350;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }
::selection { background: var(--amber); color: #120c00; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }

.mono {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 450;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--amber); color: #000; padding: 8px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- atmosphere: technical grid + film grain ---------- */
.fx-grid, .fx-grain { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.fx-grid {
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.075) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: calc(50% + 48px) 0;
  mask-image: radial-gradient(ellipse 110% 95% at 50% 40%, #000 55%, rgb(0 0 0 / 0.35) 100%);
  -webkit-mask-image: radial-gradient(ellipse 110% 95% at 50% 40%, #000 55%, rgb(0 0 0 / 0.35) 100%);
}
.fx-grain {
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
main, .foot { position: relative; z-index: 1; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--hud-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 24px;
  background: linear-gradient(to bottom, rgb(var(--bg-rgb) / 0.94), rgb(var(--bg-rgb) / 0.76));
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: transform 0.5s var(--ease);
}
.hud__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--f-mono); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
}
.hud__brand img { width: 28px; height: 28px; }
.hud__now {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-2);
}
.hud__now > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud__idx { color: var(--amber); }
.hud__idx::after { content: ""; display: inline-block; width: 28px; height: 1px; margin: 0 0 3px 12px; background: var(--line-3); vertical-align: middle; }
.hud__tc {
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--fg-3); font-variant-numeric: tabular-nums;
}
.hud__tc span:last-child { color: var(--fg-2); }
.hud__menu {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}
.hud__menu:hover { border-color: var(--amber); color: var(--amber); }
.hud__menu-bars { width: 14px; height: 8px; border-block: 1px solid currentColor; }

@media (max-width: 760px) {
  .hud { grid-template-columns: auto 1fr auto; gap: 12px; }
  .hud__now { display: none; }
  .hud__tc { justify-self: end; font-size: 0.6875rem; }
  .hud__tc span:first-child { display: none; }
}
@media (max-width: 380px) { .hud__brand span { display: none; } }

/* ---------- index dialog ---------- */
.index {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgb(var(--bg-rgb) / 0.98);
  color: var(--fg);
}
.index::backdrop { background: transparent; }
.index[open] { animation: index-in 0.45s var(--ease); }
@keyframes index-in { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
.index__inner {
  width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto;
  padding-top: calc(env(safe-area-inset-top) + 12px); padding-bottom: 40px;
}
.index__head {
  display: flex; justify-content: space-between; align-items: center;
  min-height: var(--hud-h); border-bottom: 1px solid var(--line); color: var(--fg-3);
}
.index__close {
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 999px;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.index__close:hover { border-color: var(--amber); color: var(--amber); }
.index__list { margin-top: clamp(24px, 6vh, 64px); counter-reset: none; }
.index__list a {
  display: flex; align-items: baseline; gap: clamp(14px, 3vw, 32px);
  padding: clamp(10px, 1.8vh, 18px) 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-family: var(--f-head);
  font-size: clamp(1.3rem, 4.4vw, 3rem); font-weight: 600;
  line-height: 1.1; letter-spacing: -0.02em;
  transition: color 0.25s, padding-left 0.35s var(--ease);
}
.index__list a .mono { color: var(--amber); font-size: 0.75rem; transform: translateY(-0.6em); }
.index__list a:hover, .index__list a:focus-visible { color: var(--amber-hot); padding-left: 12px; }

/* ---------- hero ---------- */
.hero { position: relative; height: 175svh; }
.hero__stage {
  position: sticky; top: 0;
  height: 100svh; min-height: 520px;
  display: grid; place-items: center;
  padding: calc(var(--hud-h) + 24px) var(--gutter) 56px;
  overflow: hidden;
}
.hero__marks {
  position: absolute;
  inset: calc(var(--hud-h) + 20px) var(--gutter) 24px;
  pointer-events: none;
  --c: var(--line-3); --l: 22px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
}
.hero__name {
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--f-name);
  font-weight: 250;
  font-size: clamp(1.75rem, 7.4vw, 6.4rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}
.hero__first, .hero__last { display: block; margin-right: -0.04em; /* optically re-center the tracking */ will-change: transform; }
.hero__last { font-weight: 500; color: var(--fg-2); }
.logo {
  position: relative; display: block;
  width: clamp(190px, 30vw, 380px); aspect-ratio: 1;
  margin: clamp(6px, 1.2vw, 18px) 0;
  filter: drop-shadow(0 18px 40px rgb(0 0 0 / 0.55));
}
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo__layer { opacity: 0; }

.hero__disc, .hero__coords, .hero__readout, .hero__scroll {
  position: absolute; color: var(--fg-3); white-space: nowrap;
}
.hero__disc { top: calc(var(--hud-h) + 36px); left: calc(var(--gutter) + 18px); right: calc(var(--gutter) + 18px); white-space: normal; }
.hero__coords { bottom: 40px; left: calc(var(--gutter) + 18px); }
.hero__scroll { bottom: 40px; right: calc(var(--gutter) + 18px); display: flex; align-items: center; gap: 12px; }
.hero__scroll-line { width: 48px; height: 1px; background: var(--line-3); position: relative; overflow: hidden; }
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--amber);
  transform: translateX(-100%); animation: scan 2.2s var(--ease) infinite;
}
@keyframes scan { 60%, 100% { transform: translateX(100%); } }
.hero__readout {
  top: calc(var(--hud-h) + 36px); right: calc(var(--gutter) + 18px);
  display: flex; align-items: center; gap: 10px;
}
.hero__disc { right: auto; max-width: 46%; }
.hero__meter { width: 72px; height: 3px; background: var(--line-2); position: relative; }
.hero__meter span { position: absolute; inset: 0; background: var(--amber); transform-origin: left; transform: scaleX(0); }
[data-build-val] { color: var(--fg-2); min-width: 7ch; }

@media (max-width: 760px) {
  .hero { height: 160svh; }
  .hero__disc { max-width: none; right: calc(var(--gutter) + 18px); text-align: center; left: calc(var(--gutter) + 18px); }
  .hero__readout { top: auto; bottom: 72px; right: 50%; transform: translateX(50%); }
  .hero__coords { font-size: 0.625rem; }
  .hero__scroll { font-size: 0.625rem; }
  .hero__scroll-line { width: 28px; }
}

/* ---------- sections ---------- */
.section { position: relative; padding-top: clamp(96px, 15vw, 200px); }
.section:last-of-type { padding-bottom: clamp(64px, 10vw, 140px); }
.sec-head { margin-bottom: clamp(32px, 5vw, 64px); }
.sec-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: clamp(18px, 3vw, 32px);
}
.sec-meta__idx { color: var(--amber); font-weight: 600; }
.sec-meta__rule { flex: 0 0 clamp(32px, 8vw, 96px); height: 1px; background: var(--line-3); }
.sec-meta__spec { margin-left: auto; color: var(--fg-3); }
@media (max-width: 560px) { .sec-meta__spec { margin-left: 0; flex-basis: 100%; } }

/* kinetic titles: JS sets --p (0→1) as the title travels into view */
.ktitle {
  --p: 1;
  --amp: 1;
  font-family: var(--f-head);
  font-size: clamp(1.6rem, 7.4vw, 6.2rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.kline {
  display: block; width: max-content;
  transform: translateX(calc((var(--x0) + (var(--x1) - var(--x0)) * var(--p)) * var(--amp) * 1em));
  letter-spacing: calc(0.16em - 0.18em * var(--p)); /* tracking settles as the title arrives */
  opacity: calc(0.22 + 0.78 * var(--p));
  will-change: transform;
}
.kline:nth-child(2) { color: var(--fg-2); font-weight: 250; }
@media (max-width: 760px) { .ktitle { --amp: 0.5; } }

/* ---------- shared: play ring ---------- */
.ring { width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; }
.ring__ticks {
  stroke: var(--fg); stroke-width: 6; opacity: 0.45;
  stroke-dasharray: 0.6 5.4;
  transform-origin: 60px 60px;
  transition: opacity 0.3s, stroke 0.3s;
}
.ring__disc { fill: rgb(10 11 13 / 0.5) !important; }
.ring__track { stroke: rgb(255 255 255 / 0.22); stroke-width: 1.5; }
.ring__arc {
  stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transform: rotate(-90deg); transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.6s var(--ease);
}
.ring__play { fill: var(--fg); transition: fill 0.25s; }
.ring__pause { stroke: var(--amber); stroke-width: 7; fill: none; opacity: 0; }

/* ---------- reels ---------- */
.reel { position: relative; }
.reel__frame {
  position: relative; aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line-2);
  overflow: hidden;
  container-type: inline-size;
  isolation: isolate;
}
.reel__frame:fullscreen { aspect-ratio: auto; border: 0; width: 100%; height: 100%; }
.reel__frame:-webkit-full-screen { aspect-ratio: auto; border: 0; width: 100%; height: 100%; }
.reel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

.reel__frame::after {
  content: ""; position: absolute; inset: 10px; pointer-events: none; z-index: 4;
  --c: rgb(255 255 255 / 0.55); --l: 16px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l);
  background-repeat: no-repeat;
  transition: opacity 0.4s;
}
.reel__frame:not([data-state="idle"])::after { opacity: 0; }

/* poster state */
.reel__poster {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  overflow: hidden;
}
.reel__poster img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.2s var(--ease), filter 0.6s;
  filter: saturate(0.9) brightness(0.82);
}
.reel__poster::before { /* scanlines + vignette */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgb(0 0 0 / 0.55) 100%),
    repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px);
}
.reel__poster:hover img, .reel__poster:focus-visible img { transform: scale(1.05); filter: saturate(1) brightness(0.9); }
.reel__cta {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: 14px;
}
.reel__cta .ring { width: clamp(68px, 12cqi, 128px); height: auto; aspect-ratio: 1; }
.reel__cta .ring { border-radius: 50%; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.reel__cta .ring__ticks { animation: spin 28s linear infinite; opacity: 0.75; }
.reel__cta .ring__track { stroke: rgb(255 255 255 / 0.45); }
.reel__poster:hover .ring__ticks, .reel__poster:focus-visible .ring__ticks { stroke: var(--amber); opacity: 0.9; animation-duration: 6s; }
.reel__poster:hover .ring__arc, .reel__poster:focus-visible .ring__arc { stroke-dashoffset: 0; }
.reel__poster:hover .ring__play, .reel__poster:focus-visible .ring__play { fill: var(--amber-hot); }
@keyframes spin { to { transform: rotate(360deg); } }
.reel__cta-label {
  color: var(--fg); padding: 5px 10px; background: rgb(10 11 13 / 0.62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; gap: 10px; font-size: clamp(0.625rem, 1.6cqi, 0.8125rem);
}
.reel__cta-label em { font-style: normal; color: var(--amber); }
.reel__poster:focus-visible { outline: none; }

.reel__frame[data-state="playing"] .reel__poster,
.reel__frame[data-state="paused"] .reel__poster { opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0s 0.4s; }

/* HUD strip inside the frame */
.reel__hud {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; gap: 16px;
  padding: clamp(14px, 3cqi, 26px) clamp(16px, 3.4cqi, 32px);
  font-size: clamp(0.5625rem, 1.3cqi, 0.75rem);
  color: rgb(255 255 255 / 0.78);
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.55), transparent);
  pointer-events: none;
  transition: opacity 0.4s;
}
.reel__status { display: inline-flex; align-items: center; gap: 8px; }
.reel__status i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); }
.reel__frame[data-state="playing"] .reel__status i { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* controls */
.reel__controls {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto auto;
  align-items: center; gap: clamp(6px, 1.4cqi, 14px);
  padding: 28px clamp(10px, 2.4cqi, 24px) clamp(8px, 1.8cqi, 18px);
  background: linear-gradient(to top, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0.35) 65%, transparent);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
}
.reel__frame:not([data-state="idle"]) .reel__controls { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.reel__frame[data-ui="hidden"] .reel__controls,
.reel__frame[data-ui="hidden"] .reel__hud { opacity: 0; }
.reel__frame[data-ui="hidden"] { cursor: none; }
.reel__frame[data-state="idle"] .reel__hud { opacity: 1; }

.ctl {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--fg);
  transition: color 0.2s, background 0.2s;
}
.ctl:hover { color: var(--amber); background: rgb(255 255 255 / 0.06); }
.ctl .i { width: 18px; height: 18px; }
.ctl--play { border: 1px solid rgb(255 255 255 / 0.3); }
.ctl--play .i-play { display: none; }
.reel__frame[data-state="paused"] .ctl--play .i-play { display: block; }
.reel__frame[data-state="paused"] .ctl--play .i-pause { display: none; }
.ctl--vol .i-mute { display: none; }
.ctl--vol[aria-pressed="true"] .i-mute { display: block; }
.ctl--vol[aria-pressed="true"] .i-wave { display: none; }
.ctl--fs .i-exit { display: none; }
:fullscreen .ctl--fs .i-exit, :-webkit-full-screen .ctl--fs .i-exit { display: block; }
:fullscreen .ctl--fs .i-enter, :-webkit-full-screen .ctl--fs .i-enter { display: none; }
.ctl-tc { font-size: clamp(0.625rem, 1.25cqi, 0.75rem); color: var(--fg); letter-spacing: 0.04em; }
.ctl-tc--dur { color: var(--fg-3); }

/* timeline scrubber */
.tl {
  --p: 0; --b: 0; --h: 0;
  position: relative; height: 44px; cursor: pointer; touch-action: none;
  outline-offset: 0;
}
.tl::before { /* 10-second ticks; JS sets --tick */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 9px; margin-top: -14px;
  background: repeating-linear-gradient(to right, rgb(255 255 255 / 0.32) 0 1px, transparent 1px var(--tick, 40px));
  opacity: 0.6;
}
.tl__track { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgb(255 255 255 / 0.18); transition: height 0.2s, margin 0.2s; }
.tl:hover .tl__track, .tl.is-drag .tl__track { height: 4px; margin-top: -2px; }
.tl__buf, .tl__fill { position: absolute; inset: 0; transform-origin: left; }
.tl__buf { background: rgb(255 255 255 / 0.28); transform: scaleX(var(--b)); }
.tl__fill { background: linear-gradient(to right, var(--amber-deep), var(--amber)); transform: scaleX(var(--p)); }
.tl__head {
  position: absolute; top: 8px; bottom: 8px; left: 0; width: 1px;
  background: var(--amber);
  transform: translateX(calc(var(--p) * var(--w, 0px)));
  box-shadow: 0 0 8px var(--amber);
}
.tl__head::before { /* tab */
  content: ""; position: absolute; top: -2px; left: -4px;
  border: 4.5px solid transparent; border-top: 6px solid var(--amber);
}
.tl__hover {
  position: absolute; bottom: 100%; left: 0;
  transform: translateX(calc(var(--h) * var(--w, 0px) - 50%));
  padding: 4px 7px; background: var(--fg); color: #000;
  font-size: 0.625rem; letter-spacing: 0.04em; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.tl.is-hover .tl__hover, .tl.is-drag .tl__hover { opacity: 1; }

/* narrow frames (phones, inline): timeline gets its own row */
@container (max-width: 560px) {
  .reel__controls {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas: "tl tl tl tl tl" "play now . vol fs";
    row-gap: 0; padding-top: 18px;
  }
  .tl { grid-area: tl; height: 30px; }
  .ctl--play { grid-area: play; width: 36px; height: 36px; }
  [data-reel-now] { grid-area: now; }
  .ctl-tc--dur { display: none; }
  .ctl--vol { grid-area: vol; }
  .ctl--fs { grid-area: fs; }
  .ctl { width: 40px; height: 40px; }
  .reel__hud { padding: 16px 20px; }
}

.reel__caption {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px;
  margin-top: 16px;
}
.reel__bw { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-3); }
.reel__bw .i { width: 14px; height: 14px; fill: none; stroke: currentColor; }
.reel__alt {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 0.9375rem; color: var(--fg-2); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s;
}
.reel__alt:hover { color: var(--amber); }
.reel__alt .i { width: 14px; height: 14px; }

/* generic icon stroke */
.i { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- audio track ---------- */
.track {
  position: relative;
  background: linear-gradient(180deg, var(--bg-panel), var(--bg-raise));
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: clamp(16px, 3vw, 28px);
}
.track::before { /* top accent hairline */
  content: ""; position: absolute; left: -1px; top: -1px; width: 96px; height: 2px; background: var(--amber);
}
.track__head {
  display: flex; align-items: center; gap: 16px;
  color: var(--fg-3); padding-bottom: clamp(14px, 2.4vw, 22px);
  border-bottom: 1px dashed var(--line-2);
}
.track__id { display: inline-flex; align-items: center; gap: 8px; }
.track__led { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); transition: background 0.2s, box-shadow 0.2s; }
.track.is-playing .track__led { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.track__title {
  font-family: var(--f-sans); font-size: 1.125rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--fg);
}
.track__spec { margin-left: auto; }
.track__body {
  display: grid; grid-template-columns: auto 1fr; align-items: center;
  gap: clamp(14px, 3vw, 32px);
  padding-block: clamp(18px, 3.4vw, 32px) 4px;
}
.track__play { width: clamp(64px, 9vw, 96px); aspect-ratio: 1; border-radius: 50%; }
.track__play .ring__disc { fill: rgb(255 255 255 / 0.03) !important; }
.track__play .ring__ticks { animation: spin 40s linear infinite; animation-play-state: paused; }
.track.is-playing .track__play .ring__ticks { animation-play-state: running; stroke: var(--amber); opacity: 0.8; }
.track__play:hover .ring__ticks { stroke: var(--amber); opacity: 0.9; }
.track__play:hover .ring__play { fill: var(--amber-hot); }
.track.is-playing .ring__play { opacity: 0; }
.track.is-playing .ring__pause { opacity: 1; }
.track__play .ring__arc { transition: none; }

.track__wave-wrap { position: relative; min-width: 0; }
.track__wave { height: clamp(88px, 12vw, 128px); cursor: pointer; }
.track__wave:not(.is-ready)::before { /* placeholder baseline until the waveform is drawn */
  content: ""; display: block; height: 1px; margin-top: calc(clamp(88px, 12vw, 128px) / 2); background: var(--line-2);
}
.track__hover {
  --x: 0px;
  position: absolute; top: 0; height: clamp(88px, 12vw, 128px); left: 0; width: 1px;
  background: rgb(255 255 255 / 0.55);
  transform: translateX(var(--x));
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.track__hover span {
  position: absolute; top: -22px; left: 0; transform: translateX(-50%);
  background: var(--fg); color: #000; padding: 2px 6px; font-size: 0.625rem; letter-spacing: 0.04em; white-space: nowrap;
}
.track__wave-wrap.is-hover .track__hover { opacity: 1; }
.track__ruler {
  position: relative; height: 22px; margin-top: 8px;
  border-top: 1px solid var(--line-2);
  color: var(--fg-3); font-size: 0.625rem;
  background: repeating-linear-gradient(to right, var(--line-3) 0 1px, transparent 1px var(--tick, 20px)) top left / 100% 5px no-repeat;
}
.track__ruler span { position: absolute; top: 6px; transform: translateX(-50%); }
.track__ruler span:first-child { transform: none; }
.track__ruler span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 9px; background: var(--fg-3); }
.track__ruler span:first-child::before { left: 0; }

.track__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: clamp(12px, 2vw, 18px); margin-top: 6px;
  border-top: 1px dashed var(--line-2);
  color: var(--fg-3);
}
.track__tc { font-size: 0.875rem; color: var(--fg); letter-spacing: 0.04em; }
.track__sep { margin-inline: 10px; color: var(--fg-3); }
.track__tc span:last-child { color: var(--fg-3); }
.track__meter { display: inline-flex; align-items: center; gap: 10px; }
.track__meter-bar {
  --l: 0;
  width: clamp(96px, 14vw, 160px); height: 8px;
  background:
    linear-gradient(to right, transparent calc(var(--l) * 100%), rgb(49 50 54 / 0.85) calc(var(--l) * 100%)),
    linear-gradient(to right, #7a8a55 0 60%, var(--amber) 60% 85%, #ff5a2a 85%);
  -webkit-mask: repeating-linear-gradient(to right, #000 0 5px, transparent 5px 7px);
  mask: repeating-linear-gradient(to right, #000 0 5px, transparent 5px 7px);
}
.track__db { min-width: 8ch; text-align: right; color: var(--fg-2); }

@media (max-width: 560px) {
  .track__body { grid-template-columns: 1fr; justify-items: start; }
  .track__play { width: 64px; }
  .track__wave-wrap { width: 100%; }
  .track__spec { display: none; }
  .track__ruler span:nth-child(even) { display: none; }
}

.credit { margin-top: 18px; color: var(--fg-2); font-size: 0.9375rem; font-weight: 300; }

/* ---------- sub lists: music videos / drone ---------- */
.sub { margin-top: clamp(56px, 8vw, 96px); }
.sub__title {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--f-head);
  font-size: clamp(1.25rem, 2.8vw, 1.875rem); font-weight: 550; letter-spacing: -0.01em;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-2);
}
.sub__title .mono { color: var(--amber); }
.work {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1.5fr) minmax(0, 1fr) auto 96px;
  align-items: center; gap: 20px;
  min-height: 72px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  isolation: isolate;
}
.work::before { /* amber sweep on hover */
  content: ""; position: absolute; inset: -1px 0 -1px 0; z-index: -1;
  background: linear-gradient(to right, var(--amber-glow), transparent 70%);
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease);
}
.work:hover::before, .work:focus-visible::before { transform: scaleX(1); }
.work__idx { color: var(--fg-3); }
.work__title { font-size: clamp(1.0625rem, 1.9vw, 1.375rem); font-weight: 550; line-height: 1.25; }
.work__by { color: var(--fg-2); font-weight: 300; }
.work__roles { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--f-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg-2);
}
.work__via { justify-self: end; display: inline-flex; align-items: center; gap: 6px; color: var(--fg-3); transition: color 0.2s; }
.work__via .i { width: 13px; height: 13px; transition: transform 0.3s var(--ease); }
.work:hover .work__via { color: var(--amber); }
.work:hover .work__via .i { transform: translate(2px, -2px); }
.work:hover .work__title { color: var(--amber-hot); }

@media (max-width: 760px) {
  .work {
    grid-template-columns: 1fr auto;
    grid-template-areas: "idx via" "title title" "by by" "roles roles";
    gap: 6px 12px; padding: 18px 0;
  }
  .work__idx { grid-area: idx; }
  .work__via { grid-area: via; }
  .work__title { grid-area: title; }
  .work__by { grid-area: by; }
  .work__roles { grid-area: roles; margin-top: 6px; }
  .work__by:empty, .work__roles:empty { display: none; }
}

/* ---------- about ---------- */
.about {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.about__portrait { position: relative; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-raise); }
.about__portrait img {
  width: 100%; height: auto; aspect-ratio: 1400 / 1923; object-fit: cover;
  filter: grayscale(1) contrast(1.2) brightness(1.3);
}
.about__portrait::after { /* amber grade */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgb(255 176 32 / 0.16), transparent 45%, rgb(12 13 15 / 0.55));
  mix-blend-mode: soft-light;
}
.about__scan {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.18) 0 1px, transparent 1px 4px);
}
.about__marks {
  position: absolute; inset: 14px; z-index: 2; pointer-events: none;
  --c: rgb(255 255 255 / 0.6); --l: 16px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l),
    linear-gradient(rgb(255 176 32 / 0.7), rgb(255 176 32 / 0.7)) center / 1px 14px,
    linear-gradient(rgb(255 176 32 / 0.7), rgb(255 176 32 / 0.7)) center / 14px 1px;
  background-repeat: no-repeat;
}
.facts { counter-reset: fact; border-top: 1px solid var(--line-2); }
.facts li {
  counter-increment: fact;
  position: relative;
  padding: clamp(16px, 2.4vw, 26px) 0 clamp(16px, 2.4vw, 26px) 60px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.0625rem, 1.7vw, 1.3125rem); font-weight: 300; line-height: 1.5;
  color: var(--fg);
}
.facts li::before {
  content: counter(fact, decimal-leading-zero);
  position: absolute; left: 0; top: calc(clamp(16px, 2.4vw, 26px) + 0.45em);
  font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0.06em; color: var(--amber);
}
.facts a { color: var(--amber-hot); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.facts a:hover { color: var(--amber); }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait img { aspect-ratio: 4 / 3.4; object-position: 60% 35%; }
  .facts li { padding-left: 44px; }
}

/* ---------- skills: node graphs ---------- */
.graphs { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.graph__label { color: var(--fg-3); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.graph__label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.nodes { position: relative; display: grid; gap: 18px; padding-left: 28px; }
.nodes::before { /* the wire */
  content: ""; position: absolute; left: 8px; top: 20px; bottom: 20px; width: 1px;
  background: linear-gradient(to bottom, var(--amber), var(--line-3));
}
.node {
  position: relative;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  min-height: 52px; padding: 12px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--line-2); border-radius: 6px;
  transition: border-color 0.25s, transform 0.35s var(--ease), background 0.25s;
}
.node::before { /* port on the wire */
  content: ""; position: absolute; left: -24px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border: 1px solid var(--line-3); border-radius: 50%; background: var(--bg);
  transition: background 0.25s, border-color 0.25s;
}
.node::after { /* branch from wire to node */
  content: ""; position: absolute; left: -15px; top: 50%; width: 15px; height: 1px; background: var(--line-3);
}
.node:hover { border-color: var(--amber); transform: translateX(4px); background: var(--bg-hover); }
.node:hover::before { background: var(--amber); border-color: var(--amber); }
.node__name { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); font-weight: 500; }
.node__vendor { color: var(--fg-3); font-size: 0.6875rem; order: 2; white-space: nowrap; }
.nodes--skills .node { border-style: dashed; }
@media (max-width: 760px) {
  .graphs { grid-template-columns: 1fr; }
  .nodes { gap: 12px; }
}

/* ---------- contact ---------- */
.mail-wrap { margin-bottom: clamp(48px, 7vw, 88px); }
.mail {
  display: inline-flex; align-items: center; gap: clamp(10px, 2vw, 24px);
  font-size: clamp(1.75rem, 6.6vw, 5rem); font-weight: 250; font-stretch: 95%;
  letter-spacing: -0.02em; line-height: 1.1;
  text-decoration: none; position: relative;
  max-width: 100%; overflow-wrap: anywhere;
}
.mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--line-3);
}
.mail::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; z-index: 1;
  background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease);
}
.mail:hover::before, .mail:focus-visible::before { transform: scaleX(1); }
.mail .i { width: 0.55em; height: 0.55em; flex: none; color: var(--amber); stroke-width: 1.2; }
.places { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 32px); }
.place { display: block; text-decoration: none; border: 1px solid var(--line-2); background: var(--bg-raise); transition: border-color 0.25s; }
.place:hover { border-color: var(--amber); }
.place__map { position: relative; display: block; overflow: hidden; aspect-ratio: 2 / 1; background: var(--bg-raise); }
.place__map img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) invert(0.93) contrast(0.92) brightness(0.92);
  transition: transform 1s var(--ease), filter 0.5s;
}
.place__map::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(var(--bg-rgb) / 0.6), transparent 55%); }
.place:hover .place__map img { transform: scale(1.04); filter: grayscale(1) invert(0.93) contrast(1) brightness(1); }
.place__reticle {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 1px solid var(--amber); border-radius: 50%;
  box-shadow: 0 0 0 6px rgb(255 176 32 / 0.12);
}
.place__reticle::before, .place__reticle::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--amber);
}
.place__reticle::before { width: 64px; height: 1px; margin-left: -32px; }
.place__reticle::after { width: 1px; height: 64px; margin-top: -32px; }
.place:hover .place__reticle { animation: ping 1.4s var(--ease) infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 14px rgb(255 176 32 / 0); } }
.place__info {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 16px 18px 18px;
}
.place__name { font-size: 1.1875rem; font-weight: 550; }
.place__coords { grid-column: 1; color: var(--fg-3); }
.place__open { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; gap: 6px; align-items: center; color: var(--fg-2); }
.place__open .i { width: 13px; height: 13px; }
.place:hover .place__open { color: var(--amber); }
.map-credit { margin-top: 12px; color: var(--fg-3); font-size: 0.625rem; }
@media (max-width: 760px) { .places { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); }
.foot__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--fg-3); }
.foot__row a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.foot__row a:hover { color: var(--amber); }
.foot__row .i { width: 13px; height: 13px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  .ktitle { --p: 1 !important; }
}
