/* Hawsabah patterns: site header and nav, bilingual pair grid, hero, slider, animated mark,
   ticker, sections, footer.

   Load order: palette.css, fonts.css, themes.css, base.css, components.css, patterns.css.
   Logical properties throughout, so the same rules serve English (LTR) and Arabic (RTL).
   Every animation and transition is switched off under prefers-reduced-motion (last block).

   --mark-url points at the transparent mark relative to THIS file. If you move css/ or assets/,
   override it in your own stylesheet:  :root { --mark-url: url("/your/path/hawsabah-mark-book.svg"); }
   The light sweep on the mark uses CSS masking, which browsers refuse on file:// pages:
   serve the folder over http (any static server) to see it. */

:root {
  --mark-url: url("../../assets/logo/hawsabah-mark-book.svg");
  --wrap: 72rem;
  --header-h: 5rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slide-ms: 7000ms;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section.alt { background: color-mix(in srgb, var(--bg-alt) 70%, transparent); }

.skip-link {
  position: absolute; inset-inline-start: 1rem; inset-block-start: -4rem; z-index: 100;
  background: var(--brand); color: var(--on-brand); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip-link:focus { inset-block-start: 1rem; }

/* ---------- Bilingual pair grid ----------------------------------------------------------------
   English and Arabic are interleaved as siblings: one pair per paragraph or card, never one block
   per language. Write   <div class="en">...</div><div class="ar" lang="ar" dir="rtl">...</div>
   inside .pair-grid; each row is one English cell and its Arabic counterpart. */
.pair-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(1.5rem, 5vw, 3.5rem); row-gap: 1rem; align-items: start;
}
.pair-grid > .ar { direction: rtl; font-size: calc(1em * var(--ar-scale)); }
.pair-grid > .en > :last-child, .pair-grid > .ar > :last-child { margin-bottom: 0; }
@media (max-width: 720px) { .pair-grid { grid-template-columns: 1fr; row-gap: 0.75rem; } }

/* Body text in the bilingual columns is justified, each language inside its own column (as on the original
   story page). English hyphenates (it needs lang="en" on <html>) and Arabic spaces between words, so lines
   do not open into gaps. Headings are never justified. Text outside the pair grid stays ragged. */
.pair-grid > .en :is(p, blockquote), .pair-grid > .ar :is(p, blockquote), .pair-grid > .pair-card p {
  text-align: justify; text-justify: inter-word;
}
.pair-grid > .en :is(p, blockquote), .pair-grid > .pair-card.en p { hyphens: auto; }

.pair-card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.pair-card h3 { font-size: 1.05rem; color: var(--accent-ink); font-family: var(--font-text); margin-bottom: 0.35rem; }
.pair-card.ar h3 { font-family: var(--font-display); font-size: calc(1.05rem * var(--ar-scale)); }
.pair-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Site header and nav ----------------------------------------------------------------- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-block-end: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.site-header .bar {
  max-width: var(--wrap); margin-inline: auto; padding: 0.55rem 1.25rem; min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand .mark { --mark-size: 3.5rem; }
.brand .lockup-name { font-size: 0.95rem; }

.nav { display: flex; align-items: center; gap: 0.15rem; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: flex; flex-direction: column; align-items: center; padding: 0.35rem 0.85rem;
  border-radius: 999px; text-decoration: none; color: var(--ink);
  font-size: 0.95rem; font-weight: 600; line-height: 1.2;
}
.nav a .ar { font-size: 0.82rem; font-weight: 500; color: var(--ink-soft); line-height: 1.5; }
.nav a:hover, .nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.nav a.cta { background: var(--brand); color: var(--on-brand); margin-inline-start: 0.5rem; }
.nav a.cta .ar { color: inherit; opacity: 0.85; }
.nav a.cta:hover { filter: brightness(1.08); }

.nav-toggle {
  display: none; align-items: center; gap: 0.5rem; background: transparent; color: var(--heading);
  border: 1.5px solid var(--rule); border-radius: 10px; padding: 0.5rem 0.75rem; font: inherit; font-weight: 600; cursor: pointer;
}
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after {
  display: block; inline-size: 1.1rem; block-size: 2px; background: currentColor; border-radius: 2px; content: "";
}
.nav-toggle .bars { position: relative; }
.nav-toggle .bars::before { position: absolute; inset-block-start: -6px; }
.nav-toggle .bars::after { position: absolute; inset-block-start: 6px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; inset-inline: 0; inset-block-start: 100%;
    flex-direction: column; align-items: stretch; gap: 0.25rem; padding: 1rem 1.25rem 1.25rem;
    background: var(--bg); border-block-end: 1px solid var(--rule); box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { flex-direction: row; justify-content: space-between; border-radius: 12px; padding: 0.8rem 1rem; }
  .nav a.cta { margin-inline-start: 0; margin-block-start: 0.4rem; }
}

/* Theme swatches in the header: three round buttons that show the theme they switch to. */
.theme-swatches {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem;
  border: 1.5px solid var(--rule); border-radius: 999px; margin-inline-start: 0.75rem;
}
.theme-swatches button {
  inline-size: 1.6rem; block-size: 1.6rem; padding: 0; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}
.theme-swatches button[data-set-theme="light"] { --sw: #FFFFFF; }
.theme-swatches button[data-set-theme="paper"] { --sw: #EBDDB8; }
.theme-swatches button[data-set-theme="dark"]  { --sw: #0B1220; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.theme-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-ink); }
.theme-swatches button:hover { filter: brightness(0.95); }
@media (max-width: 860px) {
  /* Row order on small screens: brand, theme swatches, menu button. The menu list drops below. */
  .brand { order: 1; }
  .theme-swatches { order: 2; margin-inline-start: auto; margin-inline-end: 0.6rem; }
  .nav-toggle { order: 3; }
  .nav { order: 4; }
}

/* Phones: keep brand, theme swatches, and menu button on one row inside 360px. */
@media (max-width: 520px) {
  .site-header .bar { padding-inline: 0.9rem; gap: 0.5rem; }
  .brand { gap: 0.5rem; min-inline-size: 0; }
  .brand .mark { --mark-size: 2.8rem; }
  .brand .lockup-name { font-size: 0.78rem; letter-spacing: 0.14em; }
  .theme-swatches { margin-inline-end: 0; gap: 0.2rem; }
  .theme-swatches button { inline-size: 1.45rem; block-size: 1.45rem; }
  .nav-toggle { padding: 0.5rem 0.65rem; }
  .nav-toggle .label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Bilingual wordmark: HAWSABAH | حوسبة -----------------------------------------------------
   English: Inter Bold, capitals, wide letter spacing. Arabic: plain Cairo Bold, no capitals and
   no letter spacing (spacing breaks the joins), set larger so both names carry equal weight.
   Set the size on the wrapper (font-size); both names scale with it. Never show one name without the other. */
.wordmark { display: inline-flex; align-items: baseline; gap: 0.6em; color: var(--heading); line-height: 1; white-space: nowrap; }
.wordmark .en {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
}
.wordmark .sep { color: var(--rule); font-weight: 400; }
.wordmark .ar { font-family: var(--font-wordmark-ar); font-weight: 700; font-size: 1.24em; letter-spacing: 0; text-transform: none; direction: rtl; }
:lang(ar) .lockup-name { font-family: var(--font-wordmark-ar); }
.brand .wordmark { font-size: 0.95rem; }
.hero-wordmark { justify-content: center; font-size: clamp(1rem, 1.8vw, 1.3rem); margin: 0; }
.hero-mark { gap: 1.6rem; }
@media (max-width: 860px) { .hero-wordmark { display: none; } }
@media (max-width: 520px) { .brand .wordmark { font-size: 0.78rem; gap: 0.45em; } }

/* ---------- Primary tagline under the wordmark (top left of the header) ------------------------------
   The owner's primary tagline sits under the logo on every page, English then Arabic. It may wrap on narrow
   screens; it is never removed. Keep it short and use the exact wording the owner supplied. */
.brand-text { display: grid; gap: 0.3rem; min-inline-size: 0; }
.brand-tagline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.05rem 0.55em; font-size: 0.68rem; font-weight: 500; line-height: 1.3; color: var(--ink-soft); }
.brand-tagline .ar { font-family: var(--font-text-ar); font-size: 1.12em; line-height: 1.5; direction: rtl; }
.brand-tagline .sep { color: var(--rule); }
@media (max-width: 520px) {
  .brand-tagline { font-size: 0.6rem; max-inline-size: 12.5rem; gap: 0 0.4em; }
  .brand-tagline .sep { display: none; }
}

/* ---------- Animated mark ------------------------------------------------------------------------
   .mark-float  drifts up and down
   .mark-tilt   leans toward the pointer (set by hawsabah.js through --tx and --ty)
   .mark        the lockup element from base.css: carries the parchment plate in the dark theme
   .mark-art    wraps the <img> so the light sweep is clipped to the mark's own shape */
.mark-float { animation: mark-float 9s ease-in-out infinite; }
.mark-tilt {
  transform: perspective(900px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform 0.35s var(--ease);
}
.mark-art { position: relative; display: block; line-height: 0; }
.mark-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 246, 214, 0.55) 46%, rgba(255, 226, 140, 0.9) 50%, rgba(255, 246, 214, 0.55) 54%, transparent 60%);
  background-size: 320% 100%; background-position: 140% 0;
  -webkit-mask: var(--mark-url) center / contain no-repeat; mask: var(--mark-url) center / contain no-repeat;
  mix-blend-mode: screen;
  animation: mark-sheen 8s ease-in-out 1.2s infinite;
}
@keyframes mark-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.9rem); } }
@keyframes mark-sheen { 0% { background-position: 140% 0; } 38%, 100% { background-position: -40% 0; } }

