/* ============================================================================
   saphan.ai — one stylesheet, two themes.

   Dark is the default and the identity; light exists because dark does not
   land for everyone. The light theme is *selected*, not inverted: every value
   below was chosen against its own surface and contrast-checked, because a
   flipped dark palette produces muddy greens and unreadable dim text.

   Contrast, light theme, against --ground unless noted:
     body 12.4 · bright 17.6 · muted 6.1 · dim 4.8 · accent 5.8
     code 10.2 (on --surface) · terracotta 5.5 · blue 7.1
     chart accent 5.3 and chart context 3.2, both on --surface
   Dark theme values are the originals, unchanged.
   ========================================================================= */

:root {
  color-scheme: dark;

  --ground:       #0c0e0d;   /* page */
  --surface:      #101312;   /* terminal blocks, figures */
  --rule:         #1d211e;   /* section and row rules */
  --edge:         #22271f;   /* surface borders, stronger rules */

  --ink:          #eef1ef;   /* headings, emphasis */
  --ink-body:     #d6dad7;   /* body copy */
  --ink-code:     #c3cbc5;   /* monospace inside surfaces */
  --ink-muted:    #9aa39d;   /* secondary copy */
  --ink-dim:      #5a655d;   /* labels, numerals, prompts */
  --ink-faint:    #454f48;   /* the quietest mark on the page */

  --accent:       #86a98f;   /* links, the mark that carries identity */
  --accent-hi:    #a3c2ab;   /* hover */
  --accent-line:  rgba(134,169,143,0.4);
  --accent-edge:  rgba(134,169,143,0.35);
  --accent-wash:  rgba(134,169,143,0.28);

  --status-bad:   #c98a7d;   /* [refused] — always beside a word */
  --status-run:   #7d97c9;   /* [running] — always beside a word */

  --chart-mark:   #86a98f;   /* the measured recommendation */
  --chart-ctx:    #6b756e;   /* everything that is context */

  --highlight-row: #16201a;  /* selected line in the fleet projection */
  --shadow: none;
}

:root[data-theme="light"] {
  color-scheme: light;

  --ground:       #f8f9f6;
  --surface:      #edf0ea;
  --rule:         #dde1d9;
  --edge:         #d3d9cf;

  --ink:          #10140f;
  --ink-body:     #2b322d;
  --ink-code:     #333a35;
  --ink-muted:    #58615a;
  --ink-dim:      #646f67;   /* 4.95 page, 4.55 surface */
  --ink-faint:    #7b837c;   /* decorative, 3.7 - see the a11y note */

  --accent:       #3f6b4f;
  --accent-hi:    #2f5a3f;
  --accent-line:  rgba(63,107,79,0.42);
  --accent-edge:  rgba(63,107,79,0.38);
  --accent-wash:  rgba(63,107,79,0.20);

  --status-bad:   #a24b37;
  --status-run:   #37548a;

  --chart-mark:   #3f6b4f;
  --chart-ctx:    #7e877f;

  --highlight-row: #e3ebe1;
  --shadow: 0 1px 2px rgba(16,20,15,0.05);
}


/* ── Accessibility note, deliberately left as a decision ─────────────────────
   The DARK theme's --ink-dim (#5a655d) measures 3.19:1 on the page and 3.07:1
   on surfaces. That is below WCAG AA (4.5:1) for the small text it carries:
   section labels, row numerals, footer, table headers. This is the ORIGINAL
   value, kept so the dark theme renders pixel-identical to the site as it
   shipped — changing a brand colour is not a refactor's business.

   To bring dark to AA, change one line in :root —
       --ink-dim: #758078;
   which measures 4.72 on the page and 4.55 on surfaces. It is a visibly
   lighter grey; nothing else needs to move.

   The LIGHT theme passes AA on every text role. Its --ink-faint (#7b837c,
   3.7:1) sits below AA by choice: it carries only the ornamental สะพาน in the
   footer, which the logo beside it and the page title already say.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── frame ───────────────────────────────────────────────────────────────── */
html, body { margin: 0; padding: 0; background: var(--ground); }
body { font-family: 'IBM Plex Sans', sans-serif; }
::selection { background: var(--accent-wash); }
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }

.page {
  min-height: 100vh; background: var(--ground); color: var(--ink-body);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 820px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px);
  display: flex; flex-direction: column;
}

