/* Nabra · final visual design presentation.
   Built only on the Nabra tokens (design/system/tokens.css). Logical properties only. */

:root {
  --page-max: 1240px;
  --rail-w: 208px;
  --top-h: 60px;
  --gutter: clamp(16px, 4vw, 40px);
  --font-body: var(--font-sans);
  --font-display: var(--font-latin);
  --grain: radial-gradient(circle, rgba(250, 248, 244, 0.09) 1px, transparent 1.6px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-block-start: calc(var(--top-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--font-body);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-latin); font-size: 0.86em; font-weight: 600; background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 1px 6px; }
b { font-weight: 600; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
[lang="ar"] { font-family: var(--font-sans); line-height: 1.75; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; inset-inline-start: 16px; inset-block-start: -80px; z-index: 50; padding: 10px 16px; background: var(--teal); color: var(--on-teal); border-radius: var(--radius-md); font-weight: 600; }
.skip:focus { inset-block-start: 12px; }

/* ------------------------------------------------------------ top bar */
.top {
  position: sticky; inset-block-start: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--top-h); padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-block-end: 1px solid var(--line);
}
.brand { display: flex; align-items: center; border-radius: var(--radius-sm); }
.logo { width: 112px; height: auto; }
.logo-dark, .logo-mark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.view { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.view button, .motion-toggle {
  font: 600 14px/1 var(--font-body); color: var(--ink-2); background: transparent;
  border: 0; border-radius: var(--radius-pill); min-height: 36px; padding-inline: 14px; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.view button:hover { color: var(--ink); }
.view button[aria-pressed="true"] { background: var(--teal); color: var(--on-teal); box-shadow: var(--glow-key); }
.motion-toggle { border: 1px solid var(--line); background: var(--surface); }
.motion-toggle[aria-pressed="true"] { color: var(--ink); border-color: var(--line-control); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding-inline: 20px; border-radius: var(--radius-md);
  font: 600 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-control); background: var(--surface); color: var(--ink);
  transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-instant) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-key { background: var(--gradient-primary); color: var(--on-teal); border-color: transparent; }
.btn-key:hover { box-shadow: var(--glow-key); border-color: transparent; }
.btn-key:active { box-shadow: none; background: var(--teal-hover); }
.btn-quiet { background: transparent; }
.btn-small { min-height: 36px; padding-inline: 14px; font-size: 14px; }

/* ------------------------------------------------------------ hero: the dusk */
.hero {
  --hero-glow: radial-gradient(38% 62% at 84% 26%, color-mix(in srgb, var(--amber) 34%, transparent), transparent 70%);
  position: relative; isolation: isolate;
  color: var(--on-dusk);
  background: var(--grain) 0 0 / 14px 14px, var(--hero-glow), var(--gradient-dusk);
  padding-block: clamp(48px, 9vw, 120px) clamp(120px, 16vw, 230px);
  padding-inline: var(--gutter);
  overflow: hidden;
}
.hero-inner { max-width: var(--page-max); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero-by { font: 600 15px/1.4 var(--font-body); color: var(--on-dusk-2); margin-block-end: 20px; }
.hero h1 { display: flex; flex-direction: column; gap: 4px; }
.h-en { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95; }
.h-ar { font-family: var(--font-sans); font-weight: 700; line-height: 1.3; }
.hero .h-en { font-size: clamp(52px, 10vw, 128px); }
.hero .h-ar { font-size: clamp(40px, 7.4vw, 96px); color: var(--on-dusk-2); text-align: start; }
.lede { max-width: 62ch; margin-block-start: 28px; font-size: clamp(17px, 1.6vw, 20px); color: var(--on-dusk); }
.lede i { font-style: normal; font-weight: 600; }
.screener {
  display: flex; gap: 12px; align-items: flex-start; max-width: 62ch; margin-block-start: 24px;
  padding: 14px 16px; border-radius: var(--radius-md); background: var(--dusk-panel); border: 1px solid var(--dusk-line);
  font-size: 16px; line-height: 1.55;
}
.screener svg { flex: none; width: 20px; height: 20px; margin-block-start: 3px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 32px; }
.hero .btn-key { background: var(--dusk-action); color: var(--on-dusk-action); }
.hero .btn-key:hover { box-shadow: var(--glow-dusk); }
.hero .btn-quiet { color: var(--on-dusk); border-color: var(--dusk-line); }
.hero .btn-quiet:hover { border-color: var(--on-dusk-2); }
.hero :focus-visible { outline-color: var(--on-dusk); }

.hero-mark { width: clamp(150px, 24vw, 330px); height: auto; overflow: visible; }
.hero-mark .bowl-path { stroke: var(--on-dusk); }
.hero-mark .dot { fill: var(--amber); filter: drop-shadow(0 0 10px var(--amber)) drop-shadow(0 0 28px color-mix(in srgb, var(--amber) 70%, transparent)); }
.bowl-edge { position: absolute; inset-inline: 0; inset-block-end: -1px; width: 100%; height: clamp(56px, 10vw, 150px); z-index: -1; }
.bowl-edge path { fill: var(--paper); }

.hero-shot { position: relative; z-index: 2; max-width: 1080px; margin: calc(-1 * clamp(96px, 13vw, 200px)) auto 0; padding-inline: var(--gutter); }
.hero-shot .shot { border-radius: var(--radius-lg); box-shadow: 0 30px 80px -30px rgba(18, 36, 43, 0.55), 0 0 0 1px var(--line); }
.hero-shot figcaption { margin-block-start: 14px; font-size: 14px; color: var(--ink-muted); text-align: center; }

/* The one orchestrated moment: the mark draws, the dot drops, the copy and the screen rise. */
.js .hero-mark .bowl-path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 900ms var(--ease-enter) 200ms forwards; }
.js .hero-mark .dot { opacity: 0; animation: drop var(--duration-slow) var(--ease-enter) 950ms forwards; }
.js .hero-copy > * { opacity: 0; animation: rise var(--duration-slow) var(--ease-enter) forwards; animation-delay: calc(var(--i, 0) * var(--stagger) + 120ms); }
.js .hero-copy > :nth-child(1) { --i: 0; } .js .hero-copy > :nth-child(2) { --i: 1; } .js .hero-copy > :nth-child(3) { --i: 2; }
.js .hero-copy > :nth-child(4) { --i: 3; } .js .hero-copy > :nth-child(5) { --i: 4; }
.js .hero-shot { opacity: 0; animation: rise 600ms var(--ease-enter) 420ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(var(--reveal-distance)); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ shell and rail */
.shell { max-width: calc(var(--page-max) + var(--rail-w) + 48px); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); gap: 48px; }
main { min-width: 0; outline: none; }

.rail { position: sticky; inset-block-start: calc(var(--top-h) + 40px); align-self: start; margin-block-start: 72px; }
.rail ol { list-style: none; margin: 0; padding: 0; position: relative; }
.rail ol::before { content: ""; position: absolute; inset-inline-start: 5px; inset-block: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.rail a {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px;
  color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.3; font-weight: 500;
}
.rail a:hover { color: var(--ink); }
.r-n { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-muted); min-width: 10px; }
.r-dot { position: relative; z-index: 1; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-control); transition: background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard); }
.rail a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.rail a[aria-current="true"] .r-dot { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 20%, transparent), 0 0 16px var(--amber); }
.rail a[aria-current="true"] .r-n { color: var(--teal); }