/* ---------- Hero ---------------------------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100svh - var(--header-h)); display: grid; align-items: center;
  padding-block: clamp(2rem, 6vw, 5rem);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(56rem 38rem at 80% 30%, var(--glow-a), transparent 62%),
    radial-gradient(38rem 30rem at 6% 92%, var(--glow-b), transparent 62%);
}
.hero .facets i { animation: facet-drift 22s ease-in-out infinite alternate; }
.hero .facets .f2 { animation-duration: 28s; animation-delay: -6s; }
.hero .facets .f3 { animation-duration: 18s; animation-delay: -11s; }
@keyframes facet-drift { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(-3%, 4%, 0) rotate(2.5deg); } }

.hero-inner {
  max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  align-items: center; gap: clamp(2rem, 6vw, 5rem);
}
.hero-mark { display: grid; place-items: center; }
.hero .mark { --mark-size: min(24vw, 18rem); box-shadow: var(--plate-shadow, none); }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
  .hero .mark { --mark-size: min(46vw, 12.5rem); }
}

.eyebrow-pair { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 0.9rem; margin-block-end: 1.1rem; }
.eyebrow-pair .eyebrow { margin: 0; }
.eyebrow-pair .dot { inline-size: 0.4rem; block-size: 0.4rem; border-radius: 50%; background: var(--accent); }
.eyebrow-pair .ar { font-size: 0.95rem; font-weight: 600; color: var(--accent-ink); }

/* ---------- Slider -------------------------------------------------------------------------------
   All slides sit in one grid cell, so the box is as tall as the tallest slide and nothing jumps. */
