/* ==========================================================================
   HAZ MED v2
   One stylesheet, written mobile-first: every base rule IS the phone layout,
   and the only media queries are min-width. A desktop design that reflows down
   is how you end up with a 1,200px table on a 375px screen.

   Loaded after tokens.css, which carries the palette, the type scale and the
   verified contrast pairs.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. FONTS
   Self-hosted, subset by unicode-range so an English page never downloads the
   Arabic faces and vice versa. These were missing from the first build of this
   stylesheet: the <link rel=preload> was present but nothing declared the faces,
   so the browser warned "preloaded but not used" and every page silently fell
   back to system fonts. The preload warning was the only symptom.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/hazmed-plex-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/hazmed-plex-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/hazmed-plex-arabic-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}

/* --------------------------------------------------------------------------
   1. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The sticky header must not cover the target of an in-page link. */
  scroll-padding-block-start: 5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  /* --lh-normal was never defined, so this computed to `normal` (~1.2) and the
     Arabic override of 1.90 never reached any body text. The token is
     --lh-body. */
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video {
  display: block;
  max-inline-size: 100%;
  height: auto;
}

/* Inline icons carry no width/height attributes, so without an explicit size
   the rule above lets them grow to fill the parent. */
.btn svg, .nav__link svg, .card__more svg, .eyebrow svg {
  inline-size: 1.15em;
  block-size: 1.15em;
  flex: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }

:focus-visible {
  outline: 3px solid var(--focus-ring, var(--cyan-600));
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   2. LAYOUT
   -------------------------------------------------------------------------- */
:root {
  --gutter: 1.25rem;          /* 20px — the phone side margin */
  --measure-prose: 62ch;
  --radius: 14px;
  --hairline: color-mix(in srgb, var(--neutral-700) 13%, transparent);
  --section-y: clamp(3.5rem, 2rem + 7vw, 7.5rem);
}
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
  :root { --hairline: #DDE0E0; }
}
@media (min-width: 48rem) { :root { --gutter: 2rem; } }
@media (min-width: 80rem) { :root { --gutter: 3rem; } }

.wrap {
  inline-size: 100%;
  max-inline-size: 78rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--prose { max-inline-size: calc(var(--measure-prose) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--ink { background: var(--ink); color: var(--text-inverse-muted); }
.section--ink h1, .section--ink h2, .section--ink h3 { color: var(--text-inverse); }

/* A CARD IS A LIGHT SURFACE WHEREVER IT SITS.
   The rule above reached inside cards placed on an ink section and painted
   their headings white — on a white card. 30 card titles across the site were
   rendering at 1:1 contrast, i.e. completely invisible. A descendant selector
   on a section modifier cannot assume everything beneath it shares the
   section's background, so the card re-asserts its own text colours. */
.section--ink .card h1,
.section--ink .card h2,
.section--ink .card h3,
.section--ink .card .card__title { color: var(--text-strong); }
.section--ink .card .card__desc { color: var(--text-muted); }
.section--ink .card .eyebrow { color: var(--text-accent); }
.section--ink .card .eyebrow::before { background: var(--action-fill); }

/* The same fault, found by auditing the LIVE pages rather than a detached copy.
   Anything carrying a light-ground colour had to be re-stated on the ink
   sections, not just cards:
     .lead        --text-muted  #616B6B on #0E2830 = 2.80:1  (AA wants 4.50)
     table th/td  --text-strong #232727 on #0E2830 = 1.02:1  (effectively invisible)
   The table is handled by giving it its own light surface, which is what it
   already assumes: a data table is a light panel wherever it is placed, exactly
   like a card. That keeps one set of table colours instead of two. */
.section--ink .lead,
.section--ink .t-muted { color: var(--text-inverse-muted); }

.table-scroll { background: var(--surface); }
.section--ink .table-scroll { border-color: var(--border-inverse); }
/* Giving the table a light panel is only half of it: the cells still inherit
   `color` from .section--ink, so on an ink section every <td> was rendering
   --text-inverse-muted #D2D6D6 on the new white panel = 1.47:1. State the
   light-ground colours on the panel so nothing is inherited across the edge. */
.table-scroll { color: var(--text-strong); }
.section--ink table.data td,
.section--ink table.data caption { color: var(--text-strong); }
.section--ink table.data thead th { color: var(--text-muted); }
.section--ink table.data tbody th { color: var(--text-strong); }

/* Chips and notes are light components too. */
.section--ink .chip {
  color: var(--text-inverse-muted);
  background: transparent;
  border-color: var(--border-inverse);
}
.section--ink .note {
  background: var(--surface-inverse-2, #153A45);
  color: var(--text-inverse-muted);
}
.section--alt { background: var(--surface-alt); }
.section--line { border-block-start: 1px solid var(--hairline); }

/* A vertical rhythm utility, so spacing lives in one place. */
.stack > * + * { margin-block-start: var(--stack-space, 1rem); }
.stack--s  { --stack-space: 0.5rem; }
.stack--m  { --stack-space: 1.5rem; }
.stack--l  { --stack-space: 2.5rem; }

/* Auto-fitting grid: one column on a phone by definition, because the minimum
   track is capped at 100%. */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col, 18rem)), 1fr));
}
.grid--wide { --col: 24rem; }
.grid--narrow { --col: 13rem; }
@media (min-width: 48rem) { .grid { gap: 1.75rem; } }

