/**
 * chrome.css — THE FEED global chrome (FINAL-SPEC §3, 2026-10-27): the sticky nav
 * (+ the homepage story bar), the mobile menu sheet, the "exposure switch" theme
 * toggle and the slab footer. Site-wide: linked by layouts/base.html after
 * onrecord.css, so it renders on the homepage AND every ON RECORD page (for-
 * businesses, samples, enquiry, privacy, legal …). Markup: macros/chrome.html;
 * behaviour: client/chrome/nav.ts + public.ts initThemeToggle + home/runtime.ts.
 *
 * Colour comes only from public-tokens.css (light default + dark). Logical
 * properties only; every illustrative translate is multiplied by --ch-dir and
 * transform-origins have explicit RTL mirrors. Motion = transform / opacity /
 * clip-path; the REC dot is the one ambient loop, and only under js-motion.
 */

/* ═══ 1. Chrome tokens (site-wide: the homepage's own tokens are page-scoped) ═══ */
:root {
  --ch-g: clamp(16px, 4vw, 56px);
  --ch-max: 1360px;
  --ch-bar-h: 56px;
  --ch-story-h: 14px;
  --ch-display: "Archivo", "Archivo Fallback", "Arial Black", sans-serif;
  --ch-text: "Inter", system-ui, sans-serif;
  --ch-ui: "IBM Plex Mono", ui-monospace, monospace;
  --ch-ar-display: "Changa", "Readex Pro", sans-serif;
  --ch-ar-text: "Readex Pro", "Changa", sans-serif;
  --ch-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ch-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ch-ease-wipe: cubic-bezier(0.77, 0, 0.18, 1);
  --ch-dir: 1;
  /* the slab slope (FINAL-SPEC §1.2: 18deg, rise/run ≈ .325) */
  --ch-slope: 0.325;
  /* the soft on-slab tints (text on --slab, both themes) */
  --ch-on-slab-2: color-mix(in srgb, var(--on-slab) 66%, transparent);
  --ch-on-slab-line: color-mix(in srgb, var(--on-slab) 16%, transparent);
}
:root[dir="rtl"] {
  --ch-dir: -1;
}
@media (min-width: 600px) {
  :root {
    --ch-bar-h: 64px;
  }
}

/* ═══ 2. The bar — header.site-nav ═════════════════════════════════════════
   Solid by default (no-JS / every ON RECORD page): opaque --bg + a hairline.
   On the homepage, while the cover is under it (scrollY < 80), it is
   transparent with --on-slab text over a top scrim; nav.ts adds .is-solid. */
.site-nav {
  --ch-head-h: var(--ch-bar-h);
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-nav);
  display: block;
  min-block-size: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
}
.site-nav.nav--story {
  --ch-head-h: calc(var(--ch-bar-h) + var(--ch-story-h));
}
/* the solid layer + the hairline are pseudo layers so the cover hand-off is an
   opacity crossfade (never an animated background) */
.site-nav::before,
.site-nav::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ch-ease-out);
}
.site-nav::before {
  inset-block: 0;
  background: var(--color-bg, var(--bg));
}
/* QA 2026-10-27: the old 92% fill (with or without a backdrop blur) let the
   cover's corner label and display headings ghost legibly behind the logo —
   the solid layer is fully opaque */
.site-nav::after {
  inset-block-end: 0;
  block-size: 1px;
  background: var(--line);
  opacity: min(1, calc(var(--scroll, 1) * 40));
}
.nav__bar {
  position: relative;
  z-index: 1;
  block-size: var(--ch-bar-h);
}
/* the scrim that keeps --on-slab text legible over the cover photo */
.nav__bar::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block: 0 -28px;
  background: linear-gradient(var(--scrim), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ch-ease-out);
}
.nav__in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  block-size: 100%;
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-inline: auto;
}

/* the homepage: the header overlays the cover (it keeps its sticky box but
   gives its height back, so #cover starts at the top of the page) */