.slides { display: grid; }
.slide {
  grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.6s;
}
.slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.slide h1 { font-size: clamp(2rem, 4.8vw, 3.5rem); margin-block-end: 0.4rem; text-wrap: balance; }
.slide h1.ar { font-size: clamp(2.1rem, 5vw, 3.7rem); margin-block-end: 0.9rem; text-align: start; }
.slide .sub { color: var(--ink-soft); font-size: 1.15rem; margin-block-end: 0.35rem; text-wrap: pretty; }
.slide .sub.ar { font-size: 1.2rem; margin-block-end: 0; }
.slide .ar { direction: rtl; }

/* Status slide ("Coming soon"): the first slide, large centered text with no box or border. English and Arabic
   are both centered; only this slide is centered. The whole slide links to the subscribe section. */
.slide-status { display: grid; align-content: center; }
.status-cta { display: grid; justify-items: center; text-align: center; text-decoration: none; color: var(--heading); }
.status-cta:hover h1 { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; text-decoration-color: var(--accent); }
.status-cta:focus-visible { outline: 3px solid var(--focus); outline-offset: 8px; border-radius: 12px; }
.slide .status-cta h1 { margin: 0; font-size: clamp(3.2rem, 8.2vw, 6.8rem); line-height: 1.05; text-align: center; }
.slide .status-cta h1.ar { font-family: var(--font-status-ar); font-weight: 800; font-size: clamp(3.4rem, 8.8vw, 7.2rem); margin-block: 0.22em 0; text-align: center;
  /* Arabic vowel marks (like the tanween on the status word) rise above the letters; a tight line box lets them touch the English line. */
  line-height: 1.6; }