/* --------------------------------------------------------------------------
   3. TYPE
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  /* Likewise --lh-tight: the display token is --lh-display. */
  line-height: var(--lh-display);
  text-wrap: balance;
  /* Arabic ascenders and diacritics need headroom. */
  padding-block-start: 0.02em;
}

.t-display {
  font-size: clamp(2.25rem, 1.3rem + 4.6vw, 4.5rem);
  letter-spacing: -0.022em;
  line-height: 1.04;
}
.t-h1 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.25rem); letter-spacing: -0.02em; }
.t-h2 { font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.25rem); letter-spacing: -0.016em; }
.t-h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.4rem); letter-spacing: -0.01em; }

/* Arabic is a joined script: spacing the letters severs the connections, so
   every tracking value above is cancelled rather than merely left unset. */
html[lang="ar"] .t-display,
html[lang="ar"] .t-h1,
html[lang="ar"] .t-h2,
html[lang="ar"] .t-h3 { letter-spacing: 0; }

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.3rem);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  max-inline-size: var(--measure-prose);
}
.t-sm { font-size: var(--fs-sm); }
.t-muted { color: var(--text-muted); }

/* The mono label. --font-mono carries no Arabic, so Arabic labels keep the
   Arabic face and take the treatment through weight and the rule instead. */
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0.4rem;
  gap: 0.75rem;
  line-height: 1.5;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-block-end: 1rem;
}
.eyebrow::before {
  content: "";
  inline-size: 1.75rem;
  block-size: 2px;
  background: var(--action-fill);
  flex: none;
}
/* Below the phone breakpoint a long label and a 1.75rem rule do not share a
   line; the rule takes its own row rather than being overlapped. */
@media (max-width: 26rem) {
  .eyebrow { display: block; }
  .eyebrow::before { display: block; margin-block-end: 0.6rem; }
}
html[lang="ar"] .eyebrow {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  text-transform: none;
  font-weight: var(--fw-semibold);
}
.section--ink .eyebrow,
/* The hero is an ink ground too, but it is .hero, not .section--ink, so it was
   never covered: --text-accent #0F7383 on the hero ink #0E2830 is 2.78:1. */
.hero .eyebrow { color: var(--text-inverse-accent); }
.section--ink .eyebrow::before,
.hero .eyebrow::before { background: var(--text-inverse-accent); }
/* ...except inside a card, which is a light panel wherever it sits. */
.section--ink .card .eyebrow::before { background: var(--action-fill); }

.prose p { max-inline-size: var(--measure-prose); }
.prose a { color: var(--text-accent); text-underline-offset: 0.18em; }

.code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
  background: var(--surface-tint);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  white-space: nowrap;
}
.num { font-variant-numeric: tabular-nums; }
/* Plex Sans Arabic is unicode-range subset to Arabic, so an unrouted Latin run
   falls through to Tahoma — and it hits exactly the strings that matter: order
   codes, 10,000 ppm, 1.67 g. */