.page-home .site-nav {
  margin-block-end: calc(-1 * var(--ch-head-h));
}
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid) {
  color: var(--on-slab);
}
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid)::before,
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid)::after {
  opacity: 0;
}
:is(.js-motion, .bundle-live)
  .page-home
  .site-nav:not(.is-solid)
  .nav__bar::before {
  opacity: 1;
}
/* the ON RECORD has-hero screen (for-creators): fixed over its hero media,
   transparent while the hero is under it (public.ts initHeroNav). */
.has-hero .site-nav {
  position: fixed;
  inset-inline: 0;
}
.has-hero .site-nav.site-nav--over-hero {
  color: var(--on-slab);
}
.has-hero .site-nav.site-nav--over-hero::before,
.has-hero .site-nav.site-nav--over-hero::after {
  opacity: 0;
}
.has-hero .site-nav.site-nav--over-hero .nav__bar::before {
  opacity: 1;
}

/* ── brand ── */
.site-nav .nav__brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  color: inherit;
  text-decoration: none;
}
.site-nav .nav__brand svg {
  block-size: 28px;
  inline-size: auto;
  direction: ltr;
}
.site-nav .nav__brand .wordmark__latin {
  font-family: var(--ch-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: inherit;
}
@media (min-width: 600px) {
  .site-nav .nav__brand svg {
    block-size: 32px;
  }
}
@media (max-width: 359px) {
  .site-nav .nav__brand .wordmark__latin {
    display: none;
  }
}

/* ── links (≥1024; below that they live in the sheet) ── */
.nav__links {
  display: none;
}
.nav__links ul {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-family: var(--ch-text);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.2;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
:lang(ar) .nav__link {
  font-family: var(--ch-ar-text);
  font-size: 16px;
}
/* the underline is a yellow bar that wipes in from the reading edge */
.nav__link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 8px;
  block-size: 3px;
  border-radius: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 260ms var(--ch-ease-out);
}
:root[dir="rtl"] .nav__link::after {
  transform-origin: 100% 50%;
}
@media (hover: hover) and (pointer: fine) {
  .nav__link:hover::after {
    transform: scaleX(1);
  }
}
.nav__link:focus-visible::after {
  transform: scaleX(1);
}

/* ── tools ── */
.nav__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.nav__lang {
  display: none;
}
@media (min-width: 1024px) {
  .nav__in {
    gap: clamp(20px, 2.4vw, 40px);
  }
  .nav__links {
    display: block;
    margin-inline-start: auto;
  }
  .nav__tools {
    gap: 10px;
    margin-inline-start: 0;
  }
  .nav__lang {
    display: block;
  }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .site-nav .nav__brand .wordmark__latin {
    display: none;
  }
}

/* ═══ 3. Language toggle (nav, sheet, footer) — EN | العربية, never a globe ═══ */
:is(.site-nav, .nav-sheet, .foot) .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
:is(.site-nav, .nav-sheet, .foot) .lang-toggle a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding-inline: 8px;
  border-radius: 999px;
  font-family: var(--ch-ui);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: inherit;
  opacity: 0.62;
  text-decoration: none;
  transition: opacity 160ms var(--ch-ease-out);
}
:is(.site-nav, .nav-sheet, .foot) .lang-toggle a[lang="ar"] {
  font-family: var(--ch-ar-text);
  font-size: 15px;
  letter-spacing: 0;
}
:is(.site-nav, .nav-sheet, .foot) .lang-toggle a[aria-current="true"] {
  opacity: 1;
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) {
  :is(.site-nav, .nav-sheet, .foot) .lang-toggle a:hover {
    opacity: 1;
  }
}
:is(.site-nav, .nav-sheet, .foot) .lang-toggle__sep {
  inline-size: 1px;
  block-size: 16px;
  background: currentColor;
  opacity: 0.3;
}

/* ═══ 4. Theme toggle — the "exposure switch" (FINAL-SPEC §3.3) ═══════════
   60×32 pill track, 24px yellow knob with a black sun; dark → the knob travels
   to inline-end and the sun becomes a crescent. 44px hit area from padding.
   State keys off <html data-theme>, so every copy of the switch agrees. */
