/* ==========================================================================
   vyrul.dev — dark greyscale, patterned, animated
   ========================================================================== */

:root {
  --bg: #09090a;
  --bg-2: #0e0e10;
  --surface: #131315;
  --surface-2: #1a1a1d;
  --line: #26262a;
  --line-2: #3a3a40;
  --text: #ececee;
  --text-2: #b6b6bd;
  --muted: #83838d;
  --white: #ffffff;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --maxw: 1240px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --r: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--white); color: var(--bg); }

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* ---------- Ambient background layers ---------------------------------- */

body::before {                       /* fading dot grid */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 15%, #000 10%, transparent 80%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 15%, #000 10%, transparent 80%);
  animation: drift 40s linear infinite;
  --tile: 26px;
}

body::after {                        /* film grain */
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' 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");
  animation: grain 1.2s steps(6) infinite;
}

.glow {                              /* cursor spotlight */
  position: fixed;
  top: 0; left: 0;
  width: 640px; height: 640px;
  margin: -320px 0 0 -320px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 62%);
  transform: translate3d(var(--gx, 50vw), var(--gy, 30vh), 0);
  will-change: transform;
}

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 100;
  background: var(--white);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- Patterns (utility) ----------------------------------------- */

.pat-dots {
  --tile: 16px;
  background: radial-gradient(rgba(255, 255, 255, 0.22) 1.2px, transparent 1.5px) 0 0 / 16px 16px;
}
.pat-grid {
  --tile: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 28px;
}
.pat-hatch {
  --tile: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M-3 3l6-6M0 12L12 0M9 15l6-6' stroke='%23fff' stroke-opacity='.13' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 12px 12px;
}
.pat-cross {
  --tile: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 10v8M10 14h8' stroke='%23fff' stroke-opacity='.2' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 28px 28px;
}
.pat-diamond {
  --tile: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16 2L30 16 16 30 2 16z' fill='none' stroke='%23fff' stroke-opacity='.12'/%3E%3C/svg%3E") 0 0 / 32px 32px;
}
.pat-wave {
  --tile: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 10Q10 0 20 10T40 10' fill='none' stroke='%23fff' stroke-opacity='.14'/%3E%3C/svg%3E") 0 0 / 40px 20px;
}
.pat-circuit {
  --tile: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.15'%3E%3Cpath d='M0 12h14l6 6h12M48 36H34l-6-6'/%3E%3C/g%3E%3Cg fill='%23fff' fill-opacity='.25'%3E%3Ccircle cx='14' cy='12' r='1.6'/%3E%3Ccircle cx='34' cy='36' r='1.6'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 48px 48px;
}
.drift { animation: drift 14s linear infinite; }

