/* Bumelerze website, one shared stylesheet (2026-10 redesign).
 * Plain CSS, custom properties for tokens, logical properties throughout so
 * every rule mirrors under dir="rtl" (Sorani, Arabic) with no separate RTL
 * stylesheet. The HTML is generated from website-src/ by
 * scripts/build-website.mjs; this file is hand-written and shared by all
 * pages. The build stamps its content hash into every page (?v=...), so a
 * change here needs `npm run build:site` before committing.
 *
 * ================================================================
 * TOKENS: source of truth is the owner's logo package
 * (assets/brand/tokens/bumelerze-colors.json):
 *   Signal Red #C8202F, Warm Ivory #FFF5E8, Endpoint Gold #F2B632,
 *   Wordmark Ink #0B1219, Approved Navy #071D2B, Off-White #FBF7F0.
 * This is a BRAND surface: unlike the app's in-product chrome it uses the
 * full brand palette, Signal Red included.
 *
 * Measured WCAG contrast (relative-luminance formula), not eyeballed:
 *
 * LIGHT THEME (default)
 *   ink #0B1219 on white / ivory / off-white      18.84 / 17.47 / 17.64 (AAA)
 *   signal red on white / ivory / off-white        5.67 / 5.26 / 5.31  (AA)
 *   --muted #686C70 on white / ivory / off-white   5.29 / 4.91 / 4.96  (AA)
 *   white on signal red (primary button)           5.67                (AA)
 *   white on #A81A27 (pressed/hover button)        7.39                (AAA)
 *   white on #D32F0C (class-A chip, 16 px bold)     5.02                (AA)
 *   endpoint gold on white                         1.82  FAILS: gold is
 *     decorative only on light surfaces (the bead on the seismic line), never
 *     text and never a focus ring there.
 *
 * DARK THEME (prefers-color-scheme: dark), built on Approved Navy so both
 * themes are the brand. Night earthquakes are common: dark is a first-class
 * theme, not an inversion.
 *   ivory on navy #071D2B / alt #0F2737 / card #16303F   15.97 / 14.26 / 12.74
 *   --muted #9BA3A6 on navy / alt / card                  6.71 / 5.99 / 5.35
 *   --red-text #E18082 on navy / alt / card               6.24 / 5.57 / 4.98
 *     (raw signal red on navy is only 3.04:1, so in dark theme it is used
 *     for fills, borders and icons only; every red TEXT resolves to
 *     --red-text)
 *   endpoint gold on navy (focus ring)                    9.44
 *
 * FOOTER: Approved Navy with the reversed ivory logo in the light theme. In
 * the dark theme it drops to #04121C so it still reads as a separate band
 * under the navy page (and the skyline above it stays visible).
 *   ivory on #071D2B / #04121C                            15.97 / 17.57
 *   --footer-muted #9BA3A6 on #071D2B / #04121C           6.71 / 7.38
 *   --footer-link #E8898C on #071D2B / #04121C            6.88 / 7.57
 *   endpoint gold (footer focus ring) on #071D2B / #04121C 9.44 / 10.39
 *
 * FIGURE COLOURS that are data, not theme: the hazard-zone fills (handbook
 * map) and the intensity legend swatches (the app's intensityRamp,
 * src/theme/palette.ts). Legend numerals are ink on the swatch: ink on the
 * lightest (IV #A1D7E3) 11.97, on the darkest shown (VIII #E9872D) 7.15.
 * Intensity and magnitude are never encoded by colour alone: every swatch
 * carries its numeral, every magnitude is a number.
 * ================================================================
 */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/vazirmatn-400.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/vazirmatn-700.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #fff5e8; /* warm ivory */
  --bg-soft: #fbf7f0; /* off-white */
  --card: #ffffff;
  --ink: #0b1219;
  --muted: #686c70;
  --red: #c8202f; /* fills, borders, icons */
  --red-strong: #a81a27;
  --red-text: #c8202f; /* red used as text */
  --gold: #f2b632; /* decorative only on light surfaces */
  --border: rgba(11, 18, 25, 0.12);
  --border-strong: rgba(11, 18, 25, 0.24);
  --focus: #c8202f;
  --shadow: 0 22px 44px -26px rgba(7, 29, 43, 0.45);
  --ok: #1f7a4d; /* 5.32:1 on white */
  --phone-bezel: #0b1219;
  --phone-edge: rgba(11, 18, 25, 0);
  --scope-bg: #071d2b;

  --footer-bg: #071d2b;
  --footer-text: #fff5e8;
  --footer-muted: #9ba3a6;
  --footer-link: #e8898c;
  --footer-border: rgba(255, 245, 232, 0.14);
  --sky-far: #d3d9dc;
  --sky-mid: #a3afb6;

  --zone-1: #c3c7ca;
  --zone-2: #e4f2c4;
  --zone-3: #f5e04a;
  --zone-4: #f0a12f;
  --zone-5: #d8322e;

  --max: 72rem;
  --pad: 1.25rem;
  --radius: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071d2b; /* approved navy */
    --bg-alt: #0f2737;
    --bg-soft: #0f2737;
    --card: #16303f;
    --ink: #fff5e8;
    --muted: #9ba3a6;
    --red: #c8202f;
    --red-strong: #a81a27;
    --red-text: #e18082;
    --border: rgba(255, 245, 232, 0.14);
    --border-strong: rgba(255, 245, 232, 0.28);
    --focus: #f2b632;
    --shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.7);
    --ok: #3dbe7e;
    --phone-bezel: #000000;
    --phone-edge: rgba(255, 245, 232, 0.2);
    --scope-bg: #04121c;

    --footer-bg: #04121c;
    --sky-far: #143247;
    --sky-mid: #0c2737;

    --zone-1: #7c8388;
    --zone-2: #a9c47f;
    --zone-3: #cbb43a;
    --zone-4: #c08430;
    --zone-5: #b8322f;
  }
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Vazirmatn",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    "Noto Sans Arabic",
    Arial,
    sans-serif;
  font-size: 1.0625rem; /* 17px: body text never below 16px */
  line-height: 1.6;
  overflow-x: clip;
  overflow-wrap: break-word; /* long Kurdish words at 200% text size */
}