.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin: 0;
  padding: 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tt__track {
  position: relative;
  display: block;
  inline-size: 60px;
  block-size: 32px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tt__knob {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 4px;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--on-yellow);
  box-shadow: var(--sh-1);
  transition: transform 260ms var(--ch-ease-pop);
}
:root[data-theme="dark"] .tt__knob {
  transform: translateX(calc(28px * var(--ch-dir)));
}
.tt__knob svg {
  position: absolute;
  inset: 3px;
  inline-size: 18px;
  block-size: 18px;
  transition: opacity 160ms linear;
}
.tt__sun {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.tt__moon {
  fill: currentColor;
  stroke: none;
  opacity: 0;
}
:root[data-theme="dark"] .tt__sun {
  opacity: 0;
}
:root[data-theme="dark"] .tt__moon {
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover .tt__knob {
    transform: translateX(calc(3px * var(--ch-dir)));
  }
  :root[data-theme="dark"] .theme-toggle:hover .tt__knob {
    transform: translateX(calc(25px * var(--ch-dir)));
  }
}
.theme-toggle:active .tt__knob {
  transform: translateX(calc(2px * var(--ch-dir))) scale(0.92);
}
:root[data-theme="dark"] .theme-toggle:active .tt__knob {
  transform: translateX(calc(26px * var(--ch-dir))) scale(0.92);
}
/* without JS the switch cannot write the cookie — hide it (the server still
   paints the cookie's theme) */
html:not(.js) .theme-toggle {
  display: none;
}
/* over the cover / the hero / on the footer slab: a glass-free light track */
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid) .tt__track,
.has-hero .site-nav--over-hero .tt__track,
.foot .tt__track {
  background: var(--ch-on-slab-line);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--on-slab) 26%, transparent);
}

/* ═══ 5. The record button — a.btn-rec (FINAL-SPEC §3.1) ══════════════════
   Black pill (light) / yellow pill (dark) with a red REC dot that breathes;
   on hover/focus the dot morphs record → stop (clip-path, not radius). Over
   the cover it is yellow in both themes. <1024 the nav copy is a 44px round
   REC button (the label stays as visually-hidden text = its name). */
.btn-rec {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: none;
  min-block-size: 44px;
  padding-inline: 16px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--ch-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 220ms var(--ch-ease-out);
}
:lang(ar) .btn-rec {
  font-family: var(--ch-ar-text);
  font-weight: 500;
  font-size: 16px;
}
:root[data-theme="dark"] .btn-rec,
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid) .btn-rec,
.has-hero .site-nav--over-hero .btn-rec {
  background: var(--yellow);
  color: var(--on-yellow);
}
/* the hover shadow is a pseudo crossfade (never an animated box-shadow) */
.btn-rec::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: var(--sh-2);
  opacity: 0;
  transition: opacity 220ms var(--ch-ease-out);
}
.btn-rec__dot {
  flex: none;
  inline-size: 10px;
  block-size: 10px;
  background: var(--red);
  clip-path: inset(0 round 50%);
  transition: clip-path 180ms var(--ch-ease-out);
}
html.js-motion .btn-rec__dot {
  animation: rec-breathe 1.6s ease-in-out infinite;
}
@keyframes rec-breathe {
  50% {
    transform: scale(0.8);
  }
}
.btn-rec:focus-visible .btn-rec__dot {
  clip-path: inset(1px round 2px);
}
@media (hover: hover) and (pointer: fine) {
  .btn-rec:hover {
    transform: translateY(-1px);
  }
  .btn-rec:hover::after {
    opacity: 1;
  }
  .btn-rec:hover .btn-rec__dot {
    clip-path: inset(1px round 2px);
  }
}
.btn-rec:active {
  transform: scale(0.97);
  transition-duration: 90ms;
}
@media (max-width: 1023px) {
  .nav__rec {
    inline-size: 44px;
    padding: 0;
    gap: 0;
  }
  .nav__rec .btn-rec__label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .nav__rec .btn-rec__dot {
    inline-size: 12px;
    block-size: 12px;
  }
}