.slider-controls { display: flex; align-items: center; gap: 0.4rem; margin-block-start: 1.6rem; }
.slider-controls .dots { display: flex; gap: 0.15rem; }
.slider-controls .dot-btn {
  padding: 1rem 0.2rem; background: none; border: 0; cursor: pointer; line-height: 0;
}
.slider-controls .dot-btn span {
  display: block; inline-size: 2.4rem; block-size: 0.32rem; border-radius: 99px;
  background: color-mix(in srgb, var(--ink-soft) 35%, transparent); overflow: hidden; position: relative;
}
.slider-controls .dot-btn span::after {
  content: ""; position: absolute; inset: 0; background: var(--accent-ink);
  transform-origin: left center; transform: scaleX(0);
}
[dir="rtl"] .slider-controls .dot-btn span::after { transform-origin: right center; }
.slider-controls .dot-btn[aria-current="true"] span::after { transform: scaleX(1); }
.slider[data-playing="true"] .dot-btn[aria-current="true"] span::after { animation: slide-fill var(--slide-ms) linear forwards; }
@keyframes slide-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.slider-controls .icon-btn {
  display: inline-grid; place-items: center; inline-size: 2.4rem; block-size: 2.4rem; border-radius: 50%;
  background: transparent; color: var(--heading); border: 1.5px solid var(--rule); cursor: pointer; font-size: 0.85rem;
}
.slider-controls .icon-btn:hover { border-color: var(--accent-ink); }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-start: 1.6rem; }
.btn .ar { font-weight: 500; font-size: 0.92em; opacity: 0.9; }
.btn.stack { flex-direction: column; gap: 0.1rem; }

/* ---------- Ticker: a word that changes ------------------------------------------------------------
   English types and erases; Arabic fades (typing breaks Arabic joins, because each new letter
   re-shapes the one before it). */