/* ── sections ────────────────────────────────────────────────────────────── */
.sec { padding: clamp(40px, 8vh, 72px) 0; border-top: 1px solid var(--rule); }
.sec-hero {
  min-height: 88vh; display: flex; flex-direction: column;
  justify-content: center; padding: clamp(48px, 10vh, 96px) 0;
}
.sec-top { padding: clamp(40px, 8vh, 72px) 0 clamp(32px, 6vh, 56px); }
.sec-cta { padding: clamp(48px, 10vh, 88px) 0 clamp(56px, 10vh, 96px); border-top: 1px solid var(--rule); }

.label {
  font-family: 'IBM Plex Mono', monospace; font-weight: 400; font-size: 13px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim);
  margin: 0 0 28px;
}
/* must follow .label — same specificity, source order decides */
.label-tight { margin-bottom: 16px; }

/* ── numbered rows ───────────────────────────────────────────────────────── */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 3ch 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.row:last-child { border-bottom: none; }
.num { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--ink-dim); padding-top: 5px; }
.row :where(h3), .rh { font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600; font-size: 17px; color: var(--ink); margin: 0 0 6px; }
.row :where(p) { margin: 0; color: var(--ink-body); max-width: 42em; text-wrap: pretty; }

/* ── copy ────────────────────────────────────────────────────────────────── */
.p     { margin: 0; color: var(--ink-body); max-width: 42em; text-wrap: pretty; }
.p-b   { margin: 0 0 18px; color: var(--ink-body); max-width: 42em; text-wrap: pretty; }
.p-in  { margin: 0 0 20px; color: var(--ink-body); max-width: 42em; text-wrap: pretty; }
.intro { margin: 0 0 24px; color: var(--ink-muted); max-width: 42em; text-wrap: pretty; }
/* No max-width: the original had none, and adding one re-wraps ten paragraphs.
   Kept faithful on purpose — capping this measure is a separate decision. */
.note  { margin: 12px 0 0; font-size: 15px; color: var(--ink-muted); }
.note-lg { margin: 20px 0 0; font-size: 15px; color: var(--ink-muted); max-width: 42em; text-wrap: pretty; }
.foot-note { margin: 24px 0 0; font-size: 15px; color: var(--ink-muted); max-width: 42em; text-wrap: pretty; }
.lede  { margin: 28px 0 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-muted); max-width: 34em; text-wrap: pretty; }
.stack { display: flex; flex-direction: column; gap: 18px; max-width: 42em; }
.stack :where(p), .p-plain { margin: 0; color: var(--ink-body); text-wrap: pretty; }
.bright { color: var(--ink); }
.dim    { color: var(--ink-dim); }
.grn    { color: var(--accent); }
.ter    { color: var(--status-bad); }
.blu    { color: var(--status-run); }

.h1 {
  font-family: 'Schibsted Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(30px, 5.4vw, 54px); line-height: 1.12; letter-spacing: -0.015em;
  color: var(--ink); margin: clamp(40px, 8vh, 72px) 0 0; max-width: 15em; text-wrap: balance;
}
.h1-sub {
  font-family: 'Schibsted Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(28px, 4.8vw, 46px); line-height: 1.14; letter-spacing: -0.015em;
  color: var(--ink); margin: 18px 0 0; max-width: 16em; text-wrap: balance;
}
.hero-sub { margin: 28px 0 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-muted); max-width: 34em; text-wrap: pretty; }

/* ── solo preview call-out (hero) ───────────────────────────────────────── */
.sec-preview {
  margin-top: 34px; max-width: 42em;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 6px;
  padding: 18px 22px; box-shadow: var(--shadow);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px;
}
.sec-preview .preview-k {
  flex-basis: 100%; margin: 0;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
.sec-preview .preview-t { flex: 1 1 18em; margin: 0; color: var(--ink-body); text-wrap: pretty; }
.sec-preview .preview-t b { color: var(--ink); font-weight: 600; }
.sec-preview .preview-btn {
  flex: 0 0 auto; font-family: 'IBM Plex Mono', monospace; font-size: 14px; letter-spacing: 0.06em;
  color: var(--accent); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--accent-edge); border-radius: 6px; padding: 9px 14px;
}
.sec-preview .preview-btn:hover { color: var(--accent-hi); border-color: var(--accent-hi); }
.sec-preview .preview-fine { flex-basis: 100%; margin: 0; font-size: 13.5px; color: var(--ink-dim); text-wrap: pretty; }