/* Arabic-script pages: taller lines so the marks above and below ڵ ڕ ێ ۆ
 * never touch the next line, headings included. */
html[dir="rtl"] body {
  line-height: 1.8;
}

html[dir="rtl"] :is(h1, h2, h3) {
  line-height: 1.6;
  letter-spacing: 0;
}

img,
svg,
canvas {
  max-width: 100%;
}

img {
  display: block;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  /* The vw cap only bites at large text settings on narrow phones, where
   * it keeps long Kurdish words whole instead of breaking them. */
  font-size: min(clamp(2.15rem, 1.5rem + 3vw, 3.5rem), 12.5vw);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.6rem, 1.25rem + 1.6vw, 2.35rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--red-text);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.lede {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  color: var(--muted);
  margin-block-start: 0.85rem;
  max-width: 34rem;
  text-wrap: pretty;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 0;
  transform: translateY(-110%);
  z-index: 100;
  background: var(--red);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

/* -------------------------------------------------------------- buttons */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem; /* 48px touch target */
  padding: 0.65rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.btn-primary {
  background: var(--red);
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:active {
  background: var(--red-strong);
  color: #ffffff;
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-lg {
  min-height: 3.5rem;
  padding-inline: min(2.2rem, 6vw);
  font-size: 1.15rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.arrow::before {
  content: "→";
}

html[dir="rtl"] .arrow::before {
  content: "←";
}

/* --------------------------------------------------------------- header */

.site-header {
  background: var(--bg);
  border-block-end: 1px solid var(--border);
}

.site-header-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: 0.6rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.brand-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  border-radius: 6px;
}

/* The wordmark is never mirrored on RTL pages: it is not a directional icon. */
.brand-logo {
  height: 30px;
  width: auto;
}

.header-nav-group {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.7rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--bg-alt);
}

.site-nav a[aria-current="page"] {
  color: var(--red-text);
  box-shadow: inset 0 -3px 0 var(--red);
  border-radius: 0.7rem 0.7rem 0 0;
}

/* Language menu: a native <details>, so it works with no script; site.js
 * only closes it on an outside click or Escape. */
.lang-menu {
  position: relative;
}

.lang-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary::after {
  content: "";
  width: 0.42em;
  height: 0.42em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
}

.lang-menu[open] summary::after {
  transform: translateY(20%) rotate(225deg);
}

.lang-globe {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.lang-menu .lang-switcher-inline {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 0.35rem);
  z-index: 20;
  min-width: min(11rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  padding: 0.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

/* Items keep their own dir for shaping but line up on the page's side. */
.lang-menu .lang-switcher-inline a {
  display: block;
  min-height: 2.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

html[dir="ltr"] .lang-menu .lang-switcher-inline a {
  text-align: left;
}

html[dir="rtl"] .lang-menu .lang-switcher-inline a {
  text-align: right;
}

.lang-menu .lang-switcher-inline a:hover {
  background: var(--bg-alt);
}

/* Navigation never wraps. From 48rem up, the three links (Home, How it
 * works, Support; Handbook and About live in the footer and in page links)
 * sit in one row with the logo and the language button; below it they move behind a menu button (a native <details>, so it
 * works without script) styled like the language button. Exactly one of the
 * two is displayed, so assistive tech sees one site nav at a time. */
.site-header-inner {
  /* one row at every normal text size; only very large text wraps the
   * menu and language buttons under the logo instead of overflowing */
  flex-wrap: wrap;
}

.header-nav-group {
  flex-wrap: nowrap;
}

.site-nav--row {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-menu {
  position: relative;
  display: none;
}

.nav-menu summary,
.lang-menu summary {
  white-space: nowrap;
}

.nav-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  justify-content: center;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu[open] summary {
  border-color: var(--ink);
}

.nav-burger {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-panel {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 0.35rem);
  z-index: 20;
  min-width: min(13rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  padding: 0.3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

.nav-panel a {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.6rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.nav-panel a:hover {
  background: var(--bg-alt);
}

.nav-panel a[aria-current="page"] {
  background: var(--bg-alt);
  color: var(--red-text);
}

@media (max-width: 47.99rem) {
  .site-nav--row {
    display: none;
  }

  .nav-menu {
    display: block;
  }
}

@media (max-width: 33.99rem) {
  /* Phones: the menu button shows only its icon (name kept for screen
   * readers and as a tooltip), so logo, menu and language share one row. */
  .site-header-inner {
    column-gap: 0.5rem;
  }

  .header-nav-group {
    gap: 0.4rem;
  }

  .nav-menu-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .nav-menu summary,
  .lang-menu summary {
    padding-inline: 0.6rem;
    gap: 0.3rem;
  }
}

@media (max-width: 29.99rem) {
  /* Small phones: the language button shows only its globe too. */
  .brand-logo {
    height: 26px;
  }

  .lang-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ------------------------------------------------------- seismic line */
/* The logo's mountain-and-waveform motif, the thread through the page. It
 * reads in the direction of the text: mirrored on RTL pages. */

.seismic-line {
  display: block;
  width: 100%;
  height: auto;
  color: var(--red);
  overflow: visible;
}

.seismic-line .dot {
  fill: var(--gold);
}

html[dir="rtl"] .seismic-line {
  transform: scaleX(-1);
}

/* Draw-in when it scrolls into view; only when site.js is running and the
 * reader has not asked for reduced motion (site.js checks both). */
.js-draw .act-line .seismic-line path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.js-draw .act-line .seismic-line .dot {
  opacity: 0;
}

.js-draw .act-line.is-drawn .seismic-line path {
  transition: stroke-dashoffset 1.6s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-dashoffset: 0;
}

.js-draw .act-line.is-drawn .seismic-line .dot {
  transition: opacity 0.3s 1.2s;
  opacity: 1;
}

/* ----------------------------------------------------------------- hero */

.hero {
  background: var(--bg-alt);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

.hero-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: center;
}

@media (min-width: 60rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 3.5rem;
  }
}

.hero .lede {
  color: var(--ink);
}

/* Live card: the latest earthquake near Kurdistan, filled in by site.js. */
.live {
  background: var(--card);
  border: 1px solid var(--border);
  border-inline-start: 5px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.15rem;
  box-shadow: var(--shadow);
}

.live-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-block-end: 0.35rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
}

.live-dot {
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--red);
  animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 32, 47, 0.55);
  }
  70%,
  100% {
    box-shadow: 0 0 0 0.6rem rgba(200, 32, 47, 0);
  }
}

.live-body {
  /* holds the card's height (one slide plus the controls row) while loading:
   * no layout shift when the slides arrive */
  min-height: 12.5rem;
  display: flex;
  flex-direction: column;
}

.live-track {
  flex: 1;
}

.live-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-block-start: 0.5rem;
  padding-block-start: 0.6rem;
  border-block-start: 1px solid var(--border);
}

.live-step {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.live-step:hover {
  border-color: var(--ink);
}

/* Arrows follow the reading direction. */
.live-prev::before {
  content: "←";
}

.live-next::before {
  content: "→";
}

html[dir="rtl"] .live-prev::before {
  content: "→";
}

html[dir="rtl"] .live-next::before {
  content: "←";
}

.live-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}

/* 44 px hit area (like the arrows), a 0.6 rem visual dot */
.live-dot-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.live-dot-btn::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
}

.live-dot-btn[aria-current="true"]::before {
  background: var(--red);
  border-color: var(--red);
}

.live-card {
  display: grid;
  gap: 0.15rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 0.6rem;
}

.live-mag {
  font-size: clamp(2.3rem, 2rem + 1.5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.15;
}

.live-place {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
}

.live-meta {
  color: var(--muted);
  font-size: 1rem;
}

.live-open {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  min-height: 2.75rem;
  color: var(--red-text);
  font-weight: 700;
}

.live-card:hover .live-open {
  text-decoration: underline;
}

.live-fallback {
  color: var(--muted);
  padding-block: 1rem;
}

.live-skeleton {
  display: grid;
  gap: 0.6rem;
  padding-block: 0.4rem;
}

.live-skeleton span {
  display: block;
  height: 1rem;
  width: 70%;
  border-radius: 0.5rem;
  background: linear-gradient(
    90deg,
    var(--bg-alt) 25%,
    var(--border) 50%,
    var(--bg-alt) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.live-skeleton span:first-child {
  height: 2.4rem;
  width: 45%;
}

.live-skeleton span:last-child {
  width: 40%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ----------------------------------------------------------- acts */
/* Act header: the logo's seismic line edge to edge, its blip centred and
 * the gold bead at the end, then the act's number and name. A plain act
 * (line only) separates the later parts without a label. */

.act {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(1.75rem, 1.25rem + 2vw, 3rem);
  text-align: center;
  background: var(--bg);
}

.act--plain {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.act-line {
  width: 100%;
}

/* Fixed height with "slice" scaling: the blip stays centred and legible on
 * a phone while the line itself runs to both edges. */
.act-line .seismic-line {
  height: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  overflow: hidden;
}

.act-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-block-start: clamp(1rem, 2vw, 1.5rem);
  padding-inline: var(--pad);
  font-size: clamp(1.7rem, 1.25rem + 1.8vw, 2.6rem);
}

.act-num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red-text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

/* Bands: every feature is its own full-width band, alternating ground,
 * with a hairline between, so each reads as a separate moment. */
.band {
  background: var(--bg);
  border-block-start: 1px solid var(--border);
}

.band--alt {
  background: var(--bg-alt);
}

.act + .band {
  border-block-start-color: transparent;
}

/* ---------------------------------------------------------- features */
/* Headline + one line + one figure. Two columns from tablet width, the
 * figure alternating sides; stacked text-first on phones. */

.feature {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(3rem, 2rem + 4vw, 5.5rem) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .feature {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2.5rem, 5vw, 5rem);
  }

  .feature--flip {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }

  .feature--flip .feature-fig {
    order: -1;
  }

  .feature--stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }
}

.feature-fig {
  min-width: 0;
  margin: 0;
}

/* Phone frame: drawn in CSS around a plain screenshot, so swapping the
 * screen is swapping one image file. */
.phone {
  position: relative;
  width: min(15rem, 66vw);
  margin-inline: auto;
  padding: 1.35rem 0.55rem 0.7rem;
  border-radius: 2.3rem;
  background: var(--phone-bezel);
  box-shadow:
    0 0 0 1px var(--phone-edge),
    var(--shadow),
    0 8px 16px -10px rgba(7, 29, 43, 0.35);
}

.phone::before {
  content: "";
  position: absolute;
  inset-block-start: 0.48rem;
  left: 36%;
  width: 28%;
  height: 0.42rem;
  border-radius: 1rem;
  background: #26313c;
}

.phone img {
  width: 100%;
  aspect-ratio: 540 / 1169;
  border-radius: 1.75rem 1.75rem 1.5rem 1.5rem;
  background: var(--bg-soft);
}

/* felt: the six-picture strip */
.felt-q {
  font-weight: 700;
  font-size: 1.1rem;
}

.felt-strip {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 48rem) {
  .felt-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.9rem;
  }
}

.felt-btn {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.45rem 0.7rem;
  border: 2px solid var(--border);
  border-radius: 1.1rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.felt-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.felt-btn[aria-pressed="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 32, 47, 0.25);
}

.felt-btn img {
  width: 100%;
  max-width: 8.5rem;
  aspect-ratio: 1;
}

.felt-num {
  position: absolute;
  inset-block-start: 0.4rem;
  inset-inline-start: 0.4rem;
  min-width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
}

.felt-label {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.felt-sent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  min-height: 3rem;
  margin-block-start: 1rem;
  visibility: hidden;
}

.felt-sent.is-on {
  visibility: visible;
}

.felt-check {
  flex: none;
  width: 2rem;
  height: 2rem;
}

.felt-check circle {
  fill: var(--ok);
}

.felt-check path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 0;
}

.felt-sent.is-on .felt-check {
  animation: pop 0.35s ease-out;
}

.felt-sent.is-on .felt-check path {
  animation: tick 0.45s 0.1s ease-out backwards;
}

@keyframes pop {
  from {
    transform: scale(0.6);
  }
}

@keyframes tick {
  from {
    stroke-dashoffset: 16;
  }
}

.felt-thanks {
  font-weight: 700;
  font-size: 1.1rem;
}

.felt-note {
  color: var(--muted);
  font-size: 1rem;
}

/* safe: the family stands in front of the phone */
.safe-fig {
  display: grid;
  align-items: end;
}

.safe-fig > * {
  grid-area: 1 / 1;
}

.safe-fig .phone {
  justify-self: end;
  margin-inline: 0 4%;
  width: min(13.5rem, 50vw);
}

.safe-family {
  position: relative;
  z-index: 1;
  justify-self: start;
  width: 74%;
  max-width: 28rem;
  aspect-ratio: 600 / 420;
}

/* maps: SHAKEmap + catalogue */
.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.map-frame img {
  width: 100%;
}

.map-fig figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1.25rem;
  margin-block-start: 0.85rem;
  color: var(--muted);
  font-size: 1rem;
}

.legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.intensity-legend {
  list-style: none;
  display: flex;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0.45rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.intensity-legend li {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.1rem 0.45rem;
  background: var(--swatch);
  color: #0b1219;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

/* building: pictograms + vulnerability-class bar */
.building-fig {
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

/* Vulnerability figure: four building pictograms in one even row, then
 * the A-F scale as a separate row. Logical order, so mud walls and A sit on
 * the reading-start side in every language. */
.vc-tiles,
.vc-scale {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.vc-figure {
  container-type: inline-size;
}

/* Four columns sized to their labels and spread across the row with equal
 * space between them: labels wrap only between words when they must, and
 * never overlap. */
.vc-tiles {
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  gap: 1.25rem 0.5rem;
  align-items: start;
  margin-block-end: 1.5rem;
}

.vc-tiles li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.3;
  text-wrap: balance;
}

.vc-tiles svg {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--ink);
}

/* Very large text on a phone: two by two instead of a squeezed row. */
@container (max-width: 15rem) {
  .vc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vc-tiles li {
    overflow-wrap: break-word;
  }
}

.vc-scale {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.vc-scale li {
  display: grid;
  place-items: center;
  min-height: 3rem;
  border-radius: 0.8rem;
  font-weight: 700;
  font-size: 1.35rem;
}

/* The owner's class colours (Tag my building's A-F badges). Large bold
 * letters: white on A, E, F; ink on B, C, D. */
.vc-a {
  background: #d32f0c;
  color: #ffffff;
}
.vc-b {
  background: #f3a3a2;
  color: #1c1b1f;
}
.vc-c {
  background: #dff3ae;
  color: #1c1b1f;
}
.vc-d {
  background: #aaadfc;
  color: #1c1b1f;
}
.vc-e {
  background: #545ff9;
  color: #ffffff;
}
.vc-f {
  background: #58135b;
  color: #ffffff;
}

.vc-ends {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-block-start: 0.55rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

/* hazard-zone map (home mini + handbook hero) */
.hb-mini {
  display: flex;
  justify-content: center;
}

.hb-mini-link {
  display: block;
  width: min(19rem, 66%);
}

.hb-mini svg,
.hb-map svg {
  display: block;
  width: 100%;
  height: auto;
}

:is(.hb-mini, .hb-map) path {
  stroke-width: 0.8;
}

:is(.hb-mini, .hb-map) .z1 {
  fill: var(--zone-1);
  stroke: var(--zone-1);
}
:is(.hb-mini, .hb-map) .z2 {
  fill: var(--zone-2);
  stroke: var(--zone-2);
}
:is(.hb-mini, .hb-map) .z3 {
  fill: var(--zone-3);
  stroke: var(--zone-3);
}
:is(.hb-mini, .hb-map) .z4 {
  fill: var(--zone-4);
  stroke: var(--zone-4);
}
:is(.hb-mini, .hb-map) .z5 {
  fill: var(--zone-5);
  stroke: var(--zone-5);
}

/* A map is not a directional icon: never mirrored on RTL pages. */
.hb-pin circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.hb-pin circle:first-child {
  stroke-width: 1;
  opacity: 0.35;
}

.hb-pin .hb-pin-dot {
  fill: var(--ink);
  stroke: none;
}

/* sensor: a seismograph-style panel */
.scope {
  padding: clamp(0.6rem, 2vw, 1rem);
  border-radius: var(--radius);
  background: var(--scope-bg);
  border: 1px solid var(--border);
}

.scope canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 300;
}

.stations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-block-start: 1.1rem;
}

.stations-num {
  font-size: clamp(3rem, 2.4rem + 2vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--red-text);
}

.stations-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.stations-label svg {
  width: 1.1rem;
  fill: var(--red);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.text-link--quiet {
  color: var(--muted);
}

/* Outlook (Home), What comes next (How it works), roadmap aims (About):
 * one shared list of three goals, each with its icon. */
.outlook {
  padding: clamp(1rem, 2vw, 2rem) var(--pad);
}

.outlook-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--bg-alt);
  text-align: center;
}

.outlook-inner .lede {
  margin-inline: auto;
  max-width: 40rem;
}

.outlook-inner .btn {
  margin-block-start: 1.75rem;
}

.goals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  text-align: start;
}

/* Home: three light items in one row (stacked on phones): icon, title and
 * one short line, no cards, plenty of air. */
.goals--row {
  margin-block-start: 2.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 2rem 2.5rem;
  max-width: 62rem;
  margin-inline: auto;
}

.goals--row .goal {
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: center;
}

.goals--row .goal-text {
  flex: none;
  width: 100%;
}

.goals--row .goal-icon {
  background: var(--card);
}

.goals--long {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

/* Flex with wrap, not a fixed two-column grid: when the card is too narrow
 * (small phone at very large text) the text drops below its icon instead of
 * being squeezed to nothing. */
.goal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.goal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--red-text);
}

.goal-text {
  flex: 1 1 9rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.goal-title {
  display: block;
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
  line-height: 1.4;
}

.goal p {
  margin-block: 0.3rem 0;
  color: var(--muted);
}

.goals--long .goal p {
  color: var(--ink);
}

.next-closing {
  max-width: 44rem;
}

/* -------------------------------------------------------- how it works */

.page-hero {
  background: var(--bg-alt);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.page-hero .wrap {
  max-width: var(--max);
}

.page-hero .lede {
  color: var(--ink);
  max-width: 40rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-block-end: 1rem;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red-text);
  font-weight: 700;
  line-height: 1;
}

.hiw .feature-text h2 {
  font-size: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem);
}

.body-text {
  margin-block-start: 0.9rem;
  max-width: 36rem;
  font-size: 1.125rem;
  text-wrap: pretty;
}

/* Data-flow diagram. Labels are HTML; arrows are text glyphs placed
 * between the boxes and swapped for the reading direction. Phones: one
 * column, felt reports beside the SHAKEmap box. Wider: one row. */
.flow {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
}

.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-areas:
    "net ."
    "feed ."
    "shake rep"
    "dmg .";
  gap: 2.5rem 2rem;
}

.flow-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 1.1rem;
  background: var(--card);
  text-align: center;
}

