/* ═══════════════════════════════════════════════════════════════════════════════
   moaml.2msol.com — site.css
   Layout concept: a right-to-left manuscript. Every section opens with a Kufic title whose
   kashida fills the measure; the tatweel bar is the page's only ornament.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── tokens: Clay (ink on clay) is the base; Night (gold on bitumen) redefines only tokens ── */
:root {
  --bg: #f5ede1;
  --surface: #ede3d5;
  --line: #d5c8b9;
  --text: #1f1915;
  --text-muted: #5e534a;
  --text-faint: #6e645a;
  --signature: #8a5a12;
  --accent: #ad411c;
  --link: #2141a8;
  --live: #2f6b3a;
  --on-signature: #f5ede1;
  --shadow: 0 1px 0 color-mix(in oklab, var(--text) 8%, transparent);

  --f-kufi: 'Reem Kufi', 'Noto Kufi Arabic', 'Geeza Pro', sans-serif;
  --f-ar: 'IBM Plex Sans Arabic', 'Geeza Pro', 'Noto Sans Arabic', 'Segoe UI', sans-serif;
  --f-naskh: 'Amiri', 'Noto Naskh Arabic', 'Times New Roman', serif;
  --f-lat: 'Geist', 'IBM Plex Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4.6vw, 72px);
  --wrap: 1400px;
  --sec-pad: clamp(104px, 15vw, 224px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);        /* 'authority' */
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --dir: -1;                                     /* inline-end is screen-left in RTL */
  --topbar-h: 56px;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0907; --surface: #16120e; --line: #322d28; --text: #f0eae1; --text-muted: #b2a99f;
    --text-faint: #8c857d; --signature: #ecbd51; --accent: #d16b42; --link: #6ba5fb; --live: #679368;
    --on-signature: #0d0907;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0907; --surface: #16120e; --line: #322d28; --text: #f0eae1; --text-muted: #b2a99f;
  --text-faint: #8c857d; --signature: #ecbd51; --accent: #d16b42; --link: #6ba5fb; --live: #679368;
  --on-signature: #0d0907;
  color-scheme: dark;
}
:root:dir(ltr) { --dir: 1; }

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.8 var(--f-ar);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
:root:lang(en) body { font-family: var(--f-lat); line-height: 1.6; }
img, svg, video, canvas { max-width: 100%; }
img { height: auto; display: block; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; }
data { font-variant-numeric: tabular-nums; }
bdi { unicode-bidi: isolate; }
[dir="ltr"] { unicode-bidi: isolate; }
kbd { font: 500 0.78em/1 var(--f-mono); padding: 0.18em 0.42em; border: 1px solid var(--line); border-radius: 4px; }
::selection { background: color-mix(in oklab, var(--signature) 30%, transparent); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; inset-inline-start: 12px; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 100; padding: 10px 14px; background: var(--text); color: var(--bg); transform: translateY(-160%); transition: transform .18s var(--ease); text-decoration: none; }
.skip:focus-visible { transform: none; }

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

/* the tatweel underline: a bar anchored at the start of the word that extends to its end */
a:not(.btn):not(.brand):not(.ch-v) {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat;
  background-size: 34% 0.075em;
  background-position: 100% calc(100% - 0.12em);
  transition: background-size .45s var(--ease);
}
:root:dir(ltr) a:not(.btn):not(.brand):not(.ch-v) { background-position: 0 calc(100% - 0.12em); }
a:not(.btn):not(.brand):not(.ch-v):hover, a:not(.btn):not(.brand):not(.ch-v):focus-visible { background-size: 100% 0.075em; }