/* ── controls table: what is in place, control by control ───────────────── */
.ctl-wrap { overflow-x: auto; margin-top: 4px; }
table.ctl { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
table.ctl th, table.ctl td { text-align: left; vertical-align: top; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--rule); }
table.ctl th:last-child, table.ctl td:last-child { padding-right: 0; }
table.ctl thead th {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 400; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--edge); padding-top: 0;
}
table.ctl tbody tr:last-child td { border-bottom: none; }
table.ctl td.c-name { width: 18%; min-width: 11em; color: var(--ink); font-weight: 500; }
table.ctl td.c-what { width: 50%; color: var(--ink-body); text-wrap: pretty; }
table.ctl td.c-rec  { width: 32%; color: var(--ink-muted); text-wrap: pretty; }
table.ctl td.c-rec code, table.ctl td.c-what code { font-family: 'IBM Plex Mono', monospace; font-size: 0.9em; color: var(--ink-code); }
@media (max-width: 720px) {
  table.ctl thead { display: none; }
  table.ctl, table.ctl tbody, table.ctl tr, table.ctl td,
  table.ctl td.c-name, table.ctl td.c-what, table.ctl td.c-rec { display: block; width: auto; min-width: 0; }
  table.ctl tr { padding: 16px 0; border-bottom: 1px solid var(--rule); }
  table.ctl td { padding: 0; border-bottom: none; }
  table.ctl td.c-what { margin-top: 6px; }
  table.ctl td.c-rec { margin-top: 8px; font-size: 13.5px; }
  table.ctl td.c-rec::before { content: "Record: "; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
  html[lang="pl"] table.ctl td.c-rec::before { content: "Rekord: "; }
  html[lang="th"] table.ctl td.c-rec::before { content: "บันทึก: "; }
  html[lang="ar"] table.ctl td.c-rec::before { content: "السجل: "; }
}

/* ── right-to-left locale ───────────────────────────────────────────────── */
html[lang="ar"] :where(.h1, .h1-sub, .row h3, .rh, .fig-t, .contact-link) {
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
}
html[dir="rtl"], html[dir="rtl"] body { max-width: 100%; overflow-x: hidden; }
html[dir="rtl"] .wrap { box-sizing: border-box; width: 100%; }
html[dir="rtl"] table.ctl th,
html[dir="rtl"] table.ctl td { text-align: right; padding: 14px 0 14px 18px; }
html[dir="rtl"] table.ctl th:last-child,
html[dir="rtl"] table.ctl td:last-child { padding-left: 0; }
html[dir="rtl"] table.m caption,
html[dir="rtl"] table.m th:first-child,
html[dir="rtl"] table.m td:first-child { text-align: right; }
html[dir="rtl"] :where(.term, .term pre) { direction: ltr; text-align: left; }
html[dir="rtl"] .mark { margin-right: 17px; margin-left: 0; }

/* ── links, brand ────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.home-link { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand-name { font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: 0.01em; color: var(--ink); }
.brand-name-sm { font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600; font-size: 20px; letter-spacing: 0.01em; }
.mono-link {
  font-family: 'IBM Plex Mono', monospace; font-size: 14px; letter-spacing: 0.06em;
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent-line); padding-bottom: 2px;
}
.links { margin: 22px 0 0; display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; }
.contact-link {
  font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600;
  font-size: clamp(20px, 3vw, 28px); color: var(--accent); text-decoration: none;
  border-bottom: 1px solid var(--accent-line); padding-bottom: 3px;
}
.contact-link:hover { color: var(--accent-hi); border-bottom-color: var(--accent-hi); }

/* ── terminal blocks ─────────────────────────────────────────────────────── */
.term { background: var(--surface); border: 1px solid var(--edge); border-radius: 6px; padding: 22px 24px; box-shadow: var(--shadow); }
/* Base for every code block. Diagram <pre>s that must not wrap keep an inline
   `white-space: pre; overflow-x: auto` and win on specificity. */
.term pre, .page pre {
  margin: 0; font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(12px, 1.6vw, 14.5px); line-height: 1.9; color: var(--ink-code);
  white-space: pre-wrap; word-break: break-word;
}

/* ── disclosure ──────────────────────────────────────────────────────────── */
.disc { margin-top: 14px; }
.disc > summary {
  font-family: 'IBM Plex Mono', monospace; font-size: 14px; letter-spacing: 0.06em;
  color: var(--accent); cursor: pointer; list-style: none;
  -webkit-user-select: none; user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }
summary:hover { color: var(--accent-hi); }
details[open] > summary { color: var(--accent-hi); }
.disc-body { margin-top: 12px; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.site-foot {
  padding: 28px 0 40px; border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.foot-copy { font-size: 13.5px; color: var(--ink-dim); }
.foot-mark { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); }
.foot-thai { font-size: 12.5px; color: var(--ink-faint); }
.foot-dot { fill: var(--accent); }

/* ── theme toggle ────────────────────────────────────────────────────────── */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 20;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-dim);
  background: var(--ground); border: 1px solid var(--rule); border-radius: 5px;
  padding: 6px 11px; cursor: pointer; line-height: 1;
  transition: color .12s ease, border-color .12s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--edge); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 13px; height: 13px; flex: 0 0 auto; }