.howto { max-width: 70ch; margin-block: 56px 0; padding: 16px 20px; border-inline-start: 3px solid var(--teal); background: var(--surface); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 16px; color: var(--ink-2); }
.howto b { color: var(--ink); }

/* ------------------------------------------------------------ chapters */
.chapter { padding-block: clamp(72px, 9vw, 128px) 0; }
.chapter-head { max-width: 900px; margin-block-end: 48px; }
.chapter-head h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.chapter-head .h-en { font-size: clamp(38px, 5.6vw, 72px); }
.chapter-head .h-ar { font-size: clamp(28px, 3.8vw, 48px); color: var(--teal); }
.voice { position: relative; height: 3px; max-width: 240px; margin-block: 20px 24px; border-radius: 3px; background: var(--gradient-voice); transform-origin: left center; }
.voice::after { content: ""; position: absolute; inset-inline-end: -4px; inset-block-start: -3.5px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.js .voice { transform: scaleX(0); transition: transform 700ms var(--ease-enter); }
.js .voice::after { opacity: 0; transition: opacity var(--duration-base) var(--ease-enter) 600ms; }
.js .in .voice { transform: none; }
.js .in .voice::after { opacity: 1; }
.chapter-lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 66ch; }
.chapter-lede i { font-style: normal; font-weight: 600; color: var(--ink); }
.sub { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.015em; margin-block: 56px 20px; }
.small { font-size: 15px; color: var(--ink-2); }

