/* =========================================================
   Iliyan Mladenov · personal site
   Hand-written CSS, no framework. Tokens first.
   ========================================================= */

:root {
  --bg: #F4F1EA;
  --bg-2: #ECE8DF;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --ink: #14161B;
  --ink-2: #30343D;
  --muted: #646A76;
  --line: #E3DED3;
  --line-2: #CFC8BA;
  --accent: #2557E8;
  --accent-soft: rgba(37, 87, 232, 0.10);
  --signal: #EE5A24;
  --signal-soft: rgba(238, 90, 36, 0.14);
  --branch: #7C4DDB;
  --ok: #168A4C;
  --code-bg: #10131A;
  --shadow: 0 1px 2px rgba(20, 22, 27, 0.04), 0 10px 28px -16px rgba(20, 22, 27, 0.18);
  --shadow-lg: 0 40px 80px -40px rgba(20, 22, 27, 0.45);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;

  --radius: 22px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0E13;
    --bg-2: #11141B;
    --surface: #151922;
    --surface-2: #1A1F2A;
    --ink: #ECEEF3;
    --ink-2: #C7CBD4;
    --muted: #949BA8;
    --line: #252B37;
    --line-2: #364052;
    --accent: #7FA4FF;
    --accent-soft: rgba(127, 164, 255, 0.14);
    --signal: #FF7D47;
    --signal-soft: rgba(255, 125, 71, 0.16);
    --branch: #B29BFF;
    --ok: #4ADE80;
    --code-bg: #0A0C11;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0E13;
  --bg-2: #11141B;
  --surface: #151922;
  --surface-2: #1A1F2A;
  --ink: #ECEEF3;
  --ink-2: #C7CBD4;
  --muted: #949BA8;
  --line: #252B37;
  --line-2: #364052;
  --accent: #7FA4FF;
  --accent-soft: rgba(127, 164, 255, 0.14);
  --signal: #FF7D47;
  --signal-soft: rgba(255, 125, 71, 0.16);
  --branch: #B29BFF;
  --ok: #4ADE80;
  --code-bg: #0A0C11;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
strong { font-weight: 600; color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--signal); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--signal); }
.display {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7.4vw, 6.1rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-bottom: 28px;
}
.display em, .h2 em, .h3 em { font-style: italic; color: var(--accent); }
.h2 { font-family: var(--font-serif); font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.02; letter-spacing: -0.01em; }
.h3 { font-family: var(--font-serif); font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.08; margin-bottom: 16px; }
.h4 { font-family: var(--font-serif); font-size: clamp(1.4rem, 2.2vw, 1.75rem); line-height: 1.12; margin-bottom: 12px; }
.kicker {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.co { color: var(--accent); }
.arrow { color: var(--signal); }

.section-head { margin-bottom: 48px; }
.section-sub { color: var(--muted); max-width: 56ch; margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; background: none;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn svg, .chip-btn svg, .icon-btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn--ghost svg { color: var(--signal); }
.btn--light { background: #fff; color: #10182F; }
.btn--light:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.btn--outline-light { color: #fff; border-color: rgba(255,255,255,.35); }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }

.link-arrow {
  display: inline-flex; gap: 6px; font-weight: 500; font-size: 15px; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.link-arrow:hover { color: var(--signal); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  border: 1.5px solid var(--ink); font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.02em;
  transition: background-color .2s ease, color .2s ease;
}
.brand:hover .brand-mark { background: var(--ink); color: var(--bg); }
.brand-name { font-weight: 600; font-size: 15px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-size: 14.5px; color: var(--muted); text-decoration: none; position: relative; transition: color .2s ease; }
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--signal); transform: translateX(-50%);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.chip-btn svg { width: 15px; height: 15px; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn:first-child svg { color: var(--signal); }
.chip-btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-btn--solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding-top: calc(var(--nav-h) + clamp(48px, 9vh, 110px));
  padding-bottom: clamp(56px, 8vh, 96px);
  min-height: min(100vh, 900px);
}
.hero::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -2;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 70% 35%, #000 10%, transparent 75%);
  opacity: .7;
}
.hero-arc {
  position: absolute; z-index: -1; inset: 8% 0 0 0; width: 100%; height: 80%; pointer-events: none; overflow: visible;
}
.hero-arc path {
  fill: none; stroke: var(--signal); stroke-width: 1.5; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .55;
  vector-effect: non-scaling-stroke;
}
.lede { font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ink-2); max-width: 36em; line-height: 1.55; }
.lede--small { font-size: 1rem; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .22s; }
.hero-copy > :nth-child(5) { animation-delay: .28s; }
.pass { animation: pass-in 1.1s cubic-bezier(.2, .7, .2, 1) .25s backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pass-in { from { opacity: 0; transform: translateY(30px) rotate(6deg); } }

/* ---------- Boarding pass ---------- */
.pass {
  --notch: 14px;
  position: relative; max-width: 420px; width: 100%; justify-self: end;
  transform: rotate(2deg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
  filter: drop-shadow(0 30px 40px rgba(20, 22, 27, .16));
}
.pass:hover { transform: rotate(0deg) translateY(-4px); }
.pass-main, .pass-stub { background: var(--surface); border: 1px solid var(--line); }
.pass-main {
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; overflow: hidden;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
  padding-bottom: 20px;
}
.pass-stub {
  border-radius: 0 0 var(--radius) var(--radius); border-top: 0; padding: 18px 22px 20px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
  background-image: linear-gradient(90deg, var(--line-2) 50%, transparent 50%);
  background-size: 12px 1.5px; background-repeat: repeat-x; background-position: 22px 0;
}
.pass-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
}
:root[data-theme="dark"] .pass-head { color: #0C0E13; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pass-head { color: #0C0E13; } }
.pass-flight { font-weight: 500; }
.pass-route { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 12px; padding: 22px 22px 6px; }
.pass-code { display: block; font-family: var(--font-mono); font-size: 40px; font-weight: 500; line-height: 1; letter-spacing: -0.02em; }
.pass-city { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.pass-to { text-align: right; }
.pass-to .pass-code { color: var(--signal); }
.pass-path { display: flex; align-items: center; gap: 6px; padding-bottom: 24px; color: var(--signal); }
.pass-path span { flex: 1; height: 0; border-top: 1.5px dashed var(--line-2); }
.pass-path svg { width: 20px; height: 20px; fill: currentColor; transform: rotate(45deg); }
.pass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 14px 22px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.pass-grid dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pass-grid dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 500; }
.pass-status {
  display: flex; align-items: center; gap: 10px; margin: 18px 22px 0; padding: 10px 14px; border-radius: 12px;
  background: var(--signal-soft); color: var(--ink); font-size: 13.5px; font-weight: 500;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--signal);
  animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.barcode {
  height: 46px; border-radius: 4px; margin-top: 6px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
    var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px,
    var(--ink) 16px 17px, transparent 17px 19px, var(--ink) 19px 22px, transparent 22px 25px);
  opacity: .85;
}
.pass-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pass-actions a {
  text-align: center; text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line-2);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.pass-actions a:first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pass-actions a:hover { border-color: var(--accent); color: var(--accent); }
.pass-actions a:first-child:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding-block: 0;
}
.stat { padding: 28px 24px 30px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-num { display: block; font-family: var(--font-serif); font-size: clamp(3rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -0.02em; }
.stat-label { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 24ch; }

/* ---------- Journey / route ---------- */
.journey { padding-top: clamp(90px, 12vw, 150px); }
.route {
  --rail: 150px;
  --rail-start: 34px;
  --rail-len: calc(100% - 80px);
  --p: 0;
  position: relative;
}
.route-rail { position: absolute; inset: 0; pointer-events: none; }
.route-track, .route-fill { position: absolute; left: var(--rail); top: var(--rail-start); transform: translateX(-50%); }
.route-track {
  width: 2px; height: var(--rail-len);
  background-image: linear-gradient(var(--line-2) 55%, transparent 55%);
  background-size: 2px 11px;
}
.route-fill {
  width: 3px; border-radius: 3px;
  height: calc(var(--p) * var(--rail-len));
  background: linear-gradient(180deg, var(--accent), var(--signal));
}
.route-plane {
  position: absolute; left: var(--rail); top: calc(var(--rail-start) + var(--p) * var(--rail-len));
  width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  display: grid; place-items: center; z-index: 3;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--signal);
}
.route-plane svg { width: 20px; height: 20px; fill: currentColor; transform: rotate(135deg); }
.route-plane .fold, .contact-plane .fold { fill: none; stroke: var(--surface); stroke-width: 1.2; }

.stop {
  position: relative;
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-bottom: clamp(56px, 7vw, 88px);
}
.stop:last-child { padding-bottom: 0; }
.stop-meta {
  position: sticky; top: calc(var(--nav-h) + 40px); align-self: start;
  text-align: right; padding-right: 36px; padding-top: 12px;
}
.stop-when { display: block; font-family: var(--font-serif); font-size: 30px; line-height: 1; letter-spacing: -0.01em; transition: color .3s ease; }
.stop-where { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stop.is-current .stop-when { color: var(--signal); }
.stop-dot {
  position: absolute; left: var(--rail); top: 26px; z-index: 2;
  width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2);
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.stop.is-passed .stop-dot { background: var(--accent); border-color: var(--accent); }
.stop.is-current .stop-dot { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 7px var(--signal-soft); }
.stop--next .stop-dot { border-style: dashed; }
.stop > .card { grid-column: 2; margin-left: 40px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 38px); box-shadow: var(--shadow);
}
.card p { color: var(--ink-2); max-width: 70ch; }
.card--split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 32px; align-items: center; }
.media { margin: 0; }
.media img { border-radius: 14px; border: 1px solid var(--line); aspect-ratio: 16 / 11; object-fit: cover; width: 100%; }
.media figcaption { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.note {
  font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; line-height: 1.35;
  color: var(--ink) !important; border-left: 3px solid var(--signal); padding-left: 16px; margin: 22px 0;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li {
  font-family: var(--font-mono); font-size: 12px; line-height: 1; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink-2);
}
.tags--sm { margin-top: 12px; }
.tags--sm li { font-size: 11px; padding: 5px 8px; }

/* Project shelf */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.proj {
  display: flex; flex-direction: column; padding: 12px 12px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.proj:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.proj h4 { font-size: 16px; font-weight: 600; margin: 4px 4px 6px; }
.proj p { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 4px; }
.proj .tags { margin-inline: 4px; }
.proj .link-arrow { margin: 12px 4px 0; align-self: flex-start; font-size: 14px; }
.proj--highlight { border: 1.5px dashed var(--signal); }
.proj-media {
  aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; margin-bottom: 12px;
  display: grid; place-items: center; position: relative;
}
.proj-media img { width: 100%; height: 100%; object-fit: contain; }
.proj-media--dark { background: #050506; }

.proj-media--chat {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px;
  background: linear-gradient(160deg, var(--accent-soft), transparent), var(--surface);
  border: 1px solid var(--line);
}
.bubble {
  align-self: flex-start; max-width: 82%; font-size: 11.5px; line-height: 1.35;
  padding: 6px 10px; border-radius: 14px 14px 14px 4px; background: var(--bg-2); color: var(--ink);
}
.bubble--me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .bubble--me { color: #0C0E13; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bubble--me { color: #0C0E13; } }

.proj-media--tsp {
  background: var(--surface); border: 1px solid var(--line);
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px); background-size: 14px 14px;
}
.tsp { width: 88%; height: auto; overflow: visible; }
.tsp-path {
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round;
  stroke-dasharray: 1000; stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s cubic-bezier(.4, 0, .2, 1);
}
.js .proj-media--tsp:not(.in) .tsp-path { stroke-dashoffset: 1000; }
.tsp-pts circle { fill: var(--signal); stroke: var(--surface); stroke-width: 2; }

.proj-media--code { background: var(--code-bg); place-items: stretch; }
.proj-media--code pre {
  margin: 0; padding: 12px 14px; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.55;
  color: #C9D1E0; white-space: pre; overflow: hidden;
}
.proj-media--code .c { color: #6B7489; }
.proj-media--code .k { color: #82AAFF; }
.proj-media--code .n { color: #FF9E64; }

.proj-media--v1 {
  background: #1E2125; color: #fff; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; gap: 6px; padding: 30px 18px 14px; font-family: "Poppins", var(--font-sans);
}
.v1-bar { position: absolute; inset: 0 0 auto 0; height: 18px; background: #343A40; display: flex; gap: 5px; align-items: center; padding-left: 8px; }
.v1-bar i { width: 6px; height: 6px; border-radius: 50%; background: #6c757d; }
.v1-title { font-size: 17px; font-weight: 600; }
.v1-sub { font-size: 11px; opacity: .75; border-top: 1px solid rgba(255,255,255,.5); padding-top: 4px; width: 80%; }
.v1-btn { font-size: 10.5px; background: #343A40; padding: 5px 10px; border-radius: 4px; margin-top: 4px; }

/* Then / now */
.then-now { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; margin-top: 24px; }
.then-now > div { border-radius: 16px; padding: 18px 20px; }
.then-now p { margin: 0; font-size: 15px; }
.then { background: var(--surface-2); border: 1px solid var(--line); }
.now { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.tn-label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.now .tn-label { color: var(--accent); }
.tn-arrow { align-self: center; font-family: var(--font-serif); font-size: 34px; color: var(--signal); }
cite { font-style: italic; color: var(--ink); }

/* CNN pipeline */
.cnn {
  display: flex; align-items: center; gap: 8px; margin: 26px 0 24px; padding: 22px 18px;
  border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line);
}
.cnn-step { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; flex: 0 1 auto; }
.cnn-step b { font-size: 13px; font-weight: 600; margin-top: 10px; white-space: nowrap; }
.cnn-step small { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cnn-arrow { flex: 1 1 18px; min-width: 14px; height: 2px; background: var(--line-2); position: relative; margin-bottom: 30px; }
.cnn-arrow::after {
  content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--line-2); border-right: 0;
}
.cnn-mri {
  width: 54px; height: 54px; border-radius: 12px;
  background: radial-gradient(ellipse 36% 44% at 50% 50%, #c9c9c9 0 30%, #8a8a8a 45%, #3a3a3a 62%, transparent 64%),
              radial-gradient(ellipse 46% 52% at 50% 50%, #5b5b5b 0 70%, transparent 72%), #050506;
}
.cnn-aug { position: relative; width: 54px; height: 54px; }
.cnn-aug i { position: absolute; inset: 8px; border-radius: 8px; border: 1.5px solid var(--muted); background: var(--surface); }
.cnn-aug i:nth-child(1) { transform: rotate(-12deg) translate(-4px, 2px); }
.cnn-aug i:nth-child(2) { transform: rotate(8deg) translate(4px, -2px); }
.cnn-aug i:nth-child(3) { border-color: var(--accent); background: var(--accent-soft); }
.cnn-conv { display: flex; align-items: center; gap: 4px; height: 54px; }
.cnn-conv i { width: 9px; border-radius: 3px; background: var(--accent); }
.cnn-conv i:nth-child(1) { height: 52px; opacity: .45; }
.cnn-conv i:nth-child(2) { height: 40px; opacity: .6; }
.cnn-conv i:nth-child(3) { height: 28px; opacity: .8; }
.cnn-conv i:nth-child(4) { height: 16px; }
.cnn-out { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 54px; }
.cnn-out i { font-family: var(--font-mono); font-style: normal; font-size: 10.5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); }
.cnn-out i:first-child { background: var(--signal); color: #fff; border-color: var(--signal); }
.cnn-phone { width: 30px; height: 54px; border-radius: 8px; border: 2px solid var(--ink); padding: 4px 3px; display: block; }
.cnn-phone i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(160deg, var(--accent), var(--signal)); }

/* Jobs */
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.job-head .h3 { margin-bottom: 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted);
}
.badge--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge--live { background: var(--signal-soft); border-color: transparent; color: var(--signal); }
.points { display: grid; gap: 10px; margin: 4px 0 0; }
.points li { position: relative; padding-left: 22px; color: var(--ink-2); max-width: 70ch; }
.points li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); border-radius: 1px;
}
.points a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.points a:hover { color: var(--signal); }
.points--cols { grid-template-columns: 1fr 1fr; gap: 12px 28px; margin-top: 8px; }
.app-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.app-links a {
  display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2);
  transition: border-color .2s ease, color .2s ease;
}
.app-links small { font-weight: 400; color: var(--muted); font-size: 12px; }
.app-links a:hover { border-color: var(--accent); color: var(--accent); }

.metric-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.metric { padding: 18px 22px; border-radius: 16px; background: var(--signal-soft); min-width: 170px; }
.metric-num { display: block; font-family: var(--font-serif); font-size: 64px; line-height: 1; color: var(--signal); }
.metric-label { display: block; font-size: 13px; color: var(--ink-2); margin-top: 8px; max-width: 18ch; line-height: 1.4; }

.branch {
  position: relative; margin-top: 30px; padding: 24px 24px 24px 28px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.branch::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--branch); }
.kicker--branch { color: var(--branch); }
.branch-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.branch-grid .link-arrow { margin-top: 16px; }
.whitelabel { display: flex; flex-direction: column; align-items: center; gap: 0; }
.wl-core {
  font-family: var(--font-mono); font-size: 12px; padding: 8px 14px; border-radius: 99px;
  background: var(--branch); color: #fff;
}
:root[data-theme="dark"] .wl-core { color: #0C0E13; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wl-core { color: #0C0E13; } }
.wl-lines { width: 2px; height: 22px; background: var(--branch); opacity: .6; }
.wl-grid { display: grid; grid-template-columns: repeat(4, 22px); gap: 7px; padding: 12px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--branch) 55%, transparent); }
.wl-grid i {
  width: 22px; height: 22px; border-radius: 6px;
  background: color-mix(in srgb, var(--branch) 70%, var(--surface));
  transition: transform .5s cubic-bezier(.3, 1.5, .5, 1), opacity .4s ease;
}
.wl-grid i { background: linear-gradient(135deg, var(--branch) 49%, color-mix(in srgb, var(--branch) 40%, var(--surface)) 51%); }
.js .whitelabel:not(.in) .wl-grid i { transform: scale(0); opacity: 0; }
.wl-label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 10px; text-transform: uppercase; letter-spacing: .08em; }

.fit-video { margin: 0; justify-self: center; text-align: center; }
.fit-video video { display: block; width: 100%; max-width: 200px; height: auto; border-radius: 22px; border: 5px solid var(--ink); background: #000; }
.fit-video figcaption { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 10px; max-width: 200px; line-height: 1.4; }
.after-branch { margin-top: 26px; }

/* Current role feature */
.card--feature {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(180deg, var(--accent-soft), transparent 260px), var(--surface);
}
.card--feature .big { font-size: 1.12rem; color: var(--ink); max-width: 64ch; }
.card--feature .big a { text-decoration: none; color: var(--accent); }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 26px 0 24px; }
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--surface); }
.panel-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.meter { margin-bottom: 20px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.meter-val { font-family: var(--font-serif); font-size: 28px; line-height: 1; color: var(--ink); }
.meter-val small { font-family: var(--font-sans); font-size: 12px; color: var(--muted); }
.meter-bar { height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter-fill {
  display: block; height: 100%; width: var(--to); border-radius: 99px;
  background: linear-gradient(90deg, var(--signal), color-mix(in srgb, var(--signal) 60%, var(--accent)));
  transition: width 1.8s cubic-bezier(.2, .8, .2, 1) .15s;
}
.js .meter:not(.in) .meter-fill { width: 100%; }
.meter-foot { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.delta { color: var(--ok) !important; font-family: var(--font-mono); font-size: 13px; }
.meter-top .delta { font-size: 20px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-stats dt { font-size: 12px; color: var(--muted); line-height: 1.3; }
.mini-stats dd { margin: 6px 0 0; font-family: var(--font-serif); font-size: 30px; line-height: 1; }
.mini-stats dd small { font-family: var(--font-sans); font-size: 12px; color: var(--signal); }

.pipeline { counter-reset: step; display: grid; gap: 0; }
.pipeline li {
  counter-increment: step; position: relative; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px;
  padding-bottom: 14px;
}
.pipeline li::before {
  content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 11.5px;
  background: var(--accent-soft); color: var(--accent); position: relative; z-index: 1;
}
.pipeline li::after { content: ""; position: absolute; left: 12px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.pipeline li:last-child { padding-bottom: 0; }
.pipeline li:last-child::after { display: none; }
.pipeline li:last-child::before { background: var(--signal); color: #fff; }
.pipeline b { font-size: 14px; font-weight: 600; line-height: 1.3; padding-top: 3px; }
.pipeline small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.card--next {
  display: block; text-decoration: none; background: transparent; box-shadow: none;
  border: 2px dashed var(--line-2); transition: border-color .25s ease, background-color .25s ease;
}
.card--next:hover { border-color: var(--signal); background: var(--signal-soft); }
.card--next .h3 { margin-bottom: 14px; }

/* ---------- Apps ---------- */
.apps { padding-top: clamp(100px, 12vw, 160px); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.app {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.app:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.app-icon {
  flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: #fff; letter-spacing: .02em;
  background: linear-gradient(140deg, hsl(var(--h) 78% 60%), hsl(calc(var(--h) + 28) 70% 40%));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 14px -8px hsl(var(--h) 70% 35%);
}
.app-body { display: flex; flex-direction: column; min-width: 0; }
.app-body b { font-size: 16px; font-weight: 600; }
.app-body small { font-size: 13.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.app-body em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 6px; }
.app-go { margin-left: auto; color: var(--muted); font-size: 18px; transition: color .2s ease, transform .2s ease; }
.app:hover .app-go { color: var(--accent); transform: translate(2px, -2px); }

/* ---------- Toolbox ---------- */
.toolbox { padding-top: clamp(100px, 12vw, 160px); }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tool-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.tool .tags { margin-top: 16px; }
.tool-ico { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.tool-ico--ai { background: var(--signal); }
.tool-ico--arch { background: var(--branch); }
.tool-ico--ship { background: var(--ok); }
.tool-ico--lead { background: var(--ink); }
.tool-ico--lang { background: transparent; border: 2px solid var(--accent); }
.langs { display: grid; gap: 12px; margin-top: 18px; }
.langs li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name dots" "lvl lvl"; align-items: center; }
.langs li > span:first-child { grid-area: name; font-weight: 500; }
.langs small { grid-area: lvl; font-size: 12.5px; color: var(--muted); }
.lvl { grid-area: dots; display: flex; gap: 5px; }
.lvl i { width: 11px; height: 11px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line-2); }
.lvl i.on { background: var(--accent); border-color: var(--accent); }

/* ---------- Contact ---------- */
.contact {
  margin-top: clamp(110px, 14vw, 180px);
  color: #fff; text-align: center; position: relative; overflow: hidden;
  padding: clamp(90px, 12vw, 150px) 0;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(255, 255, 255, .16), transparent 70%),
    radial-gradient(700px 400px at 0% 110%, rgba(238, 90, 36, .35), transparent 70%),
    linear-gradient(160deg, #0E1A45, #1B3FB8 58%, #2A58E8);
}
.contact::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.22) 1px, transparent 1.2px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000, transparent 70%);
  opacity: .5;
}
.contact-inner { position: relative; }
.contact-plane { width: 64px; height: 64px; margin: 0 auto 26px; color: #fff; animation: float 5s ease-in-out infinite; }
.contact-plane svg { width: 100%; height: 100%; fill: currentColor; }
.contact-plane .fold { stroke: #1B3FB8; }
@keyframes float { 0%, 100% { transform: translate(0, 0) rotate(0deg); } 50% { transform: translate(6px, -10px) rotate(4deg); } }
.eyebrow--light { color: rgba(255,255,255,.75); justify-content: center; }
.eyebrow--light::before { background: #FFB08A; }
.h2--xl { font-size: clamp(3rem, 8.5vw, 6.6rem); line-height: .98; margin-bottom: 22px; }
.contact .h2 em { color: #FFC2A6; }
.contact-sub { max-width: 54ch; margin: 0 auto 34px; font-size: 1.1rem; color: rgba(255,255,255,.85); }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.contact-meta { margin-top: 30px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; color: rgba(255,255,255,.65); }

/* ---------- Footer ---------- */
.footer { padding-top: 44px; padding-bottom: 48px; }
.footer-story { display: flex; align-items: center; gap: 18px; }
.footer-story img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 2px solid var(--line); flex: none; }
.footer-story p { margin: 0; color: var(--muted); font-size: 15px; max-width: 70ch; }
.footer-story a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; white-space: nowrap; }
.footer-legal { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; left: 50%; bottom: 18px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  font-family: var(--font-mono); font-size: 12px; white-space: nowrap;
  transform: translate(-50%, 160%); opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
}
.hud.show { transform: translate(-50%, 0); opacity: 1; }
.hud svg { width: 16px; height: 16px; fill: var(--signal); transform: rotate(45deg); }
.hud-stop { color: var(--muted); }
.hud-sep { width: 1px; height: 14px; background: var(--line-2); }
.hud-when { font-weight: 500; color: var(--ink); }
.hud-where { color: var(--muted); }

/* ---------- Summary dialog ---------- */
.summary {
  width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 40px);
  padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 26px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  overflow: auto;
}
.summary[open] { animation: dlg-in .35s cubic-bezier(.2, .7, .2, 1); }
.summary::backdrop { background: rgba(8, 10, 14, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.summary-close { position: absolute; top: 16px; right: 16px; margin: 0; }
.summary-close button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14px;
}
.summary-close button:hover { border-color: var(--ink); }
.summary .kicker { color: var(--signal); }
.summary-title { font-family: var(--font-serif); font-size: clamp(2.2rem, 5vw, 2.8rem); line-height: 1; }
.summary-role { color: var(--muted); margin: 8px 0 20px; }
.summary-facts { margin: 0 0 22px; }
.summary-facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.summary-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.summary-facts dd { margin: 0; font-size: 14.5px; line-height: 1.5; }
.summary-h { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.summary-list { display: grid; gap: 8px; margin-bottom: 20px; }
.summary-list li { position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.summary-list li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; background: var(--signal); transform: rotate(45deg); }
.summary-stack { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.summary-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.summary-actions .btn { min-height: 44px; font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 80px; z-index: 60; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: 1fr; }
  .cnn { flex-wrap: wrap; justify-content: center; row-gap: 18px; }
  .cnn-arrow { flex: 0 0 18px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-arc { display: none; }
  .pass { justify-self: start; max-width: 440px; transform: none; }
  .pass:hover { transform: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 24px 18px 26px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .card--split { grid-template-columns: 1fr; }
  .card--split .media { order: -1; }
  .points--cols { grid-template-columns: 1fr; }
  .branch-grid { grid-template-columns: 1fr; }
  .whitelabel { align-items: flex-start; }
  .metric-row { grid-template-columns: 1fr; gap: 18px; }
  .metric { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .metric-label { margin-top: 0; max-width: none; }

  .route { --rail: 14px; }
  .stop { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .stop-meta {
    grid-column: 2; position: static; text-align: left; padding: 0 0 12px 26px;
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  }
  .stop-when { font-size: 26px; }
  .stop-where { margin-top: 0; }
  .stop-dot { top: 9px; }
  .stop > .card { grid-column: 2; margin-left: 26px; }
  .route-plane { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .route-plane svg { width: 16px; height: 16px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links { display: none; }
  .brand-name { display: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .then-now { grid-template-columns: 1fr; }
  .tn-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
  .mini-stats { grid-template-columns: 1fr 1fr 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .footer-story { align-items: flex-start; }
  .hud-where { display: none; }
  .summary-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .cta-row .btn { width: 100%; }
}

@media (max-width: 420px) {
  .chip-btn span { display: none; }
  .chip-btn { width: 38px; padding: 0; justify-content: center; }
  .pass-code { font-size: 32px; }
  .stop > .card { margin-left: 20px; }
  .stop-meta { padding-left: 20px; }
  .card { padding: 20px 18px; }
  .shelf { grid-template-columns: 1fr; }
  .contact-actions .btn { width: 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .pass { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .hud, .toast, .route-rail, .stop-dot, .hero-arc, .contact-plane, .summary { display: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .contact { color: #000; background: none; }
  .contact .btn { color: #000; border-color: #000; }
}