/* the button advertises the theme you will get, not the one you are in */
.theme-toggle .t-moon, .theme-toggle .t-dark { display: none; }
:root[data-theme="light"] .theme-toggle .t-moon,
:root[data-theme="light"] .theme-toggle .t-dark { display: inline; }
:root[data-theme="light"] .theme-toggle .t-sun,
:root[data-theme="light"] .theme-toggle .t-light { display: none; }
@media (max-width: 640px) {
  .theme-toggle { top: 10px; right: 10px; padding: 6px 9px; }
  .theme-toggle .t-light, .theme-toggle .t-dark { display: none !important; }
}
@media print { .theme-toggle { display: none; } }

/* ── bench: figure & table ───────────────────────────────────────────────── */
.fig { background: var(--surface); border: 1px solid var(--edge); border-radius: 6px; padding: 24px 26px 20px; margin: 28px 0 0; box-shadow: var(--shadow); }
.fig-t { font-family: 'Schibsted Grotesk', sans-serif; font-weight: 600; font-size: 16px; color: var(--ink); margin: 0 0 4px; }
.fig-s { font-size: 13px; color: var(--ink-dim); margin: 0 0 20px; line-height: 1.55; max-width: 52em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 22px; font-size: 12.5px; color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 11px; height: 11px; border-radius: 2px; flex: 0 0 auto; }
.sw-mark { background: var(--chart-mark); }
.sw-ctx  { background: var(--chart-ctx); }
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 720px) { .panels { grid-template-columns: 1fr; gap: 24px; } }
.panel h4 { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-code); margin: 0 0 3px; }
.panel .ax { font-size: 11.5px; color: var(--ink-dim); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.bars { display: flex; flex-direction: column; gap: 2px; }
.brow { padding: 3px 0; }
.blab { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-muted); margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btrack { display: flex; align-items: center; gap: 8px; }
.bar { height: 10px; border-radius: 0 3px 3px 0; min-width: 2px; background: var(--chart-ctx); }
.bar-mark { background: var(--chart-mark); }
.bval { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; flex: 0 0 auto; }
.base { height: 1px; background: var(--edge); margin-top: 10px; }

.tw { overflow-x: auto; margin: 26px 0 0; -webkit-overflow-scrolling: touch; }
table.m { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 520px; font-family: 'IBM Plex Mono', monospace; }
table.m caption { text-align: left; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; color: var(--ink-dim); padding: 0 0 12px; line-height: 1.55; }
table.m th, table.m td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.m th:first-child, table.m td:first-child { text-align: left; padding-left: 0; }
table.m th:last-child, table.m td:last-child { padding-right: 0; }
table.m thead th { font-size: 11px; font-weight: 400; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--edge); }
table.m tbody tr:last-child td { border-bottom: none; }
table.m td { color: var(--ink-code); }
.mark { display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 11.5px; margin: 2px 0 0 17px; white-space: normal; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 9px; vertical-align: baseline; background: var(--chart-ctx); }
.dot-mark { background: var(--chart-mark); }

.tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-edge);
  border-radius: 3px; padding: 1px 7px; margin-left: 9px; vertical-align: 2px; white-space: nowrap;
}
.tag-dim { color: var(--ink-dim); border-color: var(--edge); }

/* ── homepage: editorial product front door ─────────────────────────────── */
body.home > .page {
  background:
    radial-gradient(circle at 78% 6%, rgba(134,169,143,.11), transparent 28rem),
    var(--ground);
}
.home .wrap { max-width: 1120px; }
.home .sec-hero {
  min-height: auto;
  padding: clamp(28px, 5vh, 52px) 0 clamp(64px, 10vh, 108px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr);
  column-gap: clamp(44px, 7vw, 92px);
  align-items: start;
}
.home .sec-hero > .brand { grid-column: 1 / -1; margin-bottom: clamp(72px, 11vh, 132px); }
.top-nav {
  margin-inline-start: auto; padding-inline-end: 96px;
  display: flex; align-items: center; gap: clamp(14px, 2.5vw, 30px);
}
.top-nav a {
  color: var(--ink-muted); text-decoration: none; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: .07em;
}
.top-nav a:hover { color: var(--ink); }
.top-nav .nav-docs {
  color: var(--ink); border: 1px solid var(--accent-edge); border-radius: 999px;
  padding: 7px 12px; background: rgba(134,169,143,.08);
}
.top-nav a[aria-current="page"] { color: var(--ink); }