.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-muted); font-size: 0.86em; }
.linkish:hover { color: var(--text); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 48px; padding: 0 1.25em;
  border: 1px solid var(--text); border-radius: 0;
  background: transparent; color: var(--text);
  font: 500 16px/1 var(--f-ar); text-decoration: none; cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
:root:lang(en) .btn { font-family: var(--f-lat); }
.btn:hover { background: var(--text); color: var(--bg); }
.btn-primary { background: var(--signature); border-color: var(--signature); color: var(--on-signature); }
.btn-primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-sm { min-height: 40px; padding: 0 1em; font-size: 15px; }

/* ── progress hairline (the tatweel travels across the top) ── */
#progress { position: fixed; inset-inline: 0; top: env(safe-area-inset-top, 0px); height: 2px; z-index: 60; pointer-events: none; }
#progress .progress-bar { display: block; height: 100%; background: var(--signature); transform-origin: 100% 50%; transform: scaleX(0); }
:root:dir(ltr) #progress .progress-bar { transform-origin: 0 50%; }
@supports (animation-timeline: scroll()) {
  #progress .progress-bar { animation: progress-grow linear both; animation-timeline: scroll(root block); }
  @keyframes progress-grow { to { transform: scaleX(1); } }
}

/* ── top strip ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; min-width: 0; }
.brand-name { font: 600 16px/1.2 var(--f-ar); white-space: nowrap; }
.brand-role { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root:lang(en) .brand-name { font-family: var(--f-lat); }
.clock { font: 13px/1 var(--f-ar); color: var(--text-muted); white-space: nowrap; }
.clock time { font: 500 13px/1 var(--f-mono); color: var(--text); font-variant-numeric: tabular-nums; margin-inline-start: 6px; }
.controls { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: nowrap; }
.controls button {
  min-height: 36px; min-width: 36px; padding: 0 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-muted); border-radius: 2px;
}
.controls button:hover { color: var(--text); border-color: var(--line); }
.controls button[aria-pressed="true"] { color: var(--text); }
.controls button[aria-pressed="false"] { text-decoration: line-through; text-decoration-thickness: 1px; }
#btn-sound[aria-pressed="false"] { text-decoration: none; }
#btn-sound[aria-pressed="true"] { color: var(--signature); }
#btn-lang { font-family: var(--f-lat); }
:root:lang(en) #btn-lang { font-family: var(--f-ar); }
#btn-cmdk .cmdk-touch { display: none; }
@media (pointer: coarse) { #btn-cmdk kbd { display: none; } #btn-cmdk .cmdk-touch { display: inline; } }
@media (max-width: 860px) {
  .brand-role, .clock { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  #btn-motion, #btn-sound { display: none; }
  .controls button { padding: 0 8px; }
}

/* ── sections ── */
main { display: block; }
.sec, .hero, .colophon { padding-inline: var(--gutter); }
.sec { padding-block: var(--sec-pad) 0; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; }
.sec-head { display: grid; gap: 20px; margin-block-end: clamp(48px, 7vw, 104px); }
.sec-title {
  font: 700 clamp(44px, 7.6vw, 120px)/1.12 var(--f-kufi);
  color: var(--text);
  white-space: nowrap;
  min-width: 0;
}
:root:lang(en) .sec-title { font: 600 clamp(40px, 6.6vw, 104px)/1.02 var(--f-lat); letter-spacing: -0.035em; white-space: normal; text-wrap: balance; }
.sec-lede { font: 600 clamp(22px, 2.6vw, 36px)/1.55 var(--f-ar); max-width: 30em; text-wrap: balance; }
:root:lang(en) .sec-lede { font-family: var(--f-lat); font-weight: 500; line-height: 1.3; letter-spacing: -0.012em; }
.sec-sub { color: var(--text-muted); max-width: 40em; }
.src { font: 12px/1.4 var(--f-mono); color: var(--text-faint); }
:root:lang(ar) .src { font-family: var(--f-ar); font-size: 13px; }

/* ═════════ 0 · hero ═════════ */
.hero {
  position: relative;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(20px, 4vh, 64px) clamp(40px, 6vh, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.name {
  font: 700 clamp(112px, 21vw, 400px)/1.16 var(--f-kufi);
  color: var(--signature);
  white-space: nowrap;
  margin-block-start: -0.08em;
  user-select: none;
  -webkit-user-select: none;
}
.name-word { display: inline-block; touch-action: pan-y; cursor: ew-resize; }
/* the Arabic mark keeps its own direction in every language: it starts at the right and stretches left */
.name, .name-marks { direction: rtl; }
:root:lang(en) .name-marks .mark-end { font-family: var(--f-lat); }
.name-marks { position: relative; display: flex; justify-content: space-between; height: 1.6em; font: 500 13px/1 var(--f-mono); color: var(--text-muted); margin-block-start: -0.4em; }
.name-marks .mark-end { font-family: var(--f-ar); }
.name-latin { font: 500 13px/1 var(--f-lat); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-block-start: 6px; }

.hero-copy { display: grid; gap: 22px; max-width: 34em; margin-block-start: clamp(28px, 5vw, 64px); }
.statement { font: 600 clamp(26px, 3.3vw, 50px)/1.45 var(--f-ar); text-wrap: balance; }
:root:lang(en) .statement { font: 600 clamp(28px, 3.6vw, 56px)/1.08 var(--f-lat); letter-spacing: -0.03em; }
.subline { color: var(--text-muted); font-size: clamp(17px, 1.35vw, 20px); max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 6px; }

.status-wrap { margin-block-start: clamp(44px, 7vw, 96px); border-top: 1px solid var(--line); padding-block-start: 16px; display: grid; gap: 12px; }
.status-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 13px; color: var(--text-muted); }
.status-head > span:first-child { font-weight: 600; color: var(--text); }
.status-mode { font-family: var(--f-mono); font-size: 12px; }
:root:lang(ar) .status-mode { font-family: var(--f-ar); font-size: 13px; }
.status { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.status li { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-block: 10px; padding-inline-end: 12px; border-inline-end: 1px solid var(--line); margin-inline-end: 12px; font-size: 15px; }
.status li:last-child { border-inline-end: 0; }
.status b { font-weight: 600; white-space: nowrap; }
.status .st { font: 12px/1.3 var(--f-mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
:root:lang(ar) .status .st { font-family: var(--f-ar); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--live); transform: translateY(-1px); }
.is-live .dot, [data-live="up"] .dot { background: var(--live); }
[data-live="down"] .dot { border-color: var(--accent); background: transparent; }
.route-line { font: 13px/1.5 var(--f-mono); color: var(--text-muted); }
@media (max-width: 980px) { .status { grid-template-columns: repeat(3, minmax(0, 1fr)); } .status li:nth-child(3n) { border-inline-end: 0; } }
@media (max-width: 520px) { .status { grid-template-columns: repeat(2, minmax(0, 1fr)); } .status li:nth-child(3n) { border-inline-end: 1px solid var(--line); } .status li:nth-child(2n) { border-inline-end: 0; } }
.hint { font: 13px/1 var(--f-ar); color: var(--text-faint); opacity: 0; }
:root:lang(en) .hint { font-family: var(--f-lat); }
.hint::after { content: ' ←'; font-family: var(--f-mono); }
:root:dir(ltr) .hint::after { content: ' →'; }
.js .hint.is-shown { opacity: 1; transition: opacity .6s var(--ease); }

/* ═════════ 1 · stretch (T0 look — hero.js upgrades it) ═════════ */
.stretch-stage { position: relative; }
.stretch-slider { height: 0; outline-offset: 6px; }
.events { display: grid; gap: 0; border-top: 1px solid var(--line); }
.events li { display: grid; grid-template-columns: minmax(8.5em, 12em) minmax(0, 1fr); gap: 4px 24px; padding-block: 18px; border-bottom: 1px solid var(--line); align-items: baseline; }
.events time { font: 500 14px/1.6 var(--f-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
:root:lang(ar) .events time { font-family: var(--f-ar); }
.events p { font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; }
.events .src { grid-column: 2; }
@media (max-width: 640px) { .events li { grid-template-columns: minmax(0, 1fr); } .events .src { grid-column: 1; } }
.only-en[hidden] { display: none; }
:root:lang(en) .only-en { display: block; }

/* ═════════ 2 · products ═════════ */
.products { display: grid; border-top: 1px solid var(--line); }
.product {
  display: grid;
  grid-template-columns: minmax(0, 4.2fr) minmax(0, 5fr) minmax(0, 4.4fr);
  gap: clamp(24px, 3.4vw, 56px);
  padding-block: clamp(40px, 5.6vw, 88px);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.p-id { display: grid; gap: 10px; align-content: start; }
.p-tag { font: 500 13px/1.3 var(--f-ar); color: var(--text-muted); letter-spacing: 0; }
:root:lang(en) .p-tag { font: 500 12px/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.p-name { font: 700 clamp(56px, 7.4vw, 124px)/1.14 var(--f-kufi); white-space: nowrap; min-width: 0; }
.p-latin { display: none; margin-block-start: 0.5em; font: 500 14px/1 var(--f-lat); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
:root:lang(en) .p-latin { display: block; }
.p-state { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--text-muted); }
.p-body { display: grid; gap: 16px; align-content: start; min-width: 0; }
.p-pitch { font: 600 clamp(20px, 1.75vw, 26px)/1.6 var(--f-ar); text-wrap: pretty; }
:root:lang(en) .p-pitch { font: 500 clamp(20px, 1.7vw, 25px)/1.35 var(--f-lat); letter-spacing: -0.01em; }
.p-proof { color: var(--text-muted); text-wrap: pretty; }
.p-private { color: var(--text-faint); font-size: 15px; }
.p-stack { font: 12px/1.6 var(--f-mono); color: var(--text-faint); }
.p-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.p-poster { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.p-poster img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: saturate(0.82) contrast(1.02); transition: filter .5s var(--ease), transform 1.2s var(--ease); }
.product:hover .p-poster img, .product:focus-within .p-poster img { filter: none; transform: scale(1.015); }
@media (max-width: 1100px) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .p-poster { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
}
@media (max-width: 700px) {
  .product { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .p-poster { aspect-ratio: 16 / 10; }
}
.qist-note { margin-block-start: 28px; max-width: 46em; color: var(--text-muted); font-size: 16px; }

/* ═════════ 3 · machine ═════════ */
.sec-machine { max-width: none; padding-inline: 0; }
.sec-machine > .sec-head, .sec-machine > .punch, .sec-machine > .numbers, .sec-machine > .stack-line, .sec-machine > .as-table {
  max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); box-sizing: content-box;
}
.machine-pin { position: relative; height: 100svh; min-height: 560px; overflow: hidden; border-block: 1px solid var(--line); }
.machine-stage { position: absolute; inset: 0; }
.machine-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.machine-overlay { position: absolute; inset-block-start: calc(var(--topbar-h) + 24px); inset-inline: var(--gutter); display: grid; gap: 10px; pointer-events: none; max-width: 30em; z-index: 2; }
.machine-steps { display: grid; gap: 6px; }
.machine-steps li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--text-faint); transition: color .3s var(--ease); }
.machine-steps li b { font-weight: 600; }
.machine-steps li.is-active { color: var(--text); }
.machine-steps li.is-active::before { content: ''; width: 24px; height: 3px; background: var(--signature); align-self: center; }
.machine-caption { font-size: 14px; color: var(--text-muted); }
.tier-caption, .tape-caption { font: 12px/1.5 var(--f-mono); color: var(--text-faint); }
:root:lang(ar) .tier-caption, :root:lang(ar) .tape-caption { font-family: var(--f-ar); font-size: 13px; }
.machine-fallback { position: absolute; inset: 0; display: grid; align-content: center; gap: 12px; padding: 120px var(--gutter) 40px; }
.has-machine .machine-fallback { display: none; }
.machine-fallback figcaption { font-size: 13px; color: var(--text-faint); }
.mf-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.mf-charts svg { width: 100%; height: auto; }
@media (max-width: 800px) { .mf-charts { grid-template-columns: 1fr; } .machine-fallback { position: static; padding-block: 120px 32px; } .machine-pin:not(.has-machine) { height: auto; } }

.punch { padding-block: clamp(48px, 7vw, 104px) clamp(24px, 3vw, 40px); }
.punch-line { display: grid; gap: 8px; font: 600 clamp(20px, 2.4vw, 34px)/1.5 var(--f-ar); max-width: 28em; }
:root:lang(en) .punch-line { font-family: var(--f-lat); font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.punch-line .big { font: 600 clamp(96px, 17vw, 260px)/0.9 var(--f-lat); letter-spacing: -0.05em; color: var(--signature); }
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-block-start: clamp(24px, 4vw, 48px); }
.numbers > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 22px 0; padding-inline-end: 20px; border-bottom: 1px solid var(--line); }
.numbers dd { font: 600 clamp(40px, 5.2vw, 76px)/1 var(--f-lat); letter-spacing: -0.04em; }
.numbers dt { font-size: 15px; color: var(--text-muted); }
@media (max-width: 700px) { .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack-line { font: 12px/1.8 var(--f-mono); color: var(--text-faint); padding-block: 20px 0; }
.as-table { padding-block: 16px 0; }
.as-table summary { cursor: pointer; color: var(--text-muted); font-size: 14px; width: max-content; }
.table-wrap { overflow-x: auto; margin-block-start: 12px; }
table { border-collapse: collapse; min-width: 420px; font-size: 15px; }
caption { text-align: start; color: var(--text-faint); font-size: 13px; padding-block-end: 8px; caption-side: top; }
th, td { text-align: start; padding: 8px 0; padding-inline-end: 32px; border-bottom: 1px solid var(--line); font-weight: 400; }
td { font-family: var(--f-lat); font-variant-numeric: tabular-nums; }
tfoot th, tfoot td { font-weight: 600; }

/* ═════════ 4 · under the hood ═════════ */
.heritage { font: 400 clamp(22px, 2.3vw, 32px)/1.8 var(--f-naskh); max-width: 30em; color: var(--text); }
:root:lang(en) .heritage { font-style: italic; line-height: 1.45; }
.kj-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-block-end: clamp(32px, 4vw, 56px); padding-block: 14px; border-block: 1px solid var(--line); }
.kj-note { font-size: 14px; color: var(--text-muted); max-width: 44em; }
.switch { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; cursor: pointer; font-size: 15px; font-weight: 500; }
.switch-track { position: relative; width: 40px; height: 22px; border: 1.5px solid var(--text); border-radius: 22px; flex: none; }
.switch-track::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.switch[aria-checked="true"] .switch-track { background: var(--signature); border-color: var(--signature); }
.switch[aria-checked="true"] .switch-track::after { background: var(--on-signature); transform: translateX(calc(var(--dir) * 18px)); }
.proofs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 4vw, 64px) clamp(32px, 5vw, 96px); }
.proofs li { display: grid; gap: 10px; align-content: start; padding-block-start: 18px; border-top: 1px solid var(--line); min-width: 0; }
.proofs h3 { font: 600 clamp(21px, 1.9vw, 27px)/1.5 var(--f-ar); }
:root:lang(en) .proofs h3 { font-family: var(--f-lat); letter-spacing: -0.015em; line-height: 1.25; }
.proofs p { color: var(--text-muted); }
p.kj { hyphens: none; }
@media (max-width: 800px) { .proofs { grid-template-columns: minmax(0, 1fr); } }

/* ═════════ 5 · defence ═════════ */
.defence { display: grid; gap: 20px; }
.defence-svg { width: 100%; height: auto; overflow: visible; }
.layers { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--text-muted); counter-reset: l; }
.layers li { counter-increment: l; }
.layers li::before { content: counter(l) ' · '; font-family: var(--f-mono); color: var(--text-faint); }
.recovery { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px clamp(32px, 5vw, 96px); margin-block-start: clamp(56px, 7vw, 112px); padding-block-start: 24px; border-top: 1px solid var(--line); }
.recovery-title { font: 700 clamp(28px, 3.4vw, 52px)/1.35 var(--f-kufi); text-wrap: balance; }
:root:lang(en) .recovery-title { font: 600 clamp(28px, 3.2vw, 48px)/1.08 var(--f-lat); letter-spacing: -0.03em; }
.recovery p { color: var(--text-muted); }
@media (max-width: 800px) { .recovery { grid-template-columns: minmax(0, 1fr); } }

/* ═════════ 6 · method ═════════ */
.method-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 112px); align-items: start; }
.method-body { font-size: clamp(18px, 1.5vw, 21px); }
.sprints-facts { display: grid; }
.sprints-facts > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding-block: 14px; border-top: 1px solid var(--line); align-items: baseline; }
.sprints-facts dt { font-weight: 600; }
.sprints-facts dd { color: var(--text-muted); }
.sprints { margin-block-start: clamp(40px, 6vw, 88px); display: grid; gap: 14px; }
.sprints-strip { width: 100%; min-height: 140px; }
.sprints-strip svg { display: block; width: 100%; height: 140px; overflow: visible; }
.sprints figcaption { font-size: 14px; color: var(--text-muted); max-width: 52em; }
@media (max-width: 800px) { .method-grid { grid-template-columns: minmax(0, 1fr); } }