@keyframes drift {
  to { background-position: var(--tile, 24px) var(--tile, 24px); }
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -3%); }
  60%  { transform: translate(-2%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Header ------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(9, 9, 10, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  border-color: var(--line);
}
.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem var(--pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  font: 700 1.25rem/1 var(--display);
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: baseline;
}
.brand span { color: var(--muted); }
.brand .caret {
  width: 0.5em; height: 0.16em;
  margin-left: 0.18em;
  background: var(--white);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.links a {
  position: relative;
  padding: 0.45rem 0.85rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.links a:hover,
.links a.active { color: var(--white); background: var(--surface-2); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.status b {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping {
  to { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.burger {
  display: none;
  width: 40px; height: 40px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}
.burger i {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger i:nth-child(1) { top: 14px; }
.burger i:nth-child(2) { top: 19px; }
.burger i:nth-child(3) { top: 24px; }
.nav.open .burger i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav.open .burger i:nth-child(2) { opacity: 0; }
.nav.open .burger i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Layout shell (rails + bands) -------------------------------- */

.shell {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  border-inline: 1px solid var(--line);
}

.sec { padding: clamp(3rem, 7vw, 6rem) var(--pad); position: relative; }

.band {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem var(--pad);
  border-block: 1px solid var(--line);
  background: var(--bg-2);
  font: 500 0.74rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.band .no { color: var(--white); }
.band .fill {
  flex: 1;
  align-self: stretch;
  min-height: 14px;
  border-inline: 1px solid var(--line);
  opacity: 0.9;
}
.band::before,
.band::after {                        /* registration marks on the rails */
  content: "+";
  position: absolute;
  top: 50%;
  width: 1em; height: 1em;
  display: grid; place-items: center;
  color: var(--line-2);
  font-size: 1.1rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.band::before { left: 0; }
.band::after { left: 100%; }

.eyebrow {
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h3 { font-size: 1.45rem; line-height: 1.15; }
p { text-wrap: pretty; }

.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); max-width: 56ch; }
.sec-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); max-width: 46rem; }

/* ---------- Buttons ----------------------------------------------------- */

.btn {
  --bx: 0px; --by: 0px;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.4rem;
  font: 600 0.95rem/1 var(--sans);
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text);
  background: transparent;
  transform: translate(var(--bx), var(--by));
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.btn .ar { transition: transform 0.3s var(--ease); }
.btn:hover .ar { transform: translateX(4px) rotate(-45deg); }
.btn:hover { border-color: var(--white); background: var(--surface-2); }
.btn.solid { background: var(--white); color: var(--bg); border-color: var(--white); }
.btn.solid:hover { background: #d9d9dd; border-color: #d9d9dd; }

/* ---------- Hero -------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 7rem) var(--pad) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: -2;
}
.hero::after {                        /* vignette */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 30% 45%, transparent 0%, var(--bg) 100%),
    linear-gradient(to bottom, transparent 70%, var(--bg-2));
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.7rem, 7.4vw, 6.2rem);
  line-height: 0.96;
  margin: 1.25rem 0 1.5rem;
}
.hero h1 .out {
  display: inline-block;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text);
  font-style: italic;
  transition: color 0.4s, -webkit-text-stroke-color 0.4s;
}
.hero h1 .out:hover { color: var(--white); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(19, 19, 21, 0.6);
}

/* terminal */
.term {
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(14, 14, 16, 0.82);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
  font: 400 0.86rem/1.7 var(--mono);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-2); }
.term-bar span { margin-left: auto; }
.term-body { padding: 1rem 1.1rem 1.2rem; min-height: 17.5rem; }
.term-body p { white-space: pre-wrap; word-break: break-word; }
.term .ps { color: var(--muted); user-select: none; }
.term .cmd { color: var(--white); }
.term .res { color: var(--text-2); }
.term .dim { color: var(--muted); }
.term .cur {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  vertical-align: -0.15em;
  background: var(--white);
  animation: blink 1s steps(1) infinite;
}
.js .term [data-out] { opacity: 0; transform: translateY(4px); transition: opacity 0.4s, transform 0.4s; }
.js .term [data-out].show { opacity: 1; transform: none; }

/* ---------- Strip (quick facts) ---------------------------------------- */

.strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip > div {
  position: relative;
  padding: 1.6rem var(--pad) 1.6rem 1.6rem;
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: background 0.3s;
}
.strip > div:last-child { border-right: 0; }
.strip .k { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.strip .v { margin-top: 0.7rem; font: 600 1.15rem/1.25 var(--display); letter-spacing: -0.01em; }
.strip .v small { display: block; font: 400 0.9rem/1.4 var(--sans); color: var(--text-2); margin-top: 0.2rem; letter-spacing: 0; }
.strip > div::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
  background: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.5px) 0 0 / 14px 14px;
}
.strip > div:hover::after { opacity: 1; }
.strip > div { z-index: 0; }

/* ---------- Marquee ----------------------------------------------------- */

.marquee {
  overflow: hidden;
  padding: 1.1rem 0;
  border-block: 1px solid var(--line);
  background: var(--surface);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee .track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  animation: scroll 38s linear infinite;
}
.marquee:hover .track { animation-play-state: paused; }
.marquee span {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  font: 600 clamp(1.4rem, 3.2vw, 2.4rem)/1 var(--display);
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--text-2);
}
.marquee span::after { content: "✦"; font-size: 0.55em; color: var(--line-2); }
.marquee span:nth-child(3n + 1) { color: transparent; -webkit-text-stroke: 1px var(--text-2); }
@keyframes scroll { to { transform: translateX(calc(-50% - 1.25rem)); } }

/* ---------- Cards ------------------------------------------------------- */

.card {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s var(--ease), border-color 0.3s, background 0.3s;
  will-change: transform;
}
.card::before {                       /* spotlight */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.09), transparent 60%);
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 2; }