/* ═══ 6. Burger (<1024) — a button with the bundle, a footer jump without ═══ */
.nav__burger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  margin-inline-end: -10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:is(.js-motion, .bundle-live) .page-home .site-nav:not(.is-solid) .nav__burger,
.has-hero .site-nav--over-hero .nav__burger {
  margin-inline-end: 0;
  background: color-mix(in srgb, var(--slab) 72%, transparent);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--on-slab) 26%, transparent);
}
.nav__burger-lines {
  display: grid;
  gap: 6px;
  inline-size: 22px;
}
.nav__burger-lines i {
  display: block;
  block-size: 2px;
  border-radius: 2px;
  background: currentColor;
}
.nav__burger-lines i:last-child {
  inline-size: 70%;
  justify-self: end;
}
.nav__burger--js,
html.bundle-live .nav__burger--nojs {
  display: none;
}
html.bundle-live .nav__burger--js {
  display: inline-flex;
}
@media (min-width: 1024px) {
  .nav__burger,
  html.bundle-live .nav__burger--js {
    display: none;
  }
}

/* ═══ 7. Story bar — nav.story (homepage only, FINAL-SPEC §3.2) ═══════════
   Nine segments under the bar, sticky with it. runtime.ts writes --seg-p on
   each a.story-seg, aria-current="step" on the active one and html.story-on
   past the cover. The visible line is 3px; each segment's hit area runs
   10px below the row (24px tall in all) without covering the bar's buttons. */
.story {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 3px;
  block-size: var(--ch-story-h);
  padding-inline: var(--ch-g);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 200ms var(--ch-ease-out),
    visibility 0s linear 200ms;
}
html.story-on .story {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms var(--ch-ease-out);
}
.story-seg {
  position: relative;
  flex: 1 1 0;
  min-inline-size: 0;
  block-size: calc(100% + 10px);
  border-radius: 2px;
}
.story-seg::before,
.story-seg::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 4px;
  block-size: 3px;
  border-radius: 2px;
}
.story-seg::before {
  background: var(--line);
}
.story-seg::after {
  background: var(--ink);
  transform: scaleX(var(--seg-p, 0));
  transform-origin: 0 50%;
}
:root[dir="rtl"] .story-seg::after {
  transform-origin: 100% 50%;
}
:root[data-theme="dark"] .story-seg::after {
  background: var(--yellow);
}
.story-seg:focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 2px;
}

/* the chapter a story segment moved focus to (nav.ts initStoryFocus) is a
   landmark focus target, like .site-main for the skip link — the next Tab
   lands on a real control inside it, which shows the ring */
.page-home section[data-story-focus]:focus {
  outline: none;
  box-shadow: none;
}

/* ═══ 8. The menu sheet (<1024) — div.nav-sheet[role=dialog] ═══════════════
   A full-screen --bg panel; a yellow slab wipes across its top (the slab
   primitive), the big links rise with a 40ms stagger, WhatsApp + proposal
   pills sit at the bottom. nav.ts: focus trap, Esc, aria-expanded, scroll
   lock on <html>, .is-open one frame after [hidden] drops. */