/* ------------------------------------------------------------ research */
.lessons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 40px; }
.lessons li { padding-block: 22px; border-block-start: 1px solid var(--line); }
.lessons h4 { font-size: 19px; line-height: 1.35; font-weight: 700; margin-block-end: 8px; }
.lessons p { font-size: 16px; color: var(--ink-2); }
.lessons .from { margin-block-start: 10px; font-size: 14px; }
.lessons .from a { margin-inline-end: 6px; }

.ref-all { margin-block-start: 40px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.ref-all summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style-position: inside; border-radius: var(--radius-lg); }
.ref-all summary:hover { color: var(--teal); }
.ref-groups { padding: 0 22px 22px; }
.ref-group h4 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-block: 24px 4px; }
.refs { list-style: none; margin: 0; padding: 0; }
.ref { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: 8px 28px; padding-block: 16px; border-block-start: 1px solid var(--line); font-size: 15px; }
.ref-name a { font-weight: 600; }
.ref-name .host { display: block; font-size: 13px; color: var(--ink-muted); }
.rtl-tag { display: inline-block; margin-inline-start: 8px; font: 700 11px/1 var(--font-latin); letter-spacing: 0.04em; padding: 3px 6px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal); vertical-align: 2px; }
.take span, .avoid span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.ref p { color: var(--ink-2); }

/* ------------------------------------------------------------ directions */
.directions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.dir { margin: 0; }
.dir-img { display: block; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-sunken); }
.dir-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.dir-chosen .dir-img { box-shadow: var(--glow-key); border-color: var(--teal); }
.dir h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-block: 16px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dir p { font-size: 15px; color: var(--ink-2); }
.verdict { font: 600 13px/1 var(--font-body); padding: 5px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-control); color: var(--ink-2); letter-spacing: 0; }
.verdict-yes { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.verdict-yes::before { content: "✓ "; }
.takes { margin-block-start: 28px; max-width: 80ch; color: var(--ink-2); }
.takes b { color: var(--ink); }

.parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.part h4 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-block: 16px 6px; }
.part p { font-size: 15px; color: var(--ink-2); }
.spec { height: 148px; border-radius: var(--radius-lg); position: relative; overflow: hidden; display: grid; place-items: center; }
.spec-dusk { background: var(--grain) 0 0 / 12px 12px, var(--gradient-dusk-glow), var(--gradient-dusk); }
.spec-dusk .spec-dot { position: absolute; inset-inline-start: 8%; inset-block-start: 14%; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 22px 6px color-mix(in srgb, var(--amber) 55%, transparent); }
.spec-dot { background: var(--surface-sunken); }
.spec-dot span { width: 26px; height: 26px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 10px color-mix(in srgb, var(--amber) 16%, transparent), 0 0 44px 12px color-mix(in srgb, var(--amber) 40%, transparent); }
.spec-bowl { background: var(--surface-sunken); }
.spec-bowl svg { width: 72%; height: auto; overflow: visible; }
.spec-bowl path { stroke: var(--teal); }