/* The same product chrome on every generated subpage. */
.subpage .wrap { max-width: 1120px; }
.subpage .sec-top {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  column-gap: 32px; padding-top: clamp(28px, 5vh, 52px);
}
.subpage .sec-top > .home-link { grid-column: 1; }
.subpage .sec-top > .subpage-nav { grid-column: 2; justify-self: end; }
.subpage .sec-top > :where(h1, p) { grid-column: 1 / -1; }
.subpage .home-link svg { width: 44px; height: 44px; }
.subpage .brand-name-sm { font-size: 22px; }
.home .sec-hero > .brand,
.subpage .sec-top > :where(.home-link, .subpage-nav) { min-height: 44px; }
.home .sec-hero > .h1,
.home .sec-hero > .hero-sub,
.home .sec-hero > .hero-sub + p,
.home .sec-hero > .links,
.home .sec-hero > .sec-preview { grid-column: 1; }
.home .sec-hero > .h1 {
  margin-top: 0; font-size: clamp(44px, 6.2vw, 78px); line-height: .99;
  letter-spacing: -.045em; max-width: 12.5ch;
}
.home .sec-hero > .hero-sub { max-width: 37em; font-size: clamp(19px, 2vw, 24px); line-height: 1.48; }
.home .hero-enterprise { grid-column: 2; grid-row: 2 / span 4; }
.home .hero-product { grid-column: 2; grid-row: 6 / span 2; margin-top: 28px; }
.home .hero-rail {
  position: relative; padding: 24px 24px 26px;
  border: 1px solid var(--edge); border-radius: 12px;
  background: rgba(16,19,18,.76); box-shadow: var(--shadow);
}
:root[data-theme="light"] .home .hero-rail { background: rgba(237,240,234,.82); }
.home .hero-rail::before {
  content: ""; position: absolute; inset-block: 24px; inset-inline-start: -1px;
  width: 2px; background: var(--accent);
}
.home .sec-preview { border-radius: 10px; margin-top: 38px; }