.flow-networks {
  grid-area: net;
}

.flow-feed {
  grid-area: feed;
}

.flow-shake {
  grid-area: shake;
  border-color: var(--red);
}

.flow-damage {
  grid-area: dmg;
}

.flow-reports {
  grid-area: rep;
  border-style: dashed;
}

.flow-icon svg {
  display: block;
  width: 2.4rem;
  height: 2.4rem;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-icon .fill {
  fill: var(--red);
  stroke: none;
}

.flow-label {
  overflow-wrap: anywhere;
  font-weight: 700;
  line-height: 1.35;
}

.flow-sub {
  color: var(--muted);
  font-size: 1rem;
}

.flow-node::after {
  position: absolute;
  color: var(--red-text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.flow-networks::after,
.flow-feed::after,
.flow-shake::after {
  content: "↓";
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
}

.flow-reports::after {
  content: "←";
  top: 50%;
  right: calc(100% + 0.4rem);
  transform: translateY(-50%);
}

html[dir="rtl"] .flow-reports::after {
  content: "→";
  right: auto;
  left: calc(100% + 0.4rem);
}

@media (min-width: 52rem) {
  .flow-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas:
      "net feed shake dmg"
      ". . rep .";
    gap: 2.5rem 2.5rem;
  }

  .flow-networks::after,
  .flow-feed::after,
  .flow-shake::after {
    content: "→";
    top: 50%;
    left: calc(100% + 0.5rem);
    transform: translateY(-50%);
  }

  html[dir="rtl"] .flow-networks::after,
  html[dir="rtl"] .flow-feed::after,
  html[dir="rtl"] .flow-shake::after {
    content: "←";
    left: auto;
    right: calc(100% + 0.5rem);
  }

  .flow-reports::after,
  html[dir="rtl"] .flow-reports::after {
    content: "↑";
    top: auto;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* Method figures (How it works): code-drawn schematics in the flow
 * diagram's style. Stages stack on narrow figures and sit in one row when
 * the figure is wide enough; arrows follow the reading direction. */
.mfig {
  container-type: inline-size;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.mfig-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.mfig-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  text-align: center;
}

.mfig-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
}

.mfig-label {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.mfig-sub,
.mfig-step {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.mfig-step {
  font-weight: 600;
  text-align: center;
}

.mfig-arrow {
  display: grid;
  place-items: center;
  color: var(--red-text);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.mfig-arrow:empty::before,
.mfig-merge .mfig-arrow::before {
  content: "↓";
}

.mfig-merge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.mfig-merge svg {
  display: none;
  width: 2.75rem;
  height: auto;
  fill: none;
  stroke: var(--red);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mfig-op {
  color: var(--muted);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

/* chips: networks, SHAKEmap inputs */
.mfig-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.mfig-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: start;
  max-width: 100%;
}

.mfig-chip span {
  min-width: 0;
  overflow-wrap: anywhere; /* one long Sorani word at 200% text size */
}

.mfig-chip .line-icon,
.mfig-event-head .line-icon {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--red-text);
}

/* one earthquake with its source tags */
.mfig-event {
  display: grid;
  gap: 0.6rem;
  min-width: 10rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--red);
  border-radius: 1.1rem;
  background: var(--bg);
}

.mfig-event-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0;
  font-weight: 700;
}

.mfig-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}

.mfig-tags li {
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--card);
  font-size: 1rem;
  font-weight: 600;
}

/* stylised SHAKEmap */
.mfig-map {
  display: block;
  width: min(100%, 15rem);
  height: auto;
}

.mfig .intensity-legend {
  width: min(100%, 15rem);
}

.sd-bg {
  fill: var(--bg-alt);
  stroke: var(--border);
}

.sd-rings path {
  stroke: rgb(0 0 0 / 0.18);
  stroke-width: 0.8;
}

.sd-station {
  fill: #ffffff;
  stroke: #1c1b1f;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.sd-report {
  fill: var(--red);
  stroke: #ffffff;
  stroke-width: 1.2;
}

.sd-epi {
  fill: #1c1b1f;
  stroke: #ffffff;
  stroke-width: 1;
  stroke-linejoin: round;
}

/* damage: shaking x classes -> damage grades */
.mfig-swatch {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--swatch);
  color: #0b1219;
  font-size: 1.4rem;
  font-weight: 700;
}

.mfig-vc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1.45rem);
  gap: 0.2rem;
}