html[lang="ar"] .num,
html[lang="ar"] bdi { font-family: var(--font-latin); }
html[lang="ar"] .code { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   4. HEADER — a phone drawer first, a bar only when there is room
   -------------------------------------------------------------------------- */
.hdr {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--hairline);
}
@supports not (backdrop-filter: blur(1px)) { .hdr { background: var(--surface); } }
.no-js .hdr { position: static; }

.hdr__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-block-size: 4rem;
}
.hdr__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: var(--fw-semibold);
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  text-decoration: none;
  flex: none;
}
.hdr__logo img { inline-size: 1.75rem; block-size: 1.75rem; }
html[lang="ar"] .hdr__logo { letter-spacing: 0; }

.hdr__tools { display: flex; align-items: center; gap: 0.5rem; }

/* Every control clears WCAG 2.5.8's 24px, with room to spare on a phone. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.btn-icon svg { inline-size: 1.25rem; block-size: 1.25rem; }

.nav { display: none; }
.nav__list { display: flex; gap: 0.25rem; align-items: center; }
.nav__link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav__link:hover { background: var(--surface-alt); color: var(--text-strong); }
.nav__link[aria-current="page"] { color: var(--text-accent); font-weight: var(--fw-medium); }

/* The drawer. Off-canvas on the inline-start edge, so it mirrors in RTL with no
   direction-specific rule. */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  transform: translateX(calc(var(--flip, 1) * -100%));
  visibility: hidden;
  transition: transform 260ms var(--ease-out), visibility 260ms;
}
.drawer[data-open="true"] { transform: none; visibility: visible; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-block-size: 4rem;
  border-block-end: 1px solid var(--hairline);
}
.drawer__body { overflow-y: auto; padding-block: 1.5rem 3rem; }
.drawer__link {
  display: block;
  padding: 0.9rem 0;
  font-size: 1.25rem;
  font-weight: var(--fw-medium);
  color: var(--text-strong);
  text-decoration: none;
  border-block-end: 1px solid var(--hairline);
}
.drawer__link--sub {
  font-size: 1rem;
  font-weight: var(--fw-regular);
  color: var(--text-muted);
  padding-inline-start: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}

@media (min-width: 62rem) {
  .nav { display: block; }
  .hdr__burger { display: none; }
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-block-size: 3rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--action-fill);
  color: var(--action-on-fill);
  border-color: var(--action-edge);
}
.btn--primary:hover { background: var(--action-fill-active); }
.btn--ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-alt); }
/* Any dark ground, not just .section--ink — the hero is dark too, and this rule
   missing it put --text-strong (near-black) on a dark photograph. */
.section--ink .btn--ghost,
.hero .btn--ghost {
  color: var(--text-inverse);
  /* --border-inverse is a hairline for panels; as a button edge on photography
     it is under the 3:1 that WCAG 1.4.11 wants for a control boundary. */
  border-color: var(--text-inverse-accent);
}
.section--ink .btn--ghost:hover,
.hero .btn--ghost:hover { background: rgb(255 255 255 / 0.1); }
.btn__arrow { transform: scaleX(var(--flip, 1)); flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
/* Full-width buttons on a phone: a 1.5rem-padded button in a 375px viewport
   leaves an awkward stub, and thumbs aim for edges. */
@media (max-width: 29.99rem) { .btn-row .btn { inline-size: 100%; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* --------------------------------------------------------------------------
   6. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--ink);
  color: var(--text-inverse-muted);
  padding-block: clamp(4rem, 2rem + 12vw, 9rem);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  /* The composition is abstract, so mirroring it in RTL is correct. */
  transform: scaleX(var(--flip, 1));
}
/* A legibility scrim, not decoration: the headline sits over photography.
   linear-gradient has no logical direction keywords, so the RTL variant is one
   of the few places a [dir] override is unavoidable. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Dense across the whole text column, then fading. The stop was at 42% with
     a 0.55 tail, which measured 4.05:1 for white — under AA. Text did not reach
     that far today, so it was a latent failure waiting for a longer headline. */
  background: linear-gradient(to right,
    rgb(14 40 48 / 0.94) 0%, rgb(14 40 48 / 0.88) 62%, rgb(14 40 48 / 0.62) 100%);
}
html[dir="rtl"] .hero__scrim {
  /* Dense across the whole text column, then fading. The stop was at 42% with
     a 0.55 tail, which measured 4.05:1 for white — under AA. Text did not reach
     that far today, so it was a latent failure waiting for a longer headline. */
  background: linear-gradient(to left,
    rgb(14 40 48 / 0.94) 0%, rgb(14 40 48 / 0.88) 62%, rgb(14 40 48 / 0.62) 100%);
}
/* On a phone the copy spans the full width, so a scrim that fades sideways
   leaves the right-hand end of every line over bare photography — the ghost
   button was the first thing to become unreadable. Below the tablet breakpoint
   it fades DOWNWARD instead and stays dense behind the text. */