/* ═════════ 7 · lab ═════════ */
.lab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 96px); }
.lab li { display: grid; gap: 8px; padding-block: 26px; border-top: 1px solid var(--line); align-content: start; min-width: 0; }
.lab h3 { font: 700 clamp(28px, 3vw, 44px)/1.3 var(--f-kufi); }
.lab h3[lang="en"] { font: 600 clamp(28px, 3vw, 44px)/1.1 var(--f-lat); letter-spacing: -0.03em; }
.lab p { color: var(--text-muted); max-width: 34em; }
.lab-k { font: 12px/1.5 var(--f-mono); color: var(--text-faint); }
@media (max-width: 800px) { .lab { grid-template-columns: minmax(0, 1fr); } }

/* ═════════ 8 · letters ═════════ */
.letters-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px clamp(32px, 6vw, 112px); align-items: start; }
.novel { display: grid; gap: 18px; max-width: 340px; }
.novel img { width: 100%; aspect-ratio: 600 / 804; object-fit: cover; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 28px 60px -32px color-mix(in oklab, var(--text) 45%, transparent); }
.novel-title { font: 700 32px/1.4 var(--f-naskh); }
.novel figcaption { display: grid; gap: 10px; }
.novel figcaption p.kj { color: var(--text-muted); font-size: 16px; }
.commits-intro { color: var(--text-muted); margin-block-end: 18px; }
.commits { display: grid; gap: 0; }
.commits li { padding-block: 18px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.commits q { font: 400 clamp(22px, 2.2vw, 32px)/1.75 var(--f-naskh); quotes: none; text-wrap: pretty; }
.gloss { font-size: 15px; color: var(--text-muted); }
:root:lang(en) .gloss[hidden] { display: block; }
@media (max-width: 900px) { .letters-grid { grid-template-columns: minmax(0, 1fr); } }

.playground { margin-block-start: clamp(64px, 9vw, 144px); padding-block: 28px 8px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.pg-label { font-size: 16px; color: var(--text-muted); }
.pg-input {
  width: min(100%, 14em); padding: 6px 0; border: 0; border-bottom: 2px solid var(--text);
  background: transparent; color: var(--text); font: 600 clamp(28px, 3.4vw, 44px)/1.4 var(--f-kufi); border-radius: 0;
}
.pg-input:focus-visible { outline: none; border-bottom-color: var(--signature); }
.pg-stage { font: 700 clamp(84px, 14vw, 220px)/1.25 var(--f-kufi); color: var(--signature); white-space: nowrap; overflow: hidden; min-height: 1.3em; }
.pg-rule { color: var(--text-muted); min-height: 1.8em; }

/* ═════════ 9 · beliefs ═════════ */
.beliefs { display: grid; }
.beliefs li { font: 500 clamp(26px, 3.8vw, 58px)/1.5 var(--f-kufi); padding-block: clamp(18px, 2.4vw, 32px); border-top: 1px solid var(--line); text-wrap: balance; }
:root:lang(en) .beliefs li { font: 500 clamp(26px, 3.6vw, 54px)/1.12 var(--f-lat); letter-spacing: -0.03em; }

/* ═════════ 10 · contact ═════════ */
.sec-contact { padding-block-end: clamp(80px, 10vw, 160px); }
.scarcity { color: var(--text-muted); }
.channels { display: grid; border-top: 1px solid var(--line); }
.ch { display: grid; grid-template-columns: 8em minmax(0, 1fr) auto; gap: 12px 24px; align-items: baseline; padding-block: clamp(16px, 2vw, 26px); border-bottom: 1px solid var(--line); }
.ch-k { font-size: 15px; color: var(--text-muted); }
.ch-v { font: 500 clamp(22px, 3.2vw, 46px)/1.2 var(--f-lat); letter-spacing: -0.02em; text-decoration: none; overflow-wrap: anywhere; min-width: 0; justify-self: start; }
.ch-v:hover { color: var(--signature); }
.ch-primary .ch-v { font-size: clamp(26px, 4.4vw, 64px); }
.copy { border: 1px solid var(--line); background: transparent; min-height: 36px; padding: 0 12px; cursor: pointer; font-size: 13px; color: var(--text-muted); }
.copy:hover { color: var(--text); border-color: var(--text); }
.copy.is-done { color: var(--live); border-color: var(--live); }
@media (max-width: 640px) { .ch { grid-template-columns: minmax(0, 1fr) auto; } .ch-k { grid-column: 1 / -1; } .ch-v { font-size: clamp(17px, 5.2vw, 26px); overflow-wrap: normal; } .ch-primary .ch-v { font-size: clamp(22px, 7vw, 34px); } }
.contact-foot { margin-block-start: 20px; color: var(--text-muted); font-size: 15px; }
.signature { margin-block-start: clamp(72px, 10vw, 160px); font: 700 clamp(96px, 20vw, 340px)/1.2 var(--f-kufi); color: var(--signature); white-space: nowrap; overflow: hidden; }
.sig-dot { display: inline-block; }

/* ═════════ footer ═════════ */
.colophon { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 12px; font-size: 14px; color: var(--text-muted); }
.clock-triple { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; color: var(--text); }
.ct { font: 500 28px/1.3 var(--f-lat); font-variant-numeric: tabular-nums; }
.ct-ind { font-family: var(--f-ar); }
.ct-cun { font-family: 'Noto Sans Cuneiform', var(--f-lat); font-size: 30px; }
.clock-note, .colophon-text { max-width: 52em; }
.verified { font-family: var(--f-mono); font-size: 12px; }
:root:lang(ar) .verified { font-family: var(--f-ar); font-size: 13px; }
.colophon-row { display: flex; gap: 10px; align-items: center; }
.bts { padding: 16px; border: 1px solid var(--line); background: var(--surface); font: 12px/1.7 var(--f-mono); color: var(--text); overflow-x: auto; }
.copyright { font-size: 13px; color: var(--text-faint); }

/* ═════════ reveal (added by main.js only when motion is full) ═════════ */
.js .rv-line { display: block; padding-block: 0.35em; margin-block: -0.35em; overflow: clip; }
.js .rv-line > .rv-in { display: block; }

/* ═════════ view transitions ═════════ */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .42s; animation-timing-function: var(--ease); }
html:active-view-transition-type(theme)::view-transition-old(root) { animation: none; }
html:active-view-transition-type(theme)::view-transition-new(root) { animation: vt-reveal .8s var(--ease) both; }
@keyframes vt-reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); } to { clip-path: circle(160vmax at var(--vt-x, 50%) var(--vt-y, 0)); } }