.mfig-vc li {
  display: grid;
  place-items: center;
  height: 2.2rem;
  border-radius: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.mfig-dg {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.3rem;
  height: 4.6rem;
}

.mfig-dg li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  height: 100%;
}

.mfig-dg-bar {
  width: 1.35rem;
  height: calc(var(--h) * 0.095rem);
  border: 1px solid var(--border-strong);
  border-radius: 0.3rem 0.3rem 0 0;
  background: var(--dg);
}

.mfig-dg-num {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

/* felt reports: dots, area cells, community intensity */
.mfig-cells {
  display: block;
  width: min(100%, 7.5rem);
  height: auto;
}

.rd-bg {
  fill: var(--bg-alt);
  stroke: var(--border);
}

.rd-cell {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1;
}

.rd-cell--on {
  stroke: rgb(0 0 0 / 0.25);
}

.rd-dot {
  fill: var(--red);
  stroke: var(--card);
  stroke-width: 1;
}

.rd-you {
  fill: none;
  stroke: var(--red);
  stroke-width: 1.4;
}

@container (min-width: 30rem) {
  .mfig-row {
    flex-direction: row;
    justify-content: center;
    gap: 0.6rem;
  }

  .mfig-stage {
    flex: 1 1 0;
    width: auto;
  }

  .mfig-arrow:empty::before {
    content: "→";
  }

  html[dir="rtl"] .mfig-arrow:empty::before {
    content: "←";
  }

  .mfig-merge {
    flex: none;
    max-width: 7rem;
  }

  .mfig-merge svg {
    display: block;
  }

  .mfig-merge .mfig-arrow::before {
    content: none;
  }

  html[dir="rtl"] .mfig-merge svg {
    transform: scaleX(-1);
  }

  .mfig-chips {
    flex-direction: column;
    align-items: stretch;
  }

  .mfig--damage .mfig-stage:nth-child(3) {
    flex-grow: 1.4;
  }
}

/* The three report panels are small: keep them in one row on phones too,
 * stacking only when the figure is very narrow (large text). */
@container (min-width: 17rem) {
  .mfig--reports .mfig-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .mfig--reports .mfig-stage {
    flex: 1 1 0;
    width: auto;
  }

  .mfig--reports .mfig-arrow {
    align-self: center;
    margin-block-end: 2rem;
  }

  .mfig--reports .mfig-arrow:empty::before {
    content: "→";
  }

  html[dir="rtl"] .mfig--reports .mfig-arrow:empty::before {
    content: "←";
  }
}

/* catalogue map under the data figure */
.catalog-row {
  margin-block-start: clamp(1.75rem, 3vw, 2.5rem);
}

.catalog-row .map-frame {
  max-width: 44rem;
  margin-inline: auto;
}

/* ------------------------------------------------------------- about */

[hidden] {
  display: none !important;
}

.line-icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-top-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .about-top-inner {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    gap: 3rem;
  }
}