.edition-band {
  padding: clamp(56px, 9vh, 92px) 0; border-top: 1px solid var(--rule);
}
.edition-head {
  display: grid; grid-template-columns: .75fr 1.6fr; gap: clamp(24px, 5vw, 72px);
  align-items: start; margin-bottom: 34px;
}
.edition-head .label { margin: 7px 0 0; }
.edition-head h2, .docs-copy h2 {
  font-family: 'Schibsted Grotesk', sans-serif; color: var(--ink);
  font-size: clamp(30px, 4.3vw, 52px); line-height: 1.05; letter-spacing: -.035em; margin: 0;
}
.edition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.edition-card {
  position: relative; min-height: 250px; padding: 28px 26px;
  display: flex; flex-direction: column; border: 1px solid var(--edge); border-radius: 10px;
  background: var(--surface); overflow: hidden;
}
.edition-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--ink-faint);
}
html[dir="rtl"] .edition-card::before { inset: 0 0 0 auto; }
.edition-card.edition-solo::before { background: var(--accent); }
.edition-card.edition-enterprise { background: var(--highlight-row); }
.edition-k {
  margin: 0 0 28px; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.edition-card h3 {
  margin: 0 0 12px; color: var(--ink); font-family: 'Schibsted Grotesk', sans-serif;
  font-size: clamp(20px, 2vw, 25px); line-height: 1.18; letter-spacing: -.015em;
}
.edition-card > p:not(.edition-k) { margin: 0 0 24px; color: var(--ink-muted); font-size: 15px; line-height: 1.55; }
.edition-features { margin: 0 0 24px; border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.edition-features > summary {
  padding: 12px 0; cursor: pointer; color: var(--accent);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.edition-features > summary::after { content: "+"; color: var(--ink-dim); font-size: 16px; line-height: 1; }
.edition-features[open] > summary::after { content: "−"; }
.edition-features ul { margin: 0; padding: 0 0 14px 18px; color: var(--ink-muted); font-size: 13.5px; line-height: 1.45; }
.edition-features li + li { margin-top: 7px; }
.edition-features code { font-family: 'IBM Plex Mono', monospace; font-size: .92em; color: var(--ink-code); }
.edition-features + a { margin-top: auto; }

.forge-band {
  position: relative;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 42%);
}
.forge-band::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px 0;
  width: 3px;
  background: var(--accent);
}
.forge-band code { font-family: 'IBM Plex Mono', monospace; font-size: .92em; color: var(--ink-code); }
.edition-card a, .docs-link {
  margin-top: auto; align-self: flex-start; color: var(--accent); text-decoration: none;
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; border-bottom: 1px solid var(--accent-line);
}

.docs-band {
  margin: 0 0 clamp(62px, 10vh, 108px); padding: clamp(34px, 5vw, 54px);
  display: grid; grid-template-columns: 1.5fr .72fr; gap: clamp(36px, 7vw, 88px);
  border: 1px solid var(--accent-edge); border-radius: 14px;
  background: linear-gradient(135deg, rgba(134,169,143,.14), rgba(134,169,143,.035));
}
.docs-copy .label { margin-bottom: 20px; color: var(--accent); }
.docs-copy h2 { font-size: clamp(29px, 3.8vw, 47px); max-width: 16ch; }
.docs-copy > p:not(.label) { margin: 22px 0 28px; max-width: 44em; color: var(--ink-muted); }
.docs-link { display: inline-block; margin: 0; color: var(--ink); font-size: 14px; }
.docs-index { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.docs-index span {
  padding: 13px 0; border-bottom: 1px solid var(--accent-edge);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-muted);
}
.docs-index span:last-child { border-bottom: 0; }

.home > .page .sec:not(.sec-hero) { padding: clamp(54px, 8vh, 82px) 0; }
.home .sec > .label { color: var(--accent); }
.home .sec .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home .sec .row {
  padding: 24px; grid-template-columns: 3ch 1fr; border: 1px solid var(--edge);
  border-radius: 9px; background: var(--surface);
}
.home .sec .row:last-child { border-bottom: 1px solid var(--edge); }
.home #controls .ctl-wrap { border: 1px solid var(--edge); border-radius: 10px; padding: 0 22px; background: var(--surface); }
.home #controls table.ctl tbody tr:nth-child(n+7) { display: none; }
.home #controls table.ctl tbody tr:nth-child(6) td { border-bottom: 0; }
html[lang="ar"] :where(.edition-head h2, .edition-card h3, .docs-copy h2) {
  font-family: 'IBM Plex Sans Arabic', 'IBM Plex Sans', sans-serif;
}

@media (max-width: 880px) {
  .home .sec-hero { display: flex; }
  .home .sec-hero > .brand { margin-bottom: 72px; }
  .home .hero-rail { margin-top: 20px; }
  .home .hero-product { margin-top: 12px; }
  .edition-grid { grid-template-columns: 1fr; }
  .edition-card { min-height: 0; }
  .docs-band { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .home .wrap { padding-inline: 18px; }
  .home .sec-hero > .brand { align-items: flex-start; flex-wrap: wrap; margin-bottom: 58px; }
  .home .brand svg { width: 36px; height: 36px; }
  .home .brand-name { font-size: 20px; }
  .home .top-nav {
    flex-basis: 100%; margin: 22px 0 0; padding: 14px 0 0; width: 100%;
    border-top: 1px solid var(--rule); gap: 12px 18px; flex-wrap: wrap; justify-content: flex-start;
  }
  .home .top-nav .nav-docs { margin-inline-start: auto; }
  .subpage .sec-top { grid-template-columns: 1fr; align-items: start; }
  .subpage .sec-top > .subpage-nav {
    grid-column: 1; justify-self: stretch; margin: 24px 0 0; padding: 14px 0 0;
    width: 100%; border-top: 1px solid var(--rule); gap: 14px 20px; flex-wrap: wrap;
  }
  .subpage .subpage-nav a { font-size: 11px; }
  .subpage .subpage-nav .nav-docs { margin-inline-start: auto; }
  .home .sec-hero > .h1 { font-size: clamp(40px, 13vw, 58px); }
  .home .hero-rail { padding: 21px 19px 23px; }
  .edition-head { grid-template-columns: 1fr; gap: 16px; }
  .edition-head .label { margin: 0; }
  .docs-band { margin-inline: -4px; padding: 28px 22px; gap: 28px; }
  .home .sec .rows { grid-template-columns: 1fr; }
  .home #controls .ctl-wrap { padding: 0 18px; }
}