.nav-sheet {
  --sheet-drop: calc(100vw * var(--ch-slope));
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-skip) - 1);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block-end: max(20px, env(safe-area-inset-bottom));
}
.nav-sheet[hidden] {
  display: none;
}
html.sheet-open {
  overflow: hidden;
}
.nav-sheet__slab {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  block-size: calc(var(--ch-bar-h) + var(--sheet-drop));
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 0, 100% var(--ch-bar-h), 0 100%);
  pointer-events: none;
}
:root[dir="rtl"] .nav-sheet__slab {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 var(--ch-bar-h));
}
.nav-sheet__top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  block-size: var(--ch-bar-h);
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-inline: auto;
  color: var(--on-yellow);
}
.nav-sheet .nav-sheet__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  color: var(--on-yellow);
  text-decoration: none;
}
.nav-sheet .nav-sheet__brand svg {
  block-size: 28px;
  inline-size: auto;
  direction: ltr;
}
.nav-sheet .nav-sheet__brand .wordmark__latin {
  font-family: var(--ch-display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: inherit;
}
@media (min-width: 600px) {
  .nav-sheet .nav-sheet__brand svg {
    block-size: 32px;
  }
}
.nav-sheet__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  margin: 0;
  margin-inline-end: -10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav-sheet__close svg {
  inline-size: 24px;
  block-size: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.nav-sheet__close:focus-visible,
.nav-sheet .nav-sheet__brand:focus-visible {
  outline: 2px solid var(--on-yellow);
  outline-offset: 2px;
  box-shadow: none;
}
.nav-sheet__nav {
  position: relative;
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-inline: auto;
  padding-block-start: calc(var(--sheet-drop) - 4px);
}
.nav-sheet__links {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sheet;
}
.nav-sheet__links li {
  counter-increment: sheet;
  border-block-end: 1px solid var(--line);
}
.nav-sheet__links li:nth-child(2) {
  --i: 1;
}
.nav-sheet__links li:nth-child(3) {
  --i: 2;
}
.nav-sheet__links li:nth-child(4) {
  --i: 3;
}
.nav-sheet__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-block-size: 44px;
  padding-block: 14px 12px;
  font-family: var(--ch-display);
  font-weight: 860;
  font-stretch: 120%;
  font-size: clamp(2rem, 1.1rem + 4.2vw, 3.5rem);
  line-height: 0.94;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
}
.nav-sheet__link::before {
  content: "0" counter(sheet);
  flex: none;
  min-inline-size: 2.2em;
  font-family: var(--ch-ui);
  font-weight: 500;
  font-stretch: 100%;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  direction: ltr;
}
:lang(ar) .nav-sheet__link {
  font-family: var(--ch-ar-display);
  font-weight: 800;
  font-size: clamp(2.125rem, 1.15rem + 4.6vw, 3.75rem);
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  padding-block: 6px 8px;
}
.nav-sheet__link:active {
  color: var(--ink-muted);
}
.nav-sheet__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-inline: auto;
  padding-block: 18px 24px;
}
.nav-sheet__ctas {
  display: grid;
  gap: 10px;
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-block-start: auto;
  margin-inline: auto;
}
@media (min-width: 600px) {
  .nav-sheet__ctas {
    grid-template-columns: 1fr 1fr;
  }
}
.nav-sheet__ctas > a {
  min-block-size: 52px;
}
.nav-sheet__wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-inline: 20px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--ch-text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
:lang(ar) .nav-sheet__wa {
  font-family: var(--ch-ar-text);
  font-weight: 500;
  font-size: 16px;
}
.nav-sheet__wa svg {
  inline-size: 20px;
  block-size: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

/* QA 2026-10-27: on a landscape tablet/phone the 100vw-sized slab ate half
   the screen and pushed the CTAs below the fold — cap the drop by the height
   and tighten the links so links + tools + CTAs fit a 768px-tall screen */
.nav-sheet {
  --sheet-drop: min(100vw * var(--ch-slope), 30svh);
}
@media (orientation: landscape) and (max-height: 820px) {
  .nav-sheet {
    --sheet-drop: min(100vw * var(--ch-slope), 12svh);
  }
  .nav-sheet__link {
    font-size: clamp(1.75rem, 0.9rem + 4.4svh, 2.75rem);
    padding-block: 10px 8px;
  }
  :lang(ar) .nav-sheet__link {
    font-size: clamp(1.875rem, 0.95rem + 4.6svh, 2.875rem);
    padding-block: 2px 4px;
  }
  .nav-sheet__tools {
    padding-block: 10px 14px;
  }
}

/* open / close choreography — from-states only under js-motion */
html.js-motion .nav-sheet {
  opacity: 0;
  transition: opacity 180ms var(--ch-ease-out);
}
html.js-motion .nav-sheet.is-open {
  opacity: 1;
}
html.js-motion .nav-sheet__slab {
  transition: clip-path 520ms var(--ch-ease-wipe);
}
html.js-motion .nav-sheet:not(.is-open) .nav-sheet__slab {
  clip-path: polygon(0 0, 0 0, 0 var(--ch-bar-h), 0 100%);
}
html.js-motion[dir="rtl"] .nav-sheet:not(.is-open) .nav-sheet__slab {
  clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% var(--ch-bar-h));
}
html.js-motion .nav-sheet__links li,
html.js-motion .nav-sheet__tools,
html.js-motion .nav-sheet__ctas {
  transition:
    opacity 450ms var(--ch-ease-out),
    transform 650ms var(--ch-ease-out);
  transition-delay: calc(140ms + var(--i, 0) * 40ms);
}
html.js-motion .nav-sheet__tools {
  --i: 4;
}
html.js-motion .nav-sheet__ctas {
  --i: 5;
}
html.js-motion .nav-sheet:not(.is-open) .nav-sheet__links li,
html.js-motion .nav-sheet:not(.is-open) .nav-sheet__tools,
html.js-motion .nav-sheet:not(.is-open) .nav-sheet__ctas {
  opacity: 0;
  transform: translateY(24px);
  transition-delay: 0s;
  transition-duration: 160ms;
}
/* never on a wide screen: the full bar is back */
@media (min-width: 1024px) {
  .nav-sheet {
    display: none;
  }
}