.about-line {
  max-width: 24rem;
  margin-block: 1rem 1.25rem;
}

.about-top .lede {
  color: var(--ink);
  max-width: 40rem;
}

.about-family {
  justify-self: center;
  width: min(22rem, 72%);
  aspect-ratio: 600 / 420;
}

.about .band > div {
  padding-block: clamp(2.75rem, 2rem + 3vw, 4.5rem);
}

.about .band h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  margin-block-end: 0.75rem;
}

.principles {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
}

.principle {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.principle h3 {
  font-size: 1.2rem;
  letter-spacing: 0;
  margin-block: 0.9rem 0.4rem;
}

.principle p {
  color: var(--muted);
}

.principle-icon,
.quick-icon,
.faq-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--red-text);
}

.band--alt .faq-icon {
  background: var(--card);
}

/* About roadmap: the "Next" items in one outlined card, then a link line
 * to the longer-term aims on How it works. */
.road-col {
  max-width: 40rem;
  margin-block-start: 1.5rem;
  padding: 1.25rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
}

.road-aims {
  margin-block: 1.25rem 0;
}

.road-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  letter-spacing: 0;
  margin-block-end: 0.9rem;
  overflow-wrap: anywhere; /* one long Sorani word at 200% text size */
}

.road-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
}

.road-col--next .road-mark {
  border: 2px solid var(--ink);
  color: var(--ink);
}

