/* ==========================================================================
   Rylo Agency — design system ported from motion.dev
   Tokens, type scale, grid and components read directly from motion.dev's
   own stylesheets (styles-DDKKFy2t.css / index-CSVgC-MC.css / home-RWNfzuve.css).
   Hex fallbacks precede every oklch() so older engines still render.
   ========================================================================== */

/* 1. TOKENS ------------------------------------------------------------- */
:root {
  /* motion.dev "lab" neutrals */
  --lab-ink: #0d1210;              --lab-ink: oklch(.145 .01 148);
  --lab-ink-raised: #141a17;       --lab-ink-raised: oklch(.18 .012 148);
  --lab-line: #2a322d;             --lab-line: oklch(.31 .012 148);
  --lab-muted: #a3ada6;            --lab-muted: oklch(.69 .012 148);
  --lab-paper: #f0ece3;            --lab-paper: oklch(.94 .008 96);

  /* Rylo brand blue + feature family (blue-through-teal) */
  --brand-blue: #004aad;           --brand-blue: oklch(.4 .16 260);
  --feat-blue: #4a8ff0;            --feat-blue: oklch(.68 .18 255);
  --feat-teal: #5ad1b0;            --feat-teal: oklch(.78 .13 165);
  --feat-sky: #2fb6ff;             --feat-sky: oklch(.72 .16 235);
  --feat-ice: #9ad0ff;             --feat-ice: oklch(.85 .09 235);
  --feat-indigo: #7f8fff;          --feat-indigo: oklch(.68 .16 275);
  --feat-cyan: #38c8e8;            --feat-cyan: oklch(.8 .12 210);

  /* semantic layer */
  --paper: var(--lab-paper);
  --ink: var(--lab-ink);
  --raised: var(--lab-ink-raised);
  --line: var(--lab-line);
  --muted: var(--lab-muted);
  --accent: var(--brand-blue);
  --on-accent: #ffffff;          /* text/marks that sit ON the accent */
  --accent-ink: #6aa9ff;         /* the accent used AS text */
  --error: #ff5f57;

  --font-sans: "TASA Orbiter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* grid */
  --grid-max: 1440px;
  --gutter: clamp(20px, 5vw, 76px);
  --gap: clamp(16px, 2.1vw, 32px);
  --content-edge: max(var(--gutter), calc((100vw - var(--grid-max)) / 2 + var(--gutter)));
  --header-edge: clamp(24px, 5vw, 68px);

  --nav-height: 60px;
  --nav-pull: 30px;
  --min-mono: 11px;

  --stripe-angle: 119deg;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* 2. RESET -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* A display rule on a class beats the browser default for [hidden], which had
   left the cookie preferences panel permanently expanded. Make hidden win. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip:focus { top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 3. GRID / LAYOUT ------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(64px, 8vw, 112px); }
.section--tight { padding-block: clamp(44px, 5.5vw, 76px); }

/* motion.dev's 12-column section heading: index | title | action */
.section-heading {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  column-gap: var(--gap);
  row-gap: 20px;
  margin-bottom: clamp(44px, 6vw, 72px);
}
.section-index {
  grid-column: 1 / 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.section-index span:first-child { color: var(--accent-ink); }
.section-heading > h2,
.section-heading > .section-title { grid-column: 4 / 10; }
.section-heading-action {
  grid-column: 10 / -1;
  justify-self: end;
  min-width: 0;
  padding-top: 8px;
}

/* 4. TYPOGRAPHY --------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }

h1 {
  font-size: clamp(36px, 4.4vw, 44px);
  font-weight: 660;
  font-variation-settings: "opsz" 50, "wght" 660;
  letter-spacing: -.04em;
  line-height: 1.05;
}
h1 em { color: var(--accent-ink); font-style: normal; }

.section-heading :is(h1, h2, h3),
h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 720;
  font-variation-settings: "opsz" 48, "wght" 720;
  letter-spacing: -.035em;
  line-height: 1.05;
}
h2 em { color: var(--accent-ink); font-style: normal; }

h3 {
  font-size: 17px;
  font-weight: 620;
  font-variation-settings: "opsz" 24, "wght" 620;
  letter-spacing: -.02em;
  line-height: 1.25;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lede {
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.6;
  max-width: 58ch;
}

/* mono kicker used outside section headings */
.kicker {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.kicker b { color: var(--accent-ink); font-weight: inherit; }

.mono { font-family: var(--font-mono); }

/* 5. ROLLING TEXT (motion.dev nav hover) -------------------------------- */
.roll {
  position: relative;
  display: block;
  overflow: hidden;
}
.roll-copy {
  display: block;
  white-space: nowrap;
  transition: transform .42s var(--ease);
}
.roll-copy--in {
  position: absolute;
  inset: 0;
  transform: translateY(100%);
}
a:hover > .roll > .roll-copy,
button:hover > .roll > .roll-copy { transform: translateY(-100%); }
a:hover > .roll > .roll-copy--in,
button:hover > .roll > .roll-copy--in { transform: translateY(0); }

/* 6. BUTTONS ------------------------------------------------------------ */
.action {
  --action-bg: var(--paper);
  --action-fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 18px;
  background: var(--action-bg);
  color: var(--action-fg);
  border: 0;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.action-content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  transition: transform .42s var(--ease);
}
.action-content--hover {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(100%);
}
.action:hover .action-content { transform: translateY(-100%); }
.action:hover .action-content--hover { transform: translateY(0); }

.action--accent { --action-bg: var(--accent); --action-fg: var(--on-accent); }
.action--ghost {
  --action-bg: transparent;
  --action-fg: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.action--ghost:hover { --action-bg: var(--raised); }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* 7. NAV ---------------------------------------------------------------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--accent);
  z-index: 120;
}

.nav {
  --frame-edge: max(0px, calc(var(--content-edge) - var(--nav-pull)));
  position: sticky;
  top: 12px;
  z-index: 50;
  width: calc(100% - (2 * var(--frame-edge)));
  margin-inline: auto;
  margin-bottom: calc(var(--nav-height) * -1);
  padding-inline: min(var(--nav-pull), var(--content-edge));
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--nav-height);
  padding-inline: 18px;
  /* motion.dev's "dossier stripe" bar */
  background-image: repeating-linear-gradient(
    var(--stripe-angle),
    color-mix(in oklch, var(--ink) 40%, transparent) 0,
    color-mix(in oklch, var(--ink) 40%, transparent) 1.5px,
    var(--ink) 1.5px,
    var(--ink) 8px
  );
  background-color: var(--ink);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: inset 0 0 0 1px var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 650;
  font-variation-settings: "opsz" 80, "wght" 650;
  letter-spacing: -.03em;
}
.brand-mark { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--paper); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.burger {
  display: none;
  width: 34px; height: 34px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}
.burger span { display: block; position: relative; width: 15px; height: 1.5px; background: var(--paper); }
.burger span::before, .burger span::after {
  content: ""; position: absolute; left: 0;
  width: 15px; height: 1.5px; background: var(--paper);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.burger span::before { top: -5px; }
.burger span::after { top: 5px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* Closed: zero height so it takes no layout space, matching the old
   display:none — but max-height/opacity can transition where display can't.
   Same fade+lift idiom the "back to top" button already uses (.totop). */
.drawer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: max-height .4s var(--ease), opacity .25s var(--ease);
}
.drawer.open { max-height: 520px; opacity: 1; }
.drawer ul { list-style: none; margin: 0; padding: 8px 18px 18px; }
.drawer li {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  transition-delay: 0ms;
}
.drawer.open li { opacity: 1; transform: none; }
.drawer.open li:nth-child(1) { transition-delay: 40ms; }
.drawer.open li:nth-child(2) { transition-delay: 80ms; }
.drawer.open li:nth-child(3) { transition-delay: 120ms; }
.drawer.open li:nth-child(4) { transition-delay: 160ms; }
.drawer.open li:nth-child(5) { transition-delay: 200ms; }
.drawer.open li:nth-child(6) { transition-delay: 240ms; }
.drawer a {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.drawer a[aria-current="page"] { color: var(--accent-ink); }
.drawer .action { margin-top: 16px; width: 100%; color: var(--action-fg); }

/* 8. HERO (bleed field + overlay panel) --------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
}
/* the solid accent field that carries the ASCII canvas */
.hero-field {
  position: relative;
  width: 100%;
  min-height: clamp(420px, 58vh, 620px);
  background: var(--accent);
  overflow: hidden;
}
.hero-field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-panel {
  position: relative;
  z-index: 3;
  margin-inline: var(--header-edge);
  margin-top: -140px;
  margin-bottom: clamp(40px, 6vw, 76px);
  max-width: min(620px, calc(100% - 2 * var(--header-edge)));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: clamp(28px, 4vw, 48px);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.hero-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-title-sub { display: block; color: var(--paper); }

.hero-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-readout-prefix { color: var(--accent-ink); }
.hero-readout a { color: var(--paper); transition: color .2s var(--ease); }
.hero-readout a:hover { color: var(--accent-ink); }

/* interior page header — same language, no canvas */
.page-header {
  padding-top: calc(var(--nav-height) + 56px);
  padding-bottom: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}
.page-header h1 { margin-block: 18px 20px; }

/* 9. FEATURE ATLAS (8 cells, 1px hairline grid) ------------------------- */
.atlas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}
.cell {
  --feat: var(--feat-ice);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--raised);
  color: var(--paper);
}
.cell-stage {
  position: relative;
  flex: 0 0 auto;
  height: clamp(160px, 16vw, 192px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, color-mix(in srgb, var(--paper) 7%, transparent) 1px, transparent 1px) 0 0 / 6.25% 100%,
    linear-gradient(to bottom, color-mix(in srgb, var(--paper) 7%, transparent) 1px, transparent 1px) 0 0 / 100% calc(100% / 8),
    color-mix(in oklch, var(--feat) 8%, var(--ink));
  overflow: hidden;
}
.cell { position: relative; }
.cell-content { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
/* stretched link — whole cell is the hit area, one link in the a11y tree */
.cell h3 a { color: inherit; }
.cell h3 a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.cell:hover h3 a { color: var(--accent-ink); }
.cell:hover { background: color-mix(in oklch, var(--paper) 4%, var(--raised)); }
.cell-num {
  color: var(--feat);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .11em;
}
.cell-content p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

.cell--a { --feat: var(--feat-blue); }
.cell--b { --feat: var(--feat-teal); }
.cell--c { --feat: var(--feat-sky); }
.cell--d { --feat: var(--feat-ice); }
.cell--e { --feat: var(--feat-indigo); }
.cell--f { --feat: var(--feat-cyan); }
.cell--g { --feat: var(--feat-teal); }
.cell--h { --feat: var(--feat-blue); }

/* --- animated diagram primitives, motion.dev "home-diag" style --- */
.diag { position: absolute; inset: 0; }
.diag-axis { position: absolute; background: color-mix(in srgb, var(--paper) 18%, transparent); }
.diag-axis-x { left: 14%; right: 14%; top: 50%; height: 1px; }
.diag-axis-y { top: 18%; bottom: 18%; left: 50%; width: 1px; }
.diag-tile {
  position: absolute;
  top: 50%; left: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  background: var(--feat);
}
.diag-ghost {
  position: absolute;
  top: 50%; left: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 26%, transparent);
}

/* 01 transform — tile slides + rotates along the axes */
.diag--transform .diag-tile { animation: d-transform 3.6s var(--ease) infinite; }
@keyframes d-transform {
  0%, 12%   { transform: translate(-46px, 0) rotate(0deg); }
  38%, 50%  { transform: translate(46px, 0) rotate(90deg); }
  76%, 100% { transform: translate(-46px, 0) rotate(0deg); }
}

/* 02 bars — staggered fill, like a ranking climb */
.diag-bars { position: absolute; inset: 22% 16%; display: flex; align-items: flex-end; gap: 8px; }
.diag-bar { flex: 1; background: color-mix(in srgb, var(--paper) 14%, transparent); position: relative; height: 100%; }
.diag-bar i {
  position: absolute; inset: auto 0 0 0;
  display: block; background: var(--feat);
  transform-origin: 50% 100%;
  animation: d-bar 2.8s var(--ease) infinite;
}
.diag-bar:nth-child(1) i { height: 34%; animation-delay: 0s; }
.diag-bar:nth-child(2) i { height: 58%; animation-delay: .12s; }
.diag-bar:nth-child(3) i { height: 44%; animation-delay: .24s; }
.diag-bar:nth-child(4) i { height: 80%; animation-delay: .36s; }
.diag-bar:nth-child(5) i { height: 66%; animation-delay: .48s; }
@keyframes d-bar {
  0%, 100% { transform: scaleY(.18); }
  45%, 70% { transform: scaleY(1); }
}

/* 03 cursor — pointer presses a target */
.diag-target {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: var(--feat);
  animation: d-press 2.6s var(--ease) infinite;
}
@keyframes d-press {
  0%, 40%, 100% { transform: scale(1); }
  55%, 70% { transform: scale(.86); }
}
.diag-cursor {
  position: absolute; top: 50%; left: 50%;
  width: 13px; height: 13px; margin: 4px 0 0 4px;
  color: var(--paper);
  animation: d-cursor 2.6s var(--ease) infinite;
}
@keyframes d-cursor {
  0%, 100% { transform: translate(22px, 22px); }
  40%, 70% { transform: translate(4px, 4px); }
}

/* 04 layout — three tiles reorder */
.diag-row { position: absolute; inset: 34% 18%; display: flex; gap: 8px; }
.diag-row span { flex: 1; background: var(--feat); animation: d-swap 3.2s var(--ease) infinite; }
.diag-row span:nth-child(2) { opacity: .62; animation-delay: .1s; }
.diag-row span:nth-child(3) { opacity: .32; animation-delay: .2s; }
@keyframes d-swap {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-26px); }
}