/* what-i-do cards */
.what { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.what .card { padding: 1.75rem; gap: 1rem; min-height: 21rem; }
.what .ico {
  width: 3.4rem; height: 3.4rem;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg);
}
.what .ico svg { width: 1.6rem; height: 1.6rem; stroke: var(--white); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.what .num { position: absolute; top: 1.2rem; right: 1.4rem; font: 500 0.75rem/1 var(--mono); color: var(--muted); }
.what p { color: var(--text-2); font-size: 1rem; }
.what ul { list-style: none; padding: 0; margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.what .pat {
  position: absolute !important;
  inset: auto 0 0 0;
  height: 45%;
  z-index: 0 !important;
  opacity: 0.7;
  -webkit-mask-image: linear-gradient(to top, #000, transparent);
          mask-image: linear-gradient(to top, #000, transparent);
}

/* project bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.s7 { grid-column: span 7; }
.s5 { grid-column: span 5; }
.s6 { grid-column: span 6; }
.s4 { grid-column: span 4; }
.s12 { grid-column: span 12; }
.proj { min-height: 26rem; }
.proj .browser {
  position: relative;
  flex: 1;
  min-height: 12rem;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.proj .chrome {
  position: absolute;
  top: 0.9rem; left: 0.9rem; right: 0.9rem;
  display: flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  background: rgba(9, 9, 10, 0.85);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font: 400 0.72rem/1 var(--mono);
  color: var(--muted);
  z-index: 3;
}
.proj .chrome i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.proj .chrome span { margin-left: 0.5rem; padding: 0.25rem 0.6rem; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.proj .mark {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font: 800 clamp(5rem, 11vw, 9rem)/1 var(--display);
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.55);
  transition: transform 0.6s var(--ease), color 0.4s;
}
.proj:hover .mark { transform: scale(1.06) rotate(-2deg); color: rgba(255, 255, 255, 0.06); }
.proj-body { padding: 1.4rem 1.6rem 1.6rem; display: grid; gap: 0.75rem; }
.proj-body p { color: var(--text-2); font-size: 1rem; }
.proj h3 { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.proj h3 .arrow {
  flex: none;
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-size: 1rem;
  transition: transform 0.35s var(--ease), background 0.3s, color 0.3s;
}
.proj:hover h3 .arrow { background: var(--white); color: var(--bg); transform: rotate(45deg); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.proj.soon { border-style: dashed; background: transparent; justify-content: center; align-items: center; text-align: center; padding: 2rem; gap: 0.8rem; }
.proj.soon .pat { position: absolute !important; inset: 0; z-index: 0 !important; opacity: 0.6; }
.proj.soon p { color: var(--text-2); max-width: 30ch; }

/* ---------- Lab / tunnel flow ------------------------------------------ */

.lab { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lab p + p { margin-top: 1rem; }
.flow {
  display: grid;
  gap: 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}
.flow > .pat { position: absolute; inset: 0; opacity: 0.6; z-index: 0; -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 80%); mask-image: radial-gradient(ellipse at center, #000 20%, transparent 80%); }
.flow-row { position: relative; z-index: 1; display: flex; align-items: stretch; justify-content: space-between; gap: 0; }
.node {
  flex: 1 1 0;
  min-width: 0;
  display: grid; place-items: center; align-content: center; gap: 0.5rem;
  padding: 1rem 0.35rem;
  text-align: center;
  font: 500 0.68rem/1.3 var(--mono);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.node:hover { border-color: var(--white); transform: translateY(-3px); }
.node svg { width: 1.5rem; height: 1.5rem; stroke: var(--white); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.node small { display: block; font-size: 0.66rem; color: var(--muted); text-transform: none; letter-spacing: 0; margin-top: 0.1rem; }
.wire {
  flex: 0 0 1.1rem;
  position: relative;
  align-self: center;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px);
}
.wire::after {
  content: "";
  position: absolute;
  top: 50%; left: 0;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.6);
  animation: packet 2.4s var(--ease) infinite;
}
.wire:nth-of-type(2)::after { animation-delay: 0.45s; }
.wire:nth-of-type(3)::after { animation-delay: 0.9s; }
.wire:nth-of-type(4)::after { animation-delay: 1.35s; }
@keyframes packet {
  0%   { left: 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: calc(100% - 8px); opacity: 0; }
}
@keyframes packet-v {
  0%   { top: 0; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: calc(100% - 8px); opacity: 0; }
}
/* Stack vertically whenever the diagram's own box is too narrow for five nodes */
@container (max-width: 520px) {
  .flow-row { flex-direction: column; align-items: center; }
  .node { flex: none; width: 100%; max-width: 15rem; font-size: 0.72rem; }
  .wire { flex: none; width: 2px; height: 2.2rem; background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 12px); }
  .wire::after { left: 50%; top: 0; margin: 0 0 0 -4px; animation-name: packet-v; }
}
.flow-foot { position: relative; z-index: 1; margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- About teaser / CTA panels ---------------------------------- */

.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
.panel { padding: clamp(1.6rem, 3vw, 2.5rem); gap: 1.1rem; min-height: 22rem; justify-content: flex-end; }
.panel > .pat { position: absolute !important; inset: 0; z-index: 0 !important; opacity: 0.8; -webkit-mask-image: linear-gradient(160deg, #000, transparent 70%); mask-image: linear-gradient(160deg, #000, transparent 70%); }
.panel p { color: var(--text-2); max-width: 46ch; }
.panel .btn { align-self: flex-start; margin-top: 0.4rem; }
.panel h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }

.cta-final { text-align: center; padding: clamp(4rem, 9vw, 8rem) var(--pad); position: relative; overflow: hidden; }
.cta-final > .pat { position: absolute; inset: 0; opacity: 0.55; -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%); }
.cta-final > *:not(.pat) { position: relative; }
.cta-final h2 { font-size: clamp(2.2rem, 6vw, 4.8rem); margin: 1rem auto 1.5rem; max-width: 18ch; }
.cta-final p { margin: 0 auto 2rem; color: var(--text-2); max-width: 52ch; }

/* ---------- Footer ------------------------------------------------------ */

.foot { position: relative; z-index: 1; overflow: hidden; }
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: 3rem var(--pad) 0; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 2rem 4rem; justify-content: space-between; }
.foot h4 { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.foot ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.foot li a { color: var(--text-2); transition: color 0.2s; }
.foot li a:hover { color: var(--white); }
.foot .blurb { max-width: 32ch; color: var(--text-2); font-size: 0.98rem; }
.wordmark {
  margin: 2.5rem 0 -0.12em;
  font: 800 clamp(4rem, 17.5vw, 15rem)/0.85 var(--display);
  letter-spacing: -0.06em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 75%);
  -webkit-background-clip: text;
          background-clip: text;
  user-select: none;
  white-space: nowrap;
}
.legal {
  position: relative;
  z-index: 2;
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto;
  padding: 1.2rem var(--pad) 1.5rem;
  border-top: 1px solid var(--line);
  font: 400 0.74rem/1.5 var(--mono);
  color: var(--muted);
  background: var(--bg);
}

/* ---------- About page -------------------------------------------------- */

.page-hero { padding: clamp(3rem, 8vw, 6.5rem) var(--pad) clamp(2.5rem, 5vw, 4rem); position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); margin: 1.2rem 0 1.4rem; line-height: 0.98; max-width: 16ch; }
.page-hero h1 .out { color: transparent; -webkit-text-stroke: 1.5px var(--text); font-style: italic; }
.page-hero > .pat { position: absolute; inset: 0; opacity: 0.5; z-index: -1; -webkit-mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 65%); mask-image: radial-gradient(ellipse at 80% 20%, #000, transparent 65%); }

.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.prose { display: grid; gap: 1.2rem; max-width: 62ch; }
.prose p { color: var(--text-2); }
.prose p strong { color: var(--white); font-weight: 600; }
.prose a.inl { color: var(--white); border-bottom: 1px solid var(--line-2); transition: border-color 0.2s; }
.prose a.inl:hover { border-color: var(--white); }

.profile { position: sticky; top: 5.5rem; }
.profile .avatar {
  aspect-ratio: 1.15;
  display: grid; place-items: center;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.profile .avatar span {
  font: 800 7rem/1 var(--display);
  letter-spacing: -0.08em;
  color: var(--white);
  text-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}
.profile dl { display: grid; margin: 0; }
.profile dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.3rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.profile dl > div:last-child { border-bottom: 0; }
.profile dt { font: 500 0.72rem/1.6 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.profile dd { margin: 0; text-align: right; color: var(--text); }

.chapters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.chapter { padding: 1.75rem; gap: 0.9rem; min-height: 20rem; }
.chapter .n { font: 800 4.5rem/1 var(--display); letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px var(--line-2); }
.chapter p { color: var(--text-2); font-size: 1rem; }

.zrelyy { padding: clamp(1.8rem, 4vw, 3.2rem); min-height: 22rem; justify-content: flex-end; gap: 1.1rem; }
.zrelyy > .pat { position: absolute !important; inset: 0; z-index: 0 !important; opacity: 0.9; -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 65%); mask-image: linear-gradient(120deg, #000 0%, transparent 65%); }
.zrelyy h2 { max-width: 14ch; }
.zrelyy p { color: var(--text-2); max-width: 54ch; }
.zrelyy .btn { align-self: flex-start; }

.note { font: 400 0.8rem/1.6 var(--mono); color: var(--muted); max-width: 70ch; }

/* ---------- 404 --------------------------------------------------------- */

.lost { min-height: 78vh; display: grid; place-items: center; text-align: center; padding: var(--pad); position: relative; z-index: 1; }
.lost h1 { font-size: clamp(6rem, 24vw, 18rem); line-height: 0.85; letter-spacing: -0.07em; color: transparent; -webkit-text-stroke: 2px var(--text); }
.lost p { color: var(--text-2); margin: 1.2rem auto 2rem; max-width: 40ch; }

/* ---------- Reveal on scroll ------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 980px) {
  .hero-grid, .lab, .split, .about-grid { grid-template-columns: 1fr; }
  .profile { position: static; }
  .what, .chapters { grid-template-columns: 1fr; }
  .what .card, .chapter { min-height: 0; }
  .s7, .s5, .s6, .s4 { grid-column: span 12; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip > div:nth-child(2) { border-right: 0; }
  .strip > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .status { display: none; }
  .burger { display: block; }
  .links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem var(--pad) 1rem;
    background: rgba(9, 9, 10, 0.96);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav.open .links { opacity: 1; transform: none; visibility: visible; }
  .links a { padding: 0.9rem 0.5rem; border-radius: 8px; font-size: 0.85rem; }

  .shell { border-inline: 0; }
  .band::before, .band::after { display: none; }

  .strip > div { padding: 1.2rem 1rem; }
  .profile .avatar span { font-size: 5rem; }
}

@media (max-width: 460px) {
  .strip { grid-template-columns: 1fr; }
  .strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .strip > div:last-child { border-bottom: 0; }
  .hero .cta .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; filter: none; }
  .js .term [data-out] { opacity: 1; transform: none; }
  .marquee .track { animation: none; }
  body::after, .glow { display: none; }
}

@media (hover: none) {
  .glow { display: none; }
}