.ticker { display: grid; gap: 0.15rem; margin-block-start: 2rem; color: var(--ink-soft); font-size: 1.05rem; }
.ticker .ar { direction: rtl; font-size: 1.12rem; }
.ticker .rot { color: var(--accent-ink); font-weight: 600; }
.ticker .rot-en.is-typing::after {
  content: ""; display: inline-block; inline-size: 2px; block-size: 1em; margin-inline-start: 2px;
  background: currentColor; vertical-align: -0.14em; animation: caret 1s steps(1) infinite;
}
.ticker .rot-ar { display: inline-block; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.ticker .rot-ar.is-swapping { opacity: 0; transform: translateY(6px); }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Subscribe, contact, footer -------------------------------------------------------------- */
.section-title { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; row-gap: 0.2rem; align-items: baseline; margin-block-end: 1.5rem; }
.section-title h2 { margin: 0; }
.section-title .ar { direction: rtl; }
@media (max-width: 720px) { .section-title { grid-template-columns: 1fr; } }
/* Anchors land below the sticky header, not under it. */
section[id] { scroll-margin-block-start: calc(var(--header-h) + 0.5rem); }
.subscribe { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.subscribe .field { flex: 1 1 16rem; max-width: 24rem; }
.form-status { min-block-size: 1.5em; margin-block-start: 0.6rem; font-size: var(--fs-small); color: var(--ink-soft); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

/* Subscribe is a slim one-way band (an email for updates); Contact is a two-way message form with our details. */
.section.compact { padding-block: clamp(1.75rem, 4vw, 3rem); }
.section.compact .section-title { margin-block-end: 1rem; }
.subscribe-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; padding: 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.subscribe-bar .field { flex: 1 1 18rem; max-width: none; }
.subscribe-note { margin: 0.75rem 0 0; font-size: var(--fs-small); color: var(--ink-soft); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact-form { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.contact-form .field { max-width: none; }
.contact-form .btn { justify-self: start; }
.contact-form .form-status { margin: 0; }
.contact-details h3 { margin-block: 0 0.6rem; font-size: 1.05rem; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* "By the numbers" band (a future pattern: use it only with real figures, see references/numbers-band.md). */
.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; }
.stat {
  display: grid; justify-items: center; gap: 0.35rem; text-align: center; padding: 1.4rem 1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow);
}
.stat-icon { display: grid; place-items: center; inline-size: 3rem; block-size: 3rem; border-radius: 50%; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.stat-icon svg { inline-size: 1.4rem; block-size: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.stat-num { font-family: var(--font-display); font-size: clamp(1.9rem, 4.4vw, 2.7rem); font-weight: 700; line-height: 1.1; color: var(--heading); font-variant-numeric: lining-nums tabular-nums; }
.stat-label { display: grid; gap: 0.1rem; font-size: var(--fs-small); color: var(--ink-soft); }
.stat-label .ar { font-family: var(--font-text-ar); direction: rtl; font-size: calc(1em * var(--ar-scale)); }
.stats-note { margin: 0 0 1.25rem; font-size: var(--fs-small); color: var(--ink-soft); }

.site-footer { border-block-start: 1px solid var(--rule); padding-block: 2rem; color: var(--ink-soft); font-size: var(--fs-small); }
.site-footer .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.theme-switch { display: inline-flex; border: 1.5px solid var(--rule); border-radius: 999px; padding: 0.2rem; gap: 0.15rem; }
.theme-switch button {
  font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); background: transparent;
  border: 0; border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }

/* ---------- Content pages --------------------------------------------------------------------------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.5rem; }
.page-head .pair-grid > .en h1, .page-head .pair-grid > .ar h1 { margin-block-end: 0.3rem; }
/* Arabic eyebrows need more size than Latin capitals to read at the same weight (no capitals, no tracking). */
.eyebrow:lang(ar), :lang(ar) .eyebrow { font-size: 1.05rem; letter-spacing: 0; font-weight: 600; }
.prose { max-width: 66ch; }
.prose h2 { margin-block-start: 2rem; }
.draft-banner { margin-block-end: 2rem; }
.doc-body ol.clauses { padding-inline-start: 1.4rem; }
.doc-body ol.clauses li { margin-block-end: 0.7rem; }

/* ---------- Document reading page (bylaws, policies) ---------------------------------------------------
   Download link at the top right, a draft banner, a contents list, then the text in a readable measure. */
.doc-actions { display: flex; justify-content: flex-end; padding-block-start: 1rem; }
.doc-meta { color: var(--ink-soft); margin-block: 1.25rem 1.5rem; }
.doc-toc { border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); padding: 1rem 1.25rem; margin-block-end: 2.25rem; max-inline-size: 44rem; }
.doc-toc .eyebrow { margin-block-end: 0.5rem; }
.doc-toc ol { margin: 0; padding-inline-start: 1.25rem; columns: 2 16rem; column-gap: 2rem; font-size: var(--fs-small); }
.doc-toc li { margin-block-end: 0.3rem; break-inside: avoid; }
.doc-body h2 { font-size: 1.5rem; margin-block: 2.5rem 0.75rem; scroll-margin-block-start: calc(var(--header-h) + 1rem); }
.doc-body h3 { font-size: 1.05rem; font-family: var(--font-text); color: var(--accent-ink); margin-block: 1.4rem 0.3rem; scroll-margin-block-start: calc(var(--header-h) + 1rem); }
.doc-body p { max-inline-size: 66ch; }

/* ---------- Reduced motion: no animation, no transition, no autoplay --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .slide { transform: none; }
}