.palette-type { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.swatches { list-style: none; margin: 0 0 16px; padding: 0; }
.swatches li { display: flex; align-items: baseline; gap: 12px; padding-block: 10px; border-block-end: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.swatches b { color: var(--ink); min-width: 88px; }
.sw { flex: none; width: 28px; height: 28px; border-radius: 50%; align-self: center; }
.sw-line { box-shadow: inset 0 0 0 1px var(--line-control); }
.type-ar { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.9; font-weight: 500; margin-block-end: 12px; }

/* ------------------------------------------------------------ screens */
.screen { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px 48px; padding-block: 48px; border-block-start: 1px solid var(--line); }
.screen:first-of-type { border-block-start: 0; padding-block-start: 0; }
.screen-info { align-self: start; position: sticky; inset-block-start: calc(var(--top-h) + 24px); }
.screen-id { font: 700 14px/1 var(--font-display); color: var(--teal); letter-spacing: 0.02em; }
.screen h3 { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-block: 8px 12px; }
.purpose { font-size: 16px; color: var(--ink-2); }
.moment { margin-block-start: 12px; font-size: 15px; color: var(--ink-2); }
.moment-label { font-weight: 600; color: var(--ink); }
.calm-note { display: flex; gap: 8px; align-items: flex-start; margin-block-start: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 14px; color: var(--ink-2); }
.calm-note svg { flex: none; width: 16px; height: 16px; margin-block-start: 3px; fill: var(--ink-2); }
.endpoint { margin-block-start: 12px; font-size: 14px; }
.st-head { margin-block: 22px 8px; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.states { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st {
  width: 100%; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  padding: 9px 12px; min-height: 44px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 14px/1.4 var(--font-body);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.st:hover { border-color: var(--line-control); }
.st[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); box-shadow: var(--glow-key); }
.is-calm .st[aria-pressed="true"] { box-shadow: none; }
.st-kind { font-weight: 600; }
.st-detail { color: var(--ink-2); }
.st-now { margin-block-start: 10px; font-size: 13px; color: var(--ink-muted); min-height: 1.4em; }
.live { display: inline-flex; align-items: center; gap: 6px; margin-block-start: 10px; font-weight: 600; font-size: 15px; }
.live::after { content: "↗"; font-size: 0.9em; }

.frame { margin: 0; min-width: 0; }
.shot { display: block; width: 100%; padding: 0; margin: 0; border: 0; background: var(--surface-sunken); cursor: zoom-in; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lift), 0 0 0 1px var(--line); }
.shot img { width: 100%; transition: opacity var(--duration-base) var(--ease-standard); }
.shot img.swapping { opacity: 0.35; }
.shot:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.frame.is-768 .shot { max-width: 420px; margin-inline: auto; }
.frame-cap { margin-block-start: 12px; font-size: 13px; color: var(--ink-muted); text-align: center; }
/* Around the still screens the presentation is still too. */
.is-calm .shot img { transition: none; }

.print { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 32px; align-items: center; margin-block-start: 24px; padding: 28px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.print-img { display: block; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.print h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-block-end: 8px; }
.print p { color: var(--ink-2); }
.links-row { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-block-start: 16px; }

/* ------------------------------------------------------------ states and motion */
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.zone { padding: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.zone h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-block-end: 8px; }
.zone p { font-size: 15px; color: var(--ink-2); }
.zone-teacher { background: var(--grain) 0 0 / 12px 12px, var(--gradient-dusk-glow), var(--gradient-dusk); border-color: transparent; color: var(--on-dusk); }
.zone-teacher p { color: var(--on-dusk-2); }
.zone-still { background: var(--paper); border-style: dashed; border-color: var(--line-control); }

.specimens { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.specimen h4 { font-size: 17px; font-weight: 700; margin-block: 14px 4px; }
.specimen p { font-size: 15px; color: var(--ink-2); }
.specimen .btn { margin-block-start: 10px; }
.stage { height: 170px; border-radius: var(--radius-lg); display: grid; place-items: center; overflow: hidden; padding: 16px; }
.stage-dusk { background: var(--grain) 0 0 / 12px 12px, var(--gradient-dusk-glow), var(--gradient-dusk); }
.stage-paper { background: var(--surface); border: 1px solid var(--line); }
.stage .mk { width: 104px; height: 104px; overflow: visible; }
.stage .mk path { stroke: var(--on-dusk); stroke-dasharray: 1; stroke-dashoffset: 0; }
.stage .mk circle { fill: var(--amber); filter: drop-shadow(0 0 8px var(--amber)); }
.stage .mk.play path { animation: draw-from 900ms var(--ease-enter) 200ms both; }
.stage .mk.play circle { animation: drop var(--duration-slow) var(--ease-enter) 950ms both; }
@keyframes draw-from { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.demo-key {
  font: 600 18px/1 var(--font-sans); min-height: 48px; padding-inline: 24px; border-radius: var(--radius-md); cursor: pointer;
  color: var(--on-teal); background: var(--gradient-primary); border: 0;
  transition: box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-instant) var(--ease-standard);
}
.demo-key:hover { box-shadow: var(--glow-key); }
.demo-key:active { transform: translateY(1px) scale(0.98); box-shadow: none; background: var(--teal-hover); }

.ink { font-size: 21px; line-height: 2.2; text-align: center; margin: 0; }
.w { display: inline-block; position: relative; padding-inline: 2px; }
.w:has(i) { padding-inline: 4px 12px; }
.w i { font-style: normal; font-size: 12px; font-weight: 700; position: absolute; inset-block-start: -2px; inset-inline-end: 2px; }
.w-substituted { color: var(--state-substituted); text-decoration: underline wavy var(--state-substituted); text-underline-offset: 9px; background: var(--state-substituted-soft); border-radius: 6px; }
.w-omitted { color: var(--state-omitted); text-decoration: line-through var(--state-omitted); background: var(--state-omitted-soft); border-radius: 6px; }
.w-hesitated { color: var(--state-hesitated); text-decoration: underline dotted var(--state-hesitated); text-underline-offset: 9px; background: var(--state-hesitated-soft); border-radius: 6px; }
.w-self-corrected { color: var(--state-self-corrected); text-decoration: underline double var(--state-self-corrected); text-underline-offset: 9px; background: var(--state-self-corrected-soft); border-radius: 6px; }
.ink.play [class*="w-"] { animation: ink var(--duration-slow) var(--ease-enter) both; animation-delay: calc(var(--n) * 35ms + 350ms); }
.ink.play [class*="w-"] i { animation: tag var(--duration-base) var(--ease-enter) both; animation-delay: calc(var(--n) * 35ms + 450ms); }
.w-inserted { font-size: 15px; color: var(--state-inserted); background: var(--state-inserted-soft); border: 1.5px dashed var(--state-inserted); border-radius: var(--radius-pill); padding: 0 8px; vertical-align: 4px; line-height: 1.6; }
@keyframes ink { from { background-color: transparent; text-decoration-color: transparent; color: var(--ink); } }
@keyframes tag { from { opacity: 0; transform: translateY(4px); } }

.listen { display: flex; gap: 10px; align-items: center; height: 80px; }
.listen span { width: 10px; height: 60px; background: radial-gradient(circle, var(--teal) 3.4px, transparent 4px) 0 0 / 10px 12px; animation: breathe 1.4s var(--ease-standard) infinite; animation-delay: calc(var(--i) * 70ms); }
.listen .c { background: radial-gradient(circle, var(--teal) 3.4px, transparent 4px) 0 0 / 10px 12px; position: relative; }
.listen .c::after { content: ""; position: absolute; inset-inline-start: -1px; inset-block-start: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--surface), 0 0 12px var(--amber); }
@keyframes breathe { 50% { opacity: 0.35; transform: scaleY(0.7); } }
.specimen-note { margin-block-start: 20px; font-size: 15px; color: var(--ink-2); }

.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { text-align: start; vertical-align: top; padding: 12px 14px; border-block-end: 1px solid var(--line); }
thead th { font-size: 13px; font-weight: 600; color: var(--ink-muted); background: var(--surface-sunken); position: sticky; inset-block-start: 0; }
tbody tr:last-child > * { border-block-end: 0; }
.motion-table th[scope="row"] { font-weight: 600; min-width: 170px; }
.motion-table td { color: var(--ink-2); min-width: 140px; }
.m-num { font: 700 12px/1 var(--font-display); color: var(--teal); margin-inline-end: 4px; }

.find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block-end: 16px; }
.find label { font-weight: 600; }
.find input { font: 400 16px/1.2 var(--font-body); min-height: 44px; padding-inline: 14px; min-width: min(360px, 100%); border-radius: var(--radius-md); border: 1px solid var(--line-control); background: var(--surface); color: var(--ink); }
.find input:hover { border-color: var(--ink-2); }
.find input:focus-visible { border-color: var(--teal); }
.find-count { font-size: 14px; color: var(--ink-muted); }
.index-table td:first-child a { font: 700 14px/1 var(--font-display); }
.index-table .links { white-space: nowrap; }
.index-table .links a, .index-table .links .na { margin-inline-end: 12px; }
.index-table .na { color: var(--ink-muted); opacity: 0.6; }
.index-table tr[hidden] { display: none; }

/* ------------------------------------------------------------ footer */
.foot { margin-block-start: 140px; color: var(--on-dusk); background: var(--grain) 0 0 / 14px 14px, var(--gradient-dusk-glow), var(--gradient-dusk); padding: 56px var(--gutter) 64px; }
.foot-inner { max-width: var(--page-max); margin-inline: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; }
.foot p { max-width: 76ch; color: var(--on-dusk-2); margin-block-end: 12px; font-size: 16px; }
.foot b { color: var(--on-dusk); }
.foot a { color: var(--on-dusk); }
.foot code { background: var(--dusk-panel); color: var(--on-dusk); }
.foot-meta { font-size: 14px !important; }
.foot :focus-visible { outline-color: var(--on-dusk); }

/* ------------------------------------------------------------ zoom dialog */
.zoom { width: min(1320px, 100vw - 24px); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-overlay); overflow: hidden; }
.zoom[open] { display: flex; flex-direction: column; animation: rise var(--duration-base) var(--ease-enter); }
.zoom::backdrop { background: var(--scrim); }
.zoom-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-block-end: 1px solid var(--line); }
.zoom-title { font-weight: 600; }
.zoom-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.zoom-body { overflow: auto; background: var(--surface-sunken); padding: 16px; }
.zoom-body img { margin-inline: auto; width: auto; max-width: 100%; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .shell { display: block; }
  .rail { position: sticky; inset-block-start: var(--top-h); z-index: 20; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-block-end: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail ol { display: flex; gap: 4px 18px; white-space: nowrap; }
  .rail ol::before { display: none; }
  .rail a { min-height: 44px; font-size: 14px; }
  .r-dot { width: 10px; height: 10px; }
  html { scroll-padding-block-start: calc(var(--top-h) + 64px); }
  .screen-info { inset-block-start: calc(var(--top-h) + 64px); }
  .hero-shot { margin-block-end: 8px; }
}
@media (max-width: 960px) {
  /* On narrow screens the image comes right after the description, before the list of states. */
  .screen { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .screen-info { display: contents; }
  .screen-info > * { order: 1; }
  .screen .frame { order: 2; margin-block: 20px 4px; }
  .screen-info > .st-head, .screen-info > .states, .screen-info > .st-now, .screen-info > .live { order: 3; }
  .screen-info > .live, .screen-info > .endpoint { justify-self: start; }
  .states { flex-direction: row; flex-wrap: wrap; }
  .st { width: auto; }
  .directions, .parts, .zones { grid-template-columns: minmax(0, 1fr); }
  .palette-type { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ref { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .print { grid-template-columns: minmax(0, 1fr); }
  .print-img { max-width: 300px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top .logo, [data-theme="dark"] .top .logo { display: none; }
  .logo-mark-light { display: block; width: 34px; height: 34px; }
  [data-theme="dark"] .logo-mark-light { display: none; }
  [data-theme="dark"] .logo-mark-dark { display: block; width: 34px; height: 34px; }
  .top { gap: 8px; }
  .controls { flex-wrap: nowrap; gap: 6px; }
  .hero { --hero-glow: radial-gradient(60% 40% at 22% 10%, color-mix(in srgb, var(--amber) 34%, transparent), transparent 70%); }
  .view button, .motion-toggle { padding-inline: 10px; font-size: 13px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-mark { order: -1; width: 112px; }
  .hero-shot { margin-block-start: -64px; }
  .foot-inner { grid-template-columns: minmax(0, 1fr); }
  .zoom-body { padding: 8px; }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .hero-copy > *, .js .hero-shot, .js .hero-mark .dot { opacity: 1; }
  .js .hero-mark .bowl-path { stroke-dashoffset: 0; }
  .js .voice { transform: none; }
  .js .voice::after { opacity: 1; }
}
.no-motion { scroll-behavior: auto; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; }
.no-motion .hero-copy > *, .no-motion .hero-shot, .no-motion .hero-mark .dot { opacity: 1 !important; }
.no-motion .hero-mark .bowl-path { stroke-dashoffset: 0 !important; }
.no-motion .voice { transform: none !important; }
.no-motion .voice::after { opacity: 1 !important; }