.road-col--next .road-mark::before {
  content: "→";
}

html[dir="rtl"] .road-col--next .road-mark::before {
  content: "←";
}

.road-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.road-list li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  line-height: 1.4;
}

.road-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--red-text);
}

.road-icon .line-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Social: icon links only (platform name as accessible name + tooltip). */
.social-icons {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--ink);
}

.social-link:hover {
  border-color: var(--ink);
  color: var(--red-text);
}

.social-glyph {
  width: 1.35rem;
  height: 1.35rem;
}

.site-footer .social-icons--footer {
  display: flex;
  gap: 0.6rem;
  margin-block-start: 0.75rem;
}

.site-footer .social-link {
  border-color: var(--footer-border);
  color: var(--footer-text);
}

.site-footer .social-link:hover {
  color: var(--footer-link);
  border-color: var(--footer-link);
}

.social-none {
  margin-block-start: 1.25rem;
  padding: 1rem 1.2rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: 1rem;
  color: var(--muted);
  max-width: 40rem;
}

.fake-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  max-width: 42rem;
}

.fake-list li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  overflow-wrap: anywhere;
}

.tip-icon {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#official .channels {
  margin-block-start: 1.25rem;
}

.channels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.channels li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  column-gap: 0.85rem;
  align-items: center;
}