/* 05 spring — ball bounces with overshoot */
.diag-ball {
  position: absolute; left: 50%; top: 22%;
  width: 30px; height: 30px; margin-left: -15px;
  border-radius: 50%;
  background: var(--feat);
  animation: d-spring 2.2s cubic-bezier(.34, 1.56, .64, 1) infinite;
}
@keyframes d-spring {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(58px); }
}
.diag-floor { position: absolute; left: 24%; right: 24%; top: calc(22% + 88px); height: 1px; background: color-mix(in srgb, var(--paper) 22%, transparent); }

/* 06 presence — tiles fade in and out in sequence */
.diag-grid { position: absolute; inset: 26% 22%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.diag-grid span { background: var(--feat); animation: d-fade 2.6s var(--ease) infinite; }
.diag-grid span:nth-child(2) { animation-delay: .1s; }
.diag-grid span:nth-child(3) { animation-delay: .2s; }
.diag-grid span:nth-child(4) { animation-delay: .3s; }
.diag-grid span:nth-child(5) { animation-delay: .4s; }
.diag-grid span:nth-child(6) { animation-delay: .5s; }
@keyframes d-fade {
  0%, 100% { opacity: .12; transform: scale(.8); }
  40%, 60% { opacity: 1; transform: scale(1); }
}

/* 07 timeline — sequential track fills */
.diag-track { position: absolute; left: 16%; right: 16%; height: 6px; background: color-mix(in srgb, var(--paper) 14%, transparent); }
.diag-track:nth-of-type(1) { top: 34%; }
.diag-track:nth-of-type(2) { top: 50%; }
.diag-track:nth-of-type(3) { top: 66%; }
.diag-track i {
  position: absolute; inset: 0 auto 0 0;
  display: block; width: 100%; background: var(--feat);
  transform-origin: 0 50%;
  animation: d-track 3s linear infinite;
}
.diag-track:nth-of-type(1) i { animation-delay: 0s; }
.diag-track:nth-of-type(2) i { animation-delay: .35s; }
.diag-track:nth-of-type(3) i { animation-delay: .7s; }
@keyframes d-track {
  0%, 100% { transform: scaleX(0); }
  30%, 80% { transform: scaleX(1); }
}

/* 08 values — a readout counting */
.diag-readout {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--feat);
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.diag-readout::after { content: ""; display: block; }

/* 10. LIST / TABLE ROWS ------------------------------------------------- */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
  transition: background .25s var(--ease);
}
.row:hover { background: var(--raised); }
.row-n {
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .11em;
  padding-top: 4px;
}
.row p { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 68ch; }