@media (max-width: 47.99rem) {
  .hero__scrim,
  html[dir="rtl"] .hero__scrim {
    background: linear-gradient(to bottom,
      rgb(14 40 48 / 0.92) 0%, rgb(14 40 48 / 0.88) 55%, rgb(14 40 48 / 0.80) 100%);
  }
}
.hero__inner { max-inline-size: 46rem; }
.hero .t-display { color: var(--text-inverse); }
.hero .lead { color: var(--text-inverse-muted); max-inline-size: 38rem; }

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-block-start: 2.5rem;
  padding-block-start: 1.75rem;
  border-block-start: 1px solid var(--border-inverse);
}
.hero__fact {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-inverse-muted);
}
.hero__fact b {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: var(--fw-semibold);
  color: var(--text-inverse-accent);
  font-variant-numeric: tabular-nums;
}
html[lang="ar"] .hero__fact b { font-family: var(--font-latin); }

/* --------------------------------------------------------------------------
   7. CARDS
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__media { background: var(--surface-tint); aspect-ratio: 16 / 9; }
.card__media img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card__title { font-size: 1.125rem; }
.card__title a { color: inherit; text-decoration: none; }
/* The whole card is the hit area, which is what a thumb expects — but the link
   text stays the accessible name. */
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card__desc { color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-relaxed); }
/* A <dt> cannot hold a heading element, so it takes the card-title treatment
   directly; without this it renders in the body face at normal weight. */
dt.card__title {
  font-family: var(--font-head);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: var(--lh-heading);
}

/* Labelled contact rows. .card__more cannot be repeated for this: it carries
   margin-block-start:auto, and two auto margins in one flex column split the
   free space, floating the first row into the middle of the card. */
.card__links {
  margin-block-start: auto;
  padding-block-start: 0.5rem;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: center;
  font-size: var(--fs-sm);
}
.card__links dt { color: var(--text-muted); }
.card__links a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;   /* 44px, matching .btn-icon — WCAG 2.5.8 */
  color: var(--text-accent);
  font-weight: var(--fw-medium);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;   /* last resort, after the <wbr> at the @ */
}
.card__links a:hover { color: var(--text-accent-hover); }
.section--ink .card__links dt { color: var(--text-muted); }

.card__more {
  margin-block-start: auto;
  padding-block-start: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
@media (hover: hover) and (pointer: fine) {
  .card { transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
  .card:hover { border-color: var(--action-edge); transform: translateY(-2px); }
  .card:hover .card__media img { transform: scale(1.03); }
  .card__media img { transition: transform 320ms var(--ease-out); }
}
.card:focus-within { border-color: var(--action-edge); }

/* A numbered step. The number is decorative — the heading carries the order. */
.step { display: flex; gap: 1rem; }
.step__n {
  flex: none;
  inline-size: 2.5rem;
  block-size: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--action-edge);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-accent);
  font-variant-numeric: tabular-nums;
}
.section--ink .step__n { border-color: var(--text-inverse-accent); color: var(--text-inverse-accent); }
html[lang="ar"] .step__n { font-family: var(--font-latin); }