/* ═══ 9. Footer — footer.site-footer.foot (FINAL-SPEC §3.5) ════════════════
   --slab in BOTH themes with --on-slab text; static. Brand lockup (slide 1),
   three link columns, the cover's corner lockups on the bottom row, a yellow
   corner slab cut at the page slope. */
.foot {
  position: relative;
  overflow: clip;
  margin-block-start: var(--deck-pad-block);
  background: var(--slab);
  color: var(--on-slab);
}
.page-home .foot {
  margin-block-start: 0;
}
.foot__slab {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: clamp(112px, 22vw, 340px);
  aspect-ratio: 1 / 0.325;
  background: var(--yellow);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  pointer-events: none;
}
:root[dir="rtl"] .foot__slab {
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.foot__in,
.foot__bottom-in {
  inline-size: min(100% - 2 * var(--ch-g), var(--ch-max));
  margin-inline: auto;
  zoom: var(--ui-zoom);
}
.foot__in {
  position: relative;
  display: grid;
  gap: 48px;
  padding-block: clamp(64px, 9vw, 120px) clamp(40px, 5vw, 72px);
}
@media (min-width: 900px) {
  .foot__in {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: clamp(40px, 5vw, 96px);
  }
}

/* ── brand lockup: عفوي / A F A W Y / للمحتوى العفوي, centred on the mark ── */
.foot__brand {
  display: flex;
}
.foot__lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.foot__lockup svg {
  block-size: clamp(96px, 13vw, 150px);
  inline-size: auto;
  direction: ltr;
}
.foot__latin {
  margin-block-start: 6px;
  padding-inline-start: 0.5em;
  font-family: var(--ch-display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(18px, 1.2vw + 10px, 26px);
  line-height: 1;
  letter-spacing: 0.5em;
}
.foot__arline {
  font-family: var(--ch-ar-text);
  font-weight: 500;
  font-size: clamp(18px, 1vw + 12px, 24px);
  line-height: 1.4;
  color: var(--ch-on-slab-2);
}

/* ── columns ── */
.foot__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 24px;
}
@media (min-width: 600px) {
  .foot__cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.foot__col--tools {
  grid-column: 1 / -1;
}
@media (min-width: 600px) {
  .foot__col--tools {
    grid-column: auto;
  }
}
.foot__col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot__h {
  margin: 0 0 10px;
  font-family: var(--ch-ui);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ch-on-slab-2);
}
:lang(ar) .foot__h {
  font-family: var(--ch-ar-text);
  font-size: 14px;
  letter-spacing: 0;
}
.foot__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-family: var(--ch-text);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25;
  color: inherit;
  text-decoration: none;
}
:lang(ar) .foot__link {
  font-family: var(--ch-ar-text);
  font-size: 18px;
}
.foot__link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 8px;
  block-size: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 260ms var(--ch-ease-out);
}
:root[dir="rtl"] .foot__link::after {
  transform-origin: 100% 50%;
}
@media (hover: hover) and (pointer: fine) {
  .foot__link:hover::after {
    transform: scaleX(1);
  }
}
.foot__link:focus-visible::after {
  transform: scaleX(1);
}
.foot__col--tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: start;
  gap: 4px 14px;
}
.foot__col--tools .foot__h {
  flex-basis: 100%;
}
.foot__col--tools .lang-toggle {
  margin-inline-start: -8px;
}
.foot :focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: none;
}