/* 11. CASE CARDS -------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.tile {
  background: var(--raised);
  display: flex;
  flex-direction: column;
  transition: background .3s var(--ease);
}
.tile:hover { background: color-mix(in oklch, var(--paper) 5%, var(--raised)); }
.tile-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--paper) 6%, transparent) 1px, transparent 1px) 0 0 / 8% 100%,
    linear-gradient(to bottom, color-mix(in srgb, var(--paper) 6%, transparent) 1px, transparent 1px) 0 0 / 100% 12%,
    color-mix(in oklch, var(--feat, var(--feat-ice)) 10%, var(--ink));
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile-glyph {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--feat, var(--accent-ink));
}
.tile-body { padding: 20px; }
.tile-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .11em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.tile-body p { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.tile-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile-metrics b { color: var(--feat, var(--accent-ink)); font-weight: 560; }
.is-hidden { display: none !important; }

/* 12. CHIPS ------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chip {
  padding: 8px 15px;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.chip:hover { color: var(--paper); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* 13. STATS ------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.stat { background: var(--ink); padding: 26px 22px; }
.stat-v {
  display: block;
  color: var(--accent-ink);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 660;
  font-variation-settings: "opsz" 48, "wght" 660;
  letter-spacing: -.045em;
  line-height: 1;
  margin-bottom: 10px;
}
.stat-l {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* 14. QUOTES / TEAM ----------------------------------------------------- */
.panel { background: var(--raised); padding: 26px; display: flex; flex-direction: column; }
.panel blockquote { margin: 0 0 22px; font-size: 15px; line-height: 1.6; letter-spacing: -.01em; }
.who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.who-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}
.who-n { font-size: 13.5px; font-weight: 560; }
.who-r { color: var(--muted); font-family: var(--font-mono); font-size: var(--min-mono); letter-spacing: .08em; text-transform: uppercase; }

/* 15. MARQUEE (showcase tape) ------------------------------------------- */
.tape {
  overflow: hidden;
  padding-block: 22px;
  border-block: 1px solid var(--line);
}
.tape-track { display: flex; gap: 56px; width: max-content; animation: tape 38s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-track span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .25s var(--ease);
}
.tape-track span:hover { color: var(--accent-ink); }
@keyframes tape { to { transform: translateX(-50%); } }