/* --------------------------------------------------------------------------
   8. TABLES — scrollable on a phone, and announced as such
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.table-scroll:focus-visible { outline-offset: 0; }
table.data {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  /* Below this the columns wrap into noise; the container scrolls instead. */
  min-inline-size: 34rem;
}
table.data th, table.data td {
  padding: 0.8rem 1rem;
  text-align: start;
  border-block-end: 1px solid var(--hairline);
  vertical-align: top;
}
table.data thead th {
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
html[lang="ar"] table.data thead th {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  text-transform: none;
}
table.data tbody tr:last-child th,
table.data tbody tr:last-child td { border-block-end: 0; }
table.data tbody th { font-weight: var(--fw-medium); color: var(--text-strong); }
/* An isolated value is a single unit of meaning — "1 tab / 10 L" broken across
   two lines reads as two different figures. The container scrolls, so there is
   no reason to wrap inside a cell. */
table.data bdi { white-space: nowrap; }
table.data th, table.data td { white-space: nowrap; }
/* Prose columns may wrap; only the data must not. */
table.data td:not(:has(bdi)):not(:has(.code)) { white-space: normal; min-inline-size: 9rem; }
@supports not selector(:has(*)) {
  table.data th, table.data td { white-space: normal; }
  table.data bdi, table.data .code { white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.ftr { background: var(--ink); color: var(--text-inverse-muted); padding-block: 3.5rem 2rem; }
.ftr a { color: var(--text-inverse-muted); text-decoration: none; }
.ftr a:hover { color: var(--text-inverse); text-decoration: underline; }
.ftr__grid { display: grid; gap: 2.5rem; }
@media (min-width: 48rem) { .ftr__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.ftr__h {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse-accent);
  margin-block-end: 1rem;
}
html[lang="ar"] .ftr__h { font-family: var(--font-arabic); letter-spacing: 0; text-transform: none; }
.ftr__list li + li { margin-block-start: 0.6rem; }
.ftr__list a { display: inline-block; padding-block: 0.2rem; font-size: var(--fs-sm); }
/* Footer links are small type by design, so they need the hit area rather than
   a larger font: measured 19px and 17px tall before this. */
.ftr a {
  display: inline-block;
  padding-block: 0.35rem;
  min-block-size: 1.5rem;
}
.ftr__bottom {
  margin-block-start: 3rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border-inverse);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   10. MOTION
   Gated behind `.js` so nothing is hidden when scripting is off, and switched
   OFF — not shortened — under prefers-reduced-motion. A vestibular trigger is
   not made safe by making it quicker.
   -------------------------------------------------------------------------- */
/* REVEAL IS A TRANSITION, NOT AN ANIMATION, and the distinction is the whole
   reason this works.

   A CSS animation overrides author declarations for as long as it is active or
   filling. With `animation-fill-mode: both` that includes before it starts — so
   anywhere animations do not advance (a throttled tab, a prerender, an embedded
   webview, the preview pane this was built in) the element holds the 0% keyframe
   forever and the copy is invisible. Declaring `opacity: 1` alongside does not
   help, because the animation origin outranks it.

   A transition has no such hold. It applies only to a change between two
   declared states, so if it never runs the element is simply AT the end state.
   The worst case is content appearing without motion, which is the correct
   worst case.
   -------------------------------------------------------------------------- */
.anim [data-anim] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 620ms var(--ease-out-firm), transform 620ms var(--ease-out-firm);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.anim [data-anim].is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}
.anim [data-anim="fade"] { transform: none; }

/* A rule that draws itself under a section heading. */
.rule {
  block-size: 2px;
  background: var(--action-fill);
  inline-size: 3rem;
  transform-origin: left center;
  margin-block-end: 1.25rem;
}
html[dir="rtl"] .rule { transform-origin: right center; }
.anim .rule {
  transform: scaleX(0);
  transition: transform 520ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.anim .is-in .rule,
.anim .rule.is-in { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .anim [data-anim],
  .anim [data-anim].is-in,
  .anim .rule,
  .anim .is-in .rule,
  .anim .rule.is-in {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   11. UTILITIES
   -------------------------------------------------------------------------- */
.sr-only:not(:focus):not(:active) {
  clip-path: inset(50%);
  block-size: 1px; inline-size: 1px;
  overflow: hidden; position: absolute; white-space: nowrap;
}
.skip {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--action-edge);
  border-radius: 8px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--surface);
}
.note {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-alt);
  border-inline-start: 3px solid var(--action-fill);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
html[dir="rtl"] .note { border-radius: var(--radius) 0 0 var(--radius); }