/* ── bottom row: FOR BUSINESS · للشركات | © | POWERED BY BAKER MEDIA ── */
.foot__bottom {
  border-block-start: 1px solid var(--ch-on-slab-line);
}
.foot__bottom-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 22px max(28px, env(safe-area-inset-bottom));
}
.foot__bottom p {
  margin: 0;
}
.foot__for {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.foot__for [lang="en"] {
  font-family: var(--ch-display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: 14px;
  letter-spacing: 0.08em;
}
.foot__for [lang="ar"] {
  font-family: var(--ch-ar-text);
  font-weight: 500;
  font-size: 16px;
}
.foot__copy {
  font-family: var(--ch-ui);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ch-on-slab-2);
}
:lang(ar) .foot__copy {
  font-family: var(--ch-ar-text);
  font-size: 14px;
  letter-spacing: 0;
}
.foot__powered {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.foot__powered-txt {
  display: grid;
  justify-items: end;
  gap: 3px;
}
.foot__powered-by {
  font-family: var(--ch-display);
  font-weight: 600;
  font-stretch: 110%;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ch-on-slab-2);
}
:lang(ar) .foot__powered-by {
  font-family: var(--ch-ar-text);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
}
.foot__baker {
  font-family: var(--ch-display);
  font-weight: 700;
  font-stretch: 112%;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.06em;
}
.foot__powered-rule {
  inline-size: 1px;
  block-size: 30px;
  background: var(--ch-on-slab-line);
}
.foot__powered .baker-mark {
  block-size: 26px;
  inline-size: auto;
  direction: ltr;
}
@media (max-width: 599px) {
  .foot__bottom-in {
    flex-direction: column;
    align-items: flex-start;
  }
  .foot__copy {
    order: 3;
  }
  .foot__powered-txt {
    justify-items: start;
  }
}

/* ═══ 10. Reduced motion: everything final, nothing loops ═══════════════════ */
@media (prefers-reduced-motion: reduce) {
  .site-nav::before,
  .site-nav::after,
  .nav__bar::before,
  .story,
  .tt__knob,
  .tt__knob svg,
  .btn-rec,
  .btn-rec::after,
  .btn-rec__dot,
  .nav__link::after,
  .foot__link::after {
    transition: none;
    animation: none;
  }
}

/* the 80px sentinel nav.ts observes for the cover hand-off */
.nav-sentinel {
  position: absolute;
  inset-block-start: 80px;
  inset-inline-start: 0;
  inline-size: 1px;
  block-size: 1px;
  visibility: hidden;
  pointer-events: none;
}

/* the skip link: ON RECORD's `.chip--ghost { position: relative }` (onrecord
   §7) was beating base.css's fixed position, so the off-screen link still took
   48px of flow at the top of every public page — pin it back to fixed */
.skip-link.chip--ghost {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: var(--z-skip);
}