/* 16. CHECKLIST (shared "what's included" list) -------------------------- */
.checks { list-style: none; margin: 24px 0; padding: 0; }
.checks li {
  display: flex;
  gap: 10px;
  padding-block: 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.checks li:last-child { border-bottom: 0; }
.checks b { color: var(--paper); font-weight: 560; }
.checks svg { flex: none; margin-top: 4px; color: var(--accent-ink); }

/* 17. FAQ --------------------------------------------------------------- */
.faq { border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 22px 0;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -.02em;
  cursor: pointer;
  transition: color .2s var(--ease);
}
.qa-q:hover { color: var(--accent-ink); }
.qa-i { position: relative; flex: none; width: 12px; height: 12px; }
.qa-i::before, .qa-i::after {
  content: ""; position: absolute; top: 50%; left: 0;
  width: 12px; height: 1.5px; background: currentColor;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.qa-i::after { transform: rotate(90deg); }
.qa-q[aria-expanded="true"] .qa-i::after { transform: rotate(0); opacity: 0; }
.qa-a { overflow: hidden; max-height: 0; transition: max-height .4s var(--ease); }
.qa-a p { color: var(--muted); font-size: 14px; max-width: 74ch; padding-bottom: 24px; }

/* 18. CALLOUT ----------------------------------------------------------- */
.callout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(24px, 3vw, 40px);
  padding: clamp(28px, 3.5vw, 48px);
  background: var(--accent);
  color: var(--on-accent);
}
.callout h2 { color: var(--on-accent); max-width: 22ch; }
.callout p { color: color-mix(in srgb, var(--on-accent) 72%, transparent); max-width: 52ch; margin-top: 14px; }
.callout .action { --action-bg: var(--on-accent); --action-fg: var(--accent); }
.callout .kicker { color: color-mix(in srgb, var(--on-accent) 76%, transparent); margin-bottom: 14px; }

/* 19. FORMS ------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .req { color: var(--accent-ink); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--raised);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-size: 15px;
  transition: box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 132px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.field select { appearance: none; cursor: pointer; }
.field select option { background: var(--raised); color: var(--paper); }
.field-err { color: var(--error); font-family: var(--font-mono); font-size: var(--min-mono); letter-spacing: .06em; margin: 0; }
.field.invalid input, .field.invalid select, .field.invalid textarea { box-shadow: inset 0 0 0 1px var(--error); }

.checkgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.checkgrid label {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  background: var(--raised);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s var(--ease);
}
.checkgrid label:hover { color: var(--paper); }
.checkgrid input { accent-color: var(--accent-ink); width: 14px; height: 14px; cursor: pointer; }

.form-note { color: var(--muted); font-family: var(--font-mono); font-size: var(--min-mono); letter-spacing: .06em; }
.form-success { padding: 30px 26px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--accent); }
.form-success p { color: var(--muted); font-size: 14px; margin-top: 8px; }

.contact-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}
.contact-row:first-of-type { border-top: 1px solid var(--line); }
.contact-row dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.contact-row dd { margin: 0; font-size: 14.5px; }
.contact-row a:hover { color: var(--accent-ink); }

/* 20. FOOTER ------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 72px) 28px; margin-top: clamp(56px, 7vw, 96px); }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(3, 1fr); gap: 40px; padding-bottom: 44px; }
.footer-about p { color: var(--muted); font-size: 13.5px; max-width: 34ch; margin-top: 16px; }
.footer h4 {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { display: inline-block; color: var(--muted); font-size: 13.5px; transition: color .2s var(--ease), transform .2s var(--ease); }
.footer ul a:hover { color: var(--accent-ink); transform: translateX(3px); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.socials { display: flex; gap: 8px; }
.socials a {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  transition: all .2s var(--ease);
}
.socials a:hover { color: var(--on-accent); background: var(--accent); box-shadow: none; }

.totop {
  position: fixed; right: 20px; bottom: 20px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .3s var(--ease);
  z-index: 90;
}
.totop.show { opacity: 1; visibility: visible; transform: none; }

/* 21. REVEALS ----------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@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 .reveal { opacity: 1 !important; transform: none !important; }
  /* The drawer's per-item stagger uses transition-delay, which the blanket
     duration override above doesn't touch — without this, links sit at
     opacity:0 for up to 240ms after opening, reading as broken rather than
     motion off (same failure mode called out for the diagrams below). */
  .drawer.open li {
    transition-delay: 0ms !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 22. RESPONSIVE -------------------------------------------------------- */
@media (max-width: 1080px) {
  .atlas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-heading { grid-template-columns: 1fr; }
  .section-heading > .section-index,
  .section-heading > h2,
  .section-heading > .section-title,
  .section-heading-action { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .burger { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { margin-top: -80px; max-width: none; }
  .callout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .atlas, .tiles { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .checkgrid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .contact-row { grid-template-columns: 1fr; gap: 6px; }
  .hero-field { min-height: 340px; }
  .action-row .action { width: 100%; }
}

/* 23. UTILITIES (used by interior pages) -------------------------------- */
.cols2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.prose p { color: var(--muted); font-size: 15px; line-height: 1.65; margin-bottom: 1.1em; }
.prose p:last-child { margin-bottom: 0; }

.taglist { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.taglist li {
  padding: 7px 13px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1px;
  background: var(--line);
}
.featured-grid > div { background: var(--raised); padding: clamp(24px, 3vw, 40px); }
.featured-grid .stats { background: var(--line); grid-template-columns: repeat(2, 1fr); }
.featured-grid .stat { background: var(--raised); }

@media (max-width: 860px) {
  .cols2, .featured-grid { grid-template-columns: 1fr; }
}

/* 24. LIGHT MODE -------------------------------------------------------- */
/* Ported from motion.dev's [data-mode=light] block, adapted so the brand
   blue survives on white. Feature colours are darkened for
   contrast on light surfaces; the accent splits into a bright fill
   (--accent) and a readable text tone (--accent-ink). */
[data-mode="light"] {
  --lab-ink: #f8f8f6;          /* page background  */
  --lab-ink-raised: #ffffff;   /* cards / panels   */
  --lab-line: #e0e0de;         /* hairlines        */
  --lab-muted: #6e6a64;        /* secondary text   */
  --lab-paper: #1a1a1c;        /* body text        */

  --accent: #004aad;           /* fills: hero field, buttons, callout */
  --on-accent: #ffffff;        /* text on those fills */
  --accent-ink: #003b8a;       /* accent as text — 9.9:1 on white */

  --feat-blue: #0b4fa8;
  --feat-teal: #0a7a5f;
  --feat-sky: #0870b0;
  --feat-ice: #1f5f98;
  --feat-indigo: #3d42c0;
  --feat-cyan: #0a7d94;

  --error: #c02a22;
}
[data-mode="light"] .nav-inner { box-shadow: inset 0 0 0 1px var(--line), 0 1px 14px rgba(0,0,0,.06); }
[data-mode="light"] .cell-stage,
[data-mode="light"] .tile-media { background-color: #fcfcfb; }

/* theme toggle */
.theme-toggle {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.theme-toggle:hover { color: var(--paper); background: var(--raised); }
.theme-toggle .icon-sun { display: none; }
[data-mode="light"] .theme-toggle .icon-sun { display: block; }
[data-mode="light"] .theme-toggle .icon-moon { display: none; }

/* 25. MOBILE OPTIMISATION ------------------------------------------------
   Driven by measurements at 390x844: the nav CTA wrapped to two lines and
   squeezed the toggle/burger to 28x34, and most inline links were ~20px
   tall against a 44px recommended minimum. */

/* no grey flash on tap */
a, button, .chip, label { -webkit-tap-highlight-color: transparent; }

/* honour notches / rounded corners (needs viewport-fit=cover) */
@supports (padding: max(0px, env(safe-area-inset-left))) {
  .wrap {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  .totop {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }
  .footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}

@media (max-width: 860px) {
  /* The nav CTA is the thing breaking the bar — it lives in the drawer now. */
  .nav-actions > .action { display: none; }
  .drawer-cta { padding: 0 18px 18px; }
  .drawer .action { display: flex; width: 100%; margin: 4px 0 0; }

  .brand { white-space: nowrap; }
  .brand span { font-size: 15px; }
  .nav-inner { padding-inline: 14px; gap: 12px; }

  /* 44px minimum touch targets */
  .theme-toggle, .burger { width: 44px; height: 44px; flex: none; }
  .action { min-height: 46px; padding: 13px 20px; }
  .chip { min-height: 44px; padding: 12px 18px; }
  .totop { width: 46px; height: 46px; }
  .socials a { width: 42px; height: 42px; }
  .qa-q { padding-block: 20px; }

  /* inline links were ~20px tall — give them a real hit area */
  .hero-readout a,
  .footer ul a,
  .contact-row a,
  .nav-links a { display: inline-block; padding-block: 12px; }
  .footer ul { gap: 2px; }

}

@media (max-width: 620px) {
  /* 11px mono labels are too small to read on a phone */
  :root { --min-mono: 12px; }

  /* iOS Safari zooms the whole page when a focused input is under 16px */
  .field input, .field select, .field textarea { font-size: 16px; }

  h1 { font-size: 34px; }
  .section { padding-block: 52px; }
  .section-heading { margin-bottom: 32px; }

  .hero-field { min-height: 300px; }
  .hero-panel {
    margin-top: -56px;
    margin-inline: 14px;
    padding: 22px 18px;
    max-width: calc(100% - 28px);
    gap: 20px;
  }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hero-readout { gap: 4px 12px; padding-top: 14px; }

  .cell-stage { height: 150px; }
  .cell-content, .tile-body, .panel { padding: 18px; }
  .callout { padding: 28px 20px; }
  .callout .action { width: 100%; }
  .row { padding-block: 22px; }
  .stat { padding: 22px 18px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 18px; }
  .page-header { padding-top: calc(var(--nav-height) + 34px); }
}

/* Landscape phones: the hero field would eat the whole screen */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-field { min-height: 260px; }
  .hero-panel { margin-top: -40px; }
}

/* Remaining short touch targets found by measurement at 390px.
   (.cell h3 a measures ~20px but its real hit area is the whole cell via
   the stretched ::after, so it is deliberately left alone.) */
.skip { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 860px) {
  .brand { min-height: 44px; align-items: center; }
  .hero-readout a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0;
    padding-inline: 2px;
  }
  .hero-readout { gap: 0 16px; }
}

/* 26. MOTION — keyframes copied verbatim from motion.dev ------------------
   Names and curves are theirs (home-RWNfzuve.css / index-CSVgC-MC.css). */
@keyframes home-diag-translate {
  0%, 12%  { transform: translate(0) rotate(0) scale(1); }
  34%, 44% { transform: translate(120px) rotate(15deg) scale(1); }
  54%      { transform: translate(120px) rotate(15deg) scale(1.75); }
  64%      { transform: translate(120px) rotate(15deg) scale(1); }
  to       { transform: translate(0) rotate(0) scale(1); }
}
@keyframes home-diag-bar-fill {
  0%       { transform: scaleX(0); }
  45%      { transform: scaleX(1); }
  90%, to  { transform: scaleX(0); }
}
@keyframes home-diag-row {
  0%, 30%  { transform: translate(0); opacity: 1; }
  55%, 70% { transform: translate(-12%); opacity: 0; }
  85%, to  { transform: translate(0); opacity: 1; }
}
@keyframes home-showcase-pulse { 0% { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fade-in  { 0% { opacity: 0; } }
@keyframes slide-up { 0% { opacity: 0; transform: translateY(8px); } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes console-sweep { 0% { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* motion.dev's transform diagram, to its exact geometry */
.diag--transform { --tile-size: 44px; }
.diag--transform .diag-axis-x { left: 0; right: 0; top: 50%; height: 1px; }
.diag--transform .diag-axis-y { top: 0; bottom: 0; left: 50%; width: 1px; }
.diag--transform .diag-ghost,
.diag--transform .diag-tile {
  top: calc(50% - var(--tile-size) / 2);
  left: 6.25%;
  width: var(--tile-size);
  height: var(--tile-size);
  margin: 0;
}
.diag--transform .diag-ghost {
  background: none;
  box-shadow: none;
  border: 1px dashed color-mix(in srgb, var(--paper) 22%, transparent);
}
.diag--transform .diag-tile {
  background: var(--feat);
  animation: home-diag-translate 3.6s cubic-bezier(.6, 0, .2, 1) infinite;
  will-change: transform;
}

/* horizontal scaleX bars, as motion.dev draws them */
.diag-bars {
  position: absolute;
  inset: 22% 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
}
.diag-bar {
  position: relative;
  display: block;
  width: 100%;
  height: 16px;
  flex: none;
  background: color-mix(in srgb, var(--paper) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 12%, transparent);
  overflow: hidden;
}
.diag-bars .diag-bar i {
  position: absolute;
  inset: 0;
  display: block;
  height: auto;
  background: var(--feat);
  transform-origin: 0% 50%;
  transform: scaleX(0);
  animation: home-diag-bar-fill 2.4s cubic-bezier(.4, 0, .4, 1) infinite;
  will-change: transform;
}
.diag-bar:nth-child(2) i { animation-delay: .18s; }
.diag-bar:nth-child(3) i { animation-delay: .36s; }
.diag-bar:nth-child(4) i { animation-delay: .54s; }
.diag-bar:nth-child(5) i { animation-delay: .72s; }

.diag-row span {
  animation: home-diag-row 3s cubic-bezier(.4, 0, .2, 1) infinite;
  will-change: transform;
}
.diag-row span:nth-child(2) { animation-delay: .12s; }
.diag-row span:nth-child(3) { animation-delay: .24s; }

/* motion.dev pauses its diagrams when the block leaves the viewport */
[data-inview="false"] .diag-tile,
[data-inview="false"] .diag-bar i,
[data-inview="false"] .diag-row span,
[data-inview="false"] .diag-ball,
[data-inview="false"] .diag-grid span,
[data-inview="false"] .diag-track i,
[data-inview="false"] .diag-target,
[data-inview="false"] .diag-cursor,
[data-inview="false"] .shot-media::before { animation-play-state: paused; }

/* 27. SHOWCASE — tape of self-animating artwork -------------------------- */
/* Horizontal scroller. The track is padded by the page gutter so the first
   and last cards line up with the grid and can never be clipped — the old
   scroll-linked version had no inset, which is what cut the first card off. */
.showcase {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 4px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;              /* Firefox */
}
.showcase::-webkit-scrollbar { display: none; }
.showcase:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.showcase.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.showcase.is-dragging .shot { pointer-events: none; }
.showcase-track {
  display: flex;
  gap: var(--gap);
  width: max-content;
  padding-inline: var(--gutter);
}

/* prev / next */
.rail-nav { display: flex; gap: 8px; }
.rail-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--paper);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), opacity .2s var(--ease);
}
.rail-btn:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.rail-btn:disabled { opacity: .3; cursor: default; }
.shot {
  position: relative;
  scroll-snap-align: start;
  flex: 0 0 clamp(230px, 28vw, 330px);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.shot-media { position: relative; display: block; }
.shot-media img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shot-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%,
    color-mix(in srgb, var(--paper) 9%, transparent) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: home-showcase-pulse 2.8s linear infinite;
}
.shot-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.shot-cap b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.shot-cap span {
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* clip-path sweep on section titles (motion.dev's docs-console-sweep) */
.js .sweep.in { animation: console-sweep .85s cubic-bezier(.6, 0, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  .shot-media::before { animation: none; opacity: 0; }
  .js .sweep.in { animation: none; }
}


/* carousel: touch targets and comfortable card width on phones */
@media (max-width: 620px) {
  .shot { flex-basis: 78vw; }
  .rail-btn { width: 44px; height: 44px; }
}

/* 28. FOUR MORE DIAGRAMS (atlas 8 -> 12) ---------------------------------
   Built on motion.dev's own curves so they sit in the same family as the
   keyframes copied in section 26. */
.cell--i { --feat: var(--feat-indigo); }
.cell--j { --feat: var(--feat-sky); }
.cell--k { --feat: var(--feat-teal); }
.cell--l { --feat: var(--feat-cyan); }

/* 09 — agent graph: a hub beating, nodes firing in turn */
.diag--nodes .diag-hub,
.diag--nodes .diag-node {
  position: absolute;
  border-radius: 50%;
  background: var(--feat);
}
.diag--nodes .diag-hub {
  width: 34px; height: 34px;
  top: 50%; left: 50%; margin: -17px 0 0 -17px;
  animation: d-beat 2.2s ease-in-out infinite;
}
@keyframes d-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.diag--nodes .diag-node {
  width: 16px; height: 16px;
  animation: d-fire 3.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
.diag--nodes .diag-node:nth-of-type(2) { top: 22%; left: 20%; }
.diag--nodes .diag-node:nth-of-type(3) { top: 22%; right: 20%; animation-delay: .45s; }
.diag--nodes .diag-node:nth-of-type(4) { bottom: 22%; left: 20%; animation-delay: .9s; }
.diag--nodes .diag-node:nth-of-type(5) { bottom: 22%; right: 20%; animation-delay: 1.35s; }
@keyframes d-fire {
  0%, 100% { opacity: .3; transform: scale(.85); }
  25%, 45% { opacity: 1;  transform: scale(1); }
}

/* 10 — chat: bubbles arriving in sequence */
.diag--chat { padding: 16% 14%; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.diag--chat span {
  display: block;
  height: 18px;
  border-radius: 9px;
  background: var(--feat);
  transform-origin: 0 50%;
  animation: d-bubble 3.4s cubic-bezier(.4, 0, .2, 1) infinite;
}
.diag--chat span:nth-child(1) { width: 62%; }
.diag--chat span:nth-child(2) { width: 44%; align-self: flex-end; transform-origin: 100% 50%; opacity: .6; animation-delay: .35s; }
.diag--chat span:nth-child(3) { width: 72%; animation-delay: .7s; }
.diag--chat span:nth-child(4) { width: 30%; align-self: flex-end; transform-origin: 100% 50%; opacity: .6; animation-delay: 1.05s; }
@keyframes d-bubble {
  0%, 6%    { transform: scaleX(0); opacity: 0; }
  22%, 74%  { transform: scaleX(1); }
  90%, 100% { transform: scaleX(0); opacity: 0; }
}

/* 11 — pipeline: a token advancing through stages */
.diag--flow { display: flex; align-items: center; justify-content: center; gap: 0; }
.diag--flow .diag-step {
  width: 15%;
  height: 30px;
  background: color-mix(in srgb, var(--paper) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
}
.diag--flow .diag-link { width: 8%; height: 1px; background: color-mix(in srgb, var(--paper) 20%, transparent); }
.diag--flow .diag-token {
  position: absolute;
  top: 50%; left: 14%;
  width: 18px; height: 18px;
  margin-top: -9px;
  background: var(--feat);
  animation: d-flow 4s cubic-bezier(.6, 0, .2, 1) infinite;
}
@keyframes d-flow {
  0%, 10%  { transform: translateX(0); }
  30%, 40% { transform: translateX(69px); }
  60%, 70% { transform: translateX(138px); }
  90%,100% { transform: translateX(0); }
}

/* 12 — listing pin dropping, with a confirming ring */
.diag--pin .diag-pinmark {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  margin: -30px 0 0 -13px;
  background: var(--feat);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  animation: d-drop 3s cubic-bezier(.4, 0, .4, 1) infinite;
}
@keyframes d-drop {
  0%, 8%    { transform: rotate(-45deg) translate(0, -46px); opacity: 0; }
  32%, 76%  { transform: rotate(-45deg) translate(0, 0); opacity: 1; }
  96%, 100% { transform: rotate(-45deg) translate(0, -46px); opacity: 0; }
}
.diag--pin .diag-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 54px; height: 54px;
  margin: -6px 0 0 -27px;
  border: 1px solid var(--feat);
  border-radius: 50%;
  animation: d-ring 3s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes d-ring {
  0%, 30%   { transform: scale(.3); opacity: 0; }
  46%       { opacity: .9; }
  80%, 100% { transform: scale(1.5); opacity: 0; }
}

/* keep the new ones in motion.dev's offscreen-pause behaviour */
[data-inview="false"] .diag-hub,
[data-inview="false"] .diag-node,
[data-inview="false"] .diag--chat span,
[data-inview="false"] .diag-token,
[data-inview="false"] .diag-pinmark,
[data-inview="false"] .diag-ring { animation-play-state: paused; }

/* JS hooks only — styling comes from .rail-btn. Declared so the class audit
   sees them and nobody deletes them thinking they are unused. */
.showcase-prev, .showcase-next { /* behaviour bound in main.js */ }

/* 29. BLOG ---------------------------------------------------------------
   Index cards reuse .tiles/.tile; these are the article-specific pieces. */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}
.post {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 26px;
  background: var(--raised);
  transition: background .3s var(--ease);
}
.post:hover { background: color-mix(in oklch, var(--paper) 4%, var(--raised)); }

/* Card artwork. The SVGs are dark-grounded by design, so they read as a solid
   plate at the top of the card in both themes rather than something to tint.
   Negative margins pull it out to the card edge against .post's padding. */
.post-thumb {
  display: block;
  width: calc(100% + 44px);
  margin: -24px -22px 18px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--ink);
}

/* First card on page one, promoted. Spans the grid and lays out side-by-side so
   the artwork earns its extra size instead of just being taller. */
.post.is-featured { grid-column: 1 / -1; }
@media (min-width: 861px) {
  .post.is-featured {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    column-gap: 30px;
    padding: 0 30px 0 0;
  }
  .post.is-featured .post-thumb {
    width: 100%;
    margin: 0;
    height: 100%;
    aspect-ratio: auto;
    min-height: 260px;
  }
  .post.is-featured .post-meta { margin-top: 30px; }
  .post.is-featured h3 { font-size: clamp(20px, 2.4vw, 28px); }
  .post.is-featured .post-more { margin-bottom: 30px; }
}

/* Pagination. Hidden entirely without JS, which leaves every post on the page -
   the right fallback for a blog index. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}
.pager button {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  background: var(--raised);
  color: var(--paper);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.pager button:hover:not(:disabled) { background: color-mix(in oklch, var(--paper) 8%, var(--raised)); }
.pager button[aria-current="true"] {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
  font-weight: 600;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-meta .cat { color: var(--accent-ink); }
.post h3 { margin-bottom: 10px; }
.post h3 a { color: inherit; }
.post p { color: var(--muted); font-size: 13.5px; margin: 0; }
.post-more {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* article page */
.article { max-width: 72ch; margin-inline: auto; }

/* Article pages with a reading sidebar. Scoped to a modifier because .article
   is also used by cookies/privacy/terms, which must keep the 72ch measure. */
.article--with-aside { max-width: 1060px; }
.article-layout { display: block; }
.article-main { min-width: 0; }

@media (min-width: 1024px) {
  .article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    column-gap: 46px;
  }
  .article-main { max-width: 72ch; }
  .article-aside {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .06em;
  color: var(--muted);
}
.article-byline > span + span::before { content: "·"; margin-right: 10px; color: var(--line); }
.article-author { color: var(--paper); }

/* --- Summarise with AI ------------------------------------------------- */
.ai-summary {
  padding: 18px;
  margin-bottom: 22px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ai-summary-h {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  border: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.ai-btn:hover { opacity: .82; transform: translateY(-1px); }

/* --- Table of contents -------------------------------------------------- */
.toc {
  padding: 18px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
}
.toc-h {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; }
.toc-list a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 55%, transparent);
  transition: color .2s var(--ease);
}
.toc-list li:last-child a { border-bottom: 0; }
.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--line);
}
.toc-list a:hover { color: var(--paper); }
.toc-list a[aria-current="true"] { color: var(--paper); }
.toc-list a[aria-current="true"]::before { color: var(--accent-ink); }
/* Sub-headings sit under their parent section rather than reading as peers. */
.toc-list .toc-sub a { padding-left: 36px; grid-template-columns: minmax(0, 1fr); font-size: 12.5px; }
.toc-list .toc-sub a::before { content: none; }

@media (max-width: 1023px) {
  /* A sticky rail on a phone is just something in the way: the AI card sits
     inline above the body, and the contents collapse into a disclosure. */
  .article-aside { margin: 0 0 30px; }
  .toc { padding: 0; background: none; box-shadow: none; }
  .toc-h {
    margin: 0;
    padding: 14px 18px;
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--line);
    cursor: pointer;
  }
  .toc[data-collapsed="true"] .toc-list { display: none; }
  .toc-list { padding: 4px 18px; box-shadow: inset 0 0 0 1px var(--line); border-top: 0; }
  .ai-btns { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .ai-btns { grid-template-columns: 1fr 1fr; }
}
.article-head { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 18px; }
.article-tldr {
  padding: 20px 22px;
  margin-bottom: 34px;
  background: var(--raised);
  border-left: 3px solid var(--accent);
}
.article-tldr b {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  font-weight: 560;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.article-tldr p { margin: 0; color: var(--paper); font-size: 15px; line-height: 1.6; }

.article-body { font-size: 16.5px; line-height: 1.75; }
.article-body p { margin: 0 0 1.2em; color: var(--muted); }
.article-body h2,
.article-body h3 {
  margin: 2em 0 .7em;
  color: var(--paper);
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -.022em;
  line-height: 1.25;
}
.article-body h2 { font-size: 25px; }
.article-body ul, .article-body ol { margin: 0 0 1.3em; padding-left: 1.15em; color: var(--muted); }
.article-body li { margin-bottom: .55em; }
.article-body strong, .article-body b { color: var(--paper); font-weight: 600; }
.article-body a { color: var(--accent-ink); border-bottom: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.article-body a:hover { color: var(--paper); border-bottom-color: var(--paper); }
.article-body blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  color: var(--paper);
  font-size: 17px;
}
.article-body code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: 2px 6px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
}
.article-foot {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.crumbs {
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span { opacity: .5; margin: 0 6px; }

@media (max-width: 1080px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .post-grid { grid-template-columns: 1fr; }
  .article-body { font-size: 16px; }
  .post { padding: 20px 18px 22px; }
}

/* Filter cards also carry .reveal, whose `transition: opacity .6s` re-animates
   every frame anime.js writes — the two fight and the filter crawls. Suppress
   transitions on the grid while a filter is mid-flight. */
.is-filtering [data-cat] { transition: none !important; }

/* 30. GOOGLE REVIEW BADGE + MAP ------------------------------------------
   Real, verifiable figures from the Google Business Profile (4.9 / 75). */
.gbadge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--paper);
  transition: box-shadow .2s var(--ease), background .2s var(--ease);
}
a.gbadge:hover { background: color-mix(in oklch, var(--paper) 5%, var(--raised)); box-shadow: inset 0 0 0 1px var(--border-strong, var(--line)); }
.gbadge-score {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--paper);
}
.gbadge-stars { display: inline-flex; gap: 2px; color: #f5b301; flex: none; }
.gbadge-stars svg { display: block; }
.gbadge-txt {
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
[data-mode="dark"] .map-embed iframe { filter: invert(.92) hue-rotate(180deg) saturate(.7); }

@media (max-width: 620px) {
  .gbadge { width: 100%; justify-content: flex-start; }
  .map-embed { aspect-ratio: 4 / 3; }
}

/* consent-gated Cal.com booking embed. Shares .embed-block with the map but
   deliberately not .map-embed: that class carries a dark-mode invert filter
   that would wreck Cal's own theming, and a 16/10 box far too short for a
   month view. Height is fixed rather than aspect-ratio for the same reason. */
.booking-embed {
  position: relative;
  width: 100%;
  min-height: 700px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.booking-embed iframe { width: 100%; height: 700px; border: 0; display: block; }

.booking-steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.booking-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 40px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.booking-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.booking-steps li b { color: var(--paper); font-weight: 600; }

@media (max-width: 620px) {
  .booking-embed { min-height: 640px; }
  .booking-embed iframe { height: 640px; }
}

/* 31. AMHARIC ------------------------------------------------------------
   TASA Orbiter has no Ethiopic glyphs — without this every Amharic character
   renders as a tofu box. Noto Sans Ethiopic leads, Latin faces follow for any
   English inside Amharic pages. */
[lang="am"],
[lang="am"] h1, [lang="am"] h2, [lang="am"] h3, [lang="am"] h4 {
  font-family: "Noto Sans Ethiopic", "TASA Orbiter", system-ui, sans-serif;
}
[lang="am"] h1, [lang="am"] h2 { letter-spacing: -.01em; line-height: 1.18; }
[lang="am"] h3 { line-height: 1.35; }
[lang="am"] .lede, [lang="am"] p { line-height: 1.75; }
/* Ethiopic has no case, so uppercase transforms do nothing but add tracking */
[lang="am"] .kicker, [lang="am"] .section-index, [lang="am"] .cell-num,
[lang="am"] .contact-row dt, [lang="am"] .footer h4, [lang="am"] .gbadge-txt,
[lang="am"] .nav-links a, [lang="am"] .action, [lang="am"] .drawer a {
  text-transform: none;
  letter-spacing: .02em;
}
[lang="am"] .action-content { font-family: "Noto Sans Ethiopic", sans-serif; font-size: 13px; }
[lang="am"] [lang="en"] { font-family: var(--font-sans); }
[lang="am"] [lang="en"].action-content { font-family: var(--font-mono); }

/* 32. LANGUAGE SWITCH ----------------------------------------------------
   Segmented EN | አማ so both options are visible and the current one is
   obvious. Sized as a real touch target on every breakpoint. */
.lang {
  display: inline-flex;
  flex: none;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.lang-opt {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 38px;
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 560;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.lang-opt + .lang-opt { box-shadow: inset 1px 0 0 var(--line); }
.lang-opt:hover { color: var(--paper); background: var(--raised); }
/* Selected state is neutral, not accent: the blue CTA sits right beside it
   and two accent blocks compete. Same treatment as a default .action. */
.lang-opt[aria-current="true"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.lang-opt[aria-current="true"]:hover { background: var(--paper); color: var(--ink); }
.lang-opt[lang="am"] { font-family: "Noto Sans Ethiopic", var(--font-mono); font-size: 12.5px; }

/* drawer copy sits full width */
.drawer .lang { width: 100%; margin: 14px 0 2px; }
.drawer .lang-opt { flex: 1; height: 46px; }

@media (max-width: 860px) {
  .lang-opt { height: 44px; min-width: 44px; padding: 0 9px; }
}
@media (max-width: 420px) {
  /* 44px minimum kept; the row is tightened elsewhere to make it fit at 360px */
  .lang-opt { min-width: 44px; padding: 0 5px; font-size: 11.5px; }
  .nav-inner { gap: 7px; padding-inline: 9px; }
  .brand span { font-size: 14px; }
}

/* 33. COOKIE CONSENT ------------------------------------------------------ */
.consent {
  position: fixed;
  z-index: 200;
  left: 0; right: 0; bottom: 0;
  padding: 20px var(--gutter) max(20px, env(safe-area-inset-bottom));
  background: var(--raised);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .28);
}
.consent-inner {
  max-width: var(--grid-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 32px;
  align-items: center;
}
.consent h2 { font-size: 17px; font-weight: 620; letter-spacing: -.015em; margin-bottom: 6px; }
.consent p { color: var(--muted); font-size: 13.5px; max-width: 68ch; margin: 0; }
.consent a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-self: end; }
.consent-actions .action { min-height: 42px; }

.consent-prefs {
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
  margin-top: 4px;
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}
.consent-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--raised);
}
.consent-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.consent-row b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.consent-row span { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.consent-row input:disabled { opacity: .55; }

/* placeholder shown in place of a consent-gated embed */
.embed-block {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--raised);
}
.embed-block p {
  color: var(--muted);
  font-size: 13px;
  max-width: 40ch;
  margin: 0;
}

@media (max-width: 860px) {
  /* Measured at 709px of an 844px screen before this: the banner was eating
     the whole viewport. Compact type, buttons on one row, and a scroll cap. */
  .consent { padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom)); }
  .consent-inner { grid-template-columns: 1fr; gap: 12px; }
  .consent h2 { font-size: 15px; margin-bottom: 4px; }
  .consent p { font-size: 12.5px; line-height: 1.5; }
  .consent-actions { justify-self: stretch; gap: 6px; }
  .consent-actions .action {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    padding-inline: 8px;
    font-size: 11px;
  }
  .consent-prefs { max-height: 42vh; overflow-y: auto; }
  .consent-row { padding: 11px 13px; }
  .consent-row b { font-size: 12.5px; }
  .consent-row span { font-size: 11.5px; }
}

/* footer legal row */
.legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.legal-links a, .linkish {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--min-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  transition: color .2s var(--ease);
}
.legal-links a:hover, .linkish:hover { color: var(--accent-ink); }

/* 34. REDUCED MOTION — composed still states -----------------------------
   The blanket rule in section 21 sets animation-duration to ~0, which parks
   every diagram at keyframe 0: a tile sitting off to one side, an empty
   pipeline, blank bars. It reads as broken rather than as "motion off".
   iOS Reduce Motion (Settings > Accessibility > Motion) triggers this, so a
   real phone can land here.

   Motion still genuinely stops. These rules only decide WHERE each diagram
   comes to rest, so it stays a legible diagram. */
@media (prefers-reduced-motion: reduce) {

  /* 01 transform — show the move as finished, ghost marks the origin */
  .diag--transform .diag-tile {
    transform: translate(120px) rotate(15deg) !important;
  }

  /* 03 bars — a readable bar chart rather than five empty tracks */
  .diag-bars .diag-bar i { transform-origin: 0 50%; }
  .diag-bar:nth-child(1) i { transform: scaleX(.34) !important; }
  .diag-bar:nth-child(2) i { transform: scaleX(.62) !important; }
  .diag-bar:nth-child(3) i { transform: scaleX(.45) !important; }
  .diag-bar:nth-child(4) i { transform: scaleX(.86) !important; }
  .diag-bar:nth-child(5) i { transform: scaleX(.7)  !important; }

  /* 02 row, 06 presence grid — settled and fully visible */
  .diag-row span { transform: none !important; opacity: 1 !important; }
  .diag-grid span { opacity: 1 !important; transform: none !important; }
  .diag-row span:nth-child(2) { opacity: .62 !important; }
  .diag-row span:nth-child(3) { opacity: .32 !important; }

  /* 05 paid — cursor resting on the target */
  .diag-target { transform: scale(1) !important; }
  .diag-cursor { transform: translate(6px, 6px) !important; }

  /* 07 social — ball at rest on the floor, not mid-air */
  .diag-ball { transform: translateY(58px) !important; }

  /* 11 timeline — staged progress */
  .diag-track:nth-of-type(1) i { transform: scaleX(1)  !important; }
  .diag-track:nth-of-type(2) i { transform: scaleX(.68) !important; }
  .diag-track:nth-of-type(3) i { transform: scaleX(.35) !important; }

  /* 09 agent graph — all nodes lit */
  .diag--nodes .diag-hub { transform: scale(1) !important; }
  .diag--nodes .diag-node { opacity: 1 !important; transform: scale(1) !important; }

  /* 10 chat — conversation complete */
  .diag--chat span { transform: scaleX(1) !important; opacity: 1 !important; }
  .diag--chat span:nth-child(2),
  .diag--chat span:nth-child(4) { opacity: .6 !important; }

  /* 11 flow — token part-way through the pipeline */
  .diag--flow .diag-token { transform: translateX(69px) !important; }

  /* 12 listings — pin landed, ring gone */
  .diag--pin .diag-pinmark { transform: rotate(-45deg) translate(0, 0) !important; opacity: 1 !important; }
  .diag--pin .diag-ring { opacity: 0 !important; }

  /* showcase shimmer would sit as a hard band across the artwork */
  .shot-media::before { opacity: 0 !important; }
}

/* 35. AI GALLERY (real AI-generated work samples) ------------------------ */
.ai-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}
.ai-card { background: var(--raised); }
.ai-card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--line);
}
.ai-card-media img,
.ai-card-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ai-card-cap { padding: 12px 14px; }
.ai-card-cap b { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.ai-card-cap span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 4px;
}