/* ═════════ reduced motion (system or the page's own toggle) ═════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
.reduce-motion #progress .progress-bar { animation-duration: auto !important; }

@media (forced-colors: active) {
  .dot { forced-color-adjust: none; border-color: CanvasText; }
  .btn-primary { border: 1px solid ButtonText; }
}

/* ═════════ generated graphics (main.js) ═════════ */
.lat-bar { display: inline-block; vertical-align: baseline; width: 1.6em; height: 0.075em; margin-inline-start: 0.28em; background: currentColor; transform-origin: 0 50%; }
:root:lang(en) .sec-title:has(.lat-bar) { display: flex; align-items: baseline; }
:root:lang(en) .sec-title .lat-bar { flex: 1 1 auto; max-width: 8em; }
.sprints-strip .sp-base { stroke: var(--line); stroke-width: 1; }
.sprints-strip .sp-bars rect { fill: var(--text); }
.sprints-strip .sp-dots circle { fill: var(--signature); }
.sprints-strip .sp-months line { stroke: var(--text-faint); stroke-width: 1; }
.sprints-strip .sp-months text { fill: var(--text-faint); font: 11px var(--f-ar); }
:root:lang(en) .sprints-strip .sp-months text { font-family: var(--f-mono); }
.defence-svg .df-layer line { stroke: var(--text); stroke-width: 3; }
.defence-svg .df-layer:nth-child(n+2) line { stroke-width: 2; opacity: .85; }
.defence-svg .df-layer text { fill: var(--text-muted); font: 500 15px var(--f-ar); }
:root:lang(en) .defence-svg text { font-family: var(--f-lat); }
.defence-svg .df-probe line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 2 5; }
.defence-svg .df-probe path { stroke: var(--accent); stroke-width: 2; fill: none; }
.defence-svg .df-visitor line { stroke: var(--signature); stroke-width: 2.5; }
.defence-svg .df-visitor circle { fill: var(--signature); }
.defence-svg .df-visitor text { fill: var(--signature); font: 600 14px var(--f-ar); }
.defence-svg .df-core rect { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.defence-svg .df-core text { fill: var(--text); font: 600 16px var(--f-ar); }