.ch-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--red-text);
}

.ch-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.ch-label {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.35;
}

.channels a {
  font-weight: 700;
  overflow-wrap: anywhere;
  justify-self: start;
}

/* ----------------------------------------------------------- support */

.support-hero .wrap {
  max-width: 48rem;
}

.faq-search {
  position: relative;
  margin-block-start: 1.5rem;
  max-width: 36rem;
}

.faq-search input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.6rem 1.1rem;
  padding-inline-start: 3rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}

.faq-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.faq-search input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.faq-search-icon {
  position: absolute;
  inset-inline-start: 1.05rem;
  inset-block-start: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 1.25rem;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.3rem 0.95rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.chip-link:hover {
  border-color: var(--ink);
}

.support-cards {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.quick-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.quick-card h2 {
  font-size: 1.25rem;
  letter-spacing: 0;
  margin-block-start: 0.4rem;
}

.quick-card p {
  color: var(--muted);
  flex: 1;
}

.quick-card .text-link {
  min-height: 2.75rem;
}

.faq-empty {
  max-width: 48rem;
  margin: 1rem auto 2rem;
  padding: 1rem var(--pad);
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.faq-band > .faq-group {
  max-width: 48rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 2rem + 2vw, 4rem) var(--pad);
}

.faq-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
  margin-block-end: 1.25rem;
}

.faq-list {
  border-block-start: 1px solid var(--border-strong);
}

.faq-item {
  border-block-end: 1px solid var(--border-strong);
  scroll-margin-block-start: 1rem;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0.9rem 0.25rem;
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.45;
}

html[dir="rtl"] .faq-item summary {
  line-height: 1.7;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover .faq-q {
  color: var(--red-text);
}

.faq-chev {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-inline-end: 0.35rem;
  /* physical borders: a down chevron is the same in both directions */
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.15s ease;
}

.faq-item[open] summary .faq-q {
  color: var(--red-text);
}

.faq-item[open] .faq-chev {
  transform: translateY(20%) rotate(225deg);
}

.faq-a {
  padding: 0 0.25rem 1.25rem;
  max-width: 42rem;
}

.faq-a p {
  margin-block: 0 0.6rem;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0.4rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--red-text);
  font-weight: 700;
}

.band--alt .steps li::before {
  background: var(--card);
}

:is(:lang(ckb), :lang(ar)) .steps li::before {
  content: counter(step, arabic-indic);
}

.support-still .wrap {
  padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

.support-still .lede {
  max-width: 40rem;
}

/* ---------------------------------------------- handbook + prose pages */
/* The handbook keeps its own markup (sections, kickers, cards); these are
 * those components in the new system. */

.wrap {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--pad);
}

.wrap-wide {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: clamp(2.5rem, 2rem + 2.5vw, 4rem);
}

.section-ivory {
  background: var(--bg-alt);
}

.section-off {
  background: var(--bg-soft);
}

.section-kicker,
.hb-tag {
  margin: 0 0 0.6rem;
  color: var(--red-text);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

html[dir="rtl"] :is(.section-kicker, .hb-tag) {
  text-transform: none;
  letter-spacing: 0;
}

.hb-tag {
  color: var(--muted);
}

.hero-copy .section-kicker {
  margin-block-end: 0.75rem;
}

h1 .accent {
  color: var(--red-text);
}

.section h2 {
  margin-block-end: 0.4rem;
}

.lede-wide {
  max-width: 48rem;
}

.hb-map {
  margin: 0;
  max-width: 24rem;
  margin-inline: auto;
}

.hb-map figcaption {
  margin-block-start: 0.7rem;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.feature-grid {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.1rem;
}

.feature-card {
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.feature-card h3,
.credibility-item h3 {
  font-size: 1.3rem;
  letter-spacing: 0;
  margin-block: 0.3rem 0.4rem;
}

.feature-card p,
.credibility-item p {
  color: var(--muted);
}

.feature-num {
  color: var(--red-text);
  font-weight: 700;
  font-size: 1rem;
}

.hb-art {
  margin-block: 0.4rem 0.6rem;
}

.hb-art svg {
  display: block;
  width: 100%;
  max-width: 8.5rem;
  height: auto;
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.4;
}

.hb-art .stroke-accent {
  stroke: var(--red);
  stroke-width: 2.4;
}

.hb-art .fill-accent {
  fill: var(--red);
  stroke: none;
}

.hb-art .dashed {
  stroke-dasharray: 4 3;
  opacity: 0.6;
}

.credibility-grid {
  margin-block-start: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem 2rem;
}

.credibility-item {
  padding-block-start: 1rem;
  border-block-start: 3px solid var(--red);
}

.hb-report {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: center;
}

.hb-report > * {
  flex: 1 1 20rem;
  min-width: 0;
}

/* The report mock is a sheet of paper: paper colours in both themes. */
.hb-sheet {
  margin: 0;
  max-width: 26rem;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 0.6rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hb-sheet svg {
  display: block;
  width: 100%;
  height: auto;
}

.section .lede + p,
.section .cta-row + .meta,
.section .meta + p,
.hb-report .lede + p {
  margin-block-start: 0.9rem;
}

.meta {
  color: var(--muted);
}

.note {
  padding: 0.9rem 1.1rem;
  border-inline-start: 4px solid var(--red);
  background: var(--bg-alt);
  border-radius: 0.5rem;
}

/* prose pages: support, privacy */
.prose-page main {
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem) 1rem;
}

.prose-page main h1 {
  font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem);
  margin-block-end: 1rem;
}

.prose-page main h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem);
  margin-block: 2.2rem 0.6rem;
}

.prose-page main p,
.prose-page main ul {
  margin-block: 0.8rem;
}

.prose-page main li + li {
  margin-block-start: 0.35rem;
}

dl.faq dt {
  font-weight: 700;
  font-size: 1.15rem;
  margin-block-start: 1.6rem;
}

dl.faq dd {
  margin: 0.4rem 0 0;
}

/* ------------------------------------------------------------- footer */

.skyline-band {
  line-height: 0;
  margin-block-start: clamp(2rem, 4vw, 3.5rem);
  color: var(--footer-bg);
}

.skyline {
  display: block;
  width: 100%;
  height: clamp(3.5rem, 9vw, 8.5rem);
}

.skyline .far {
  fill: var(--sky-far);
  fill-opacity: 1;
}

.skyline .mid {
  fill: var(--sky-mid);
  fill-opacity: 1;
}

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-block: 2.5rem 2.25rem;
}

.site-footer-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem;
}

.footer-brand .brand-logo {
  height: 30px;
}

.footer-tagline {
  margin-block-start: 0.9rem;
  max-width: 22rem;
  color: var(--footer-muted);
  font-size: 1rem;
}

/* Footer column labels are h2: top-level groups of the contentinfo
 * landmark. Two classes so they outrank the global heading rules. */
.site-footer .footer-col h2 {
  margin-block-end: 0.6rem;
  color: var(--footer-text);
  font-size: 1rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

html[dir="rtl"] .site-footer .footer-col h2 {
  letter-spacing: 0;
  line-height: 1.8;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
}

.site-footer a {
  overflow-wrap: anywhere;
  color: var(--footer-link);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer :focus-visible {
  outline-color: #f2b632;
}

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.25rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--footer-border);
  color: var(--footer-muted);
  font-size: 1rem;
}

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .live-dot {
    animation: none;
  }
}
