/* ═══════════════════════════════════════════════════════════════════════════
 * BaliBetween — public site stylesheet
 *
 * SCOPE. This file styles ONLY the public informational surfaces rendered by
 * `views/public/*`. The transactional surface keeps `app.css`, so a change here
 * cannot move a booking step.
 *
 * WHAT THE DIRECTION ASKS FOR (and where it is implemented below)
 * --------------------------------------------------------------
 * `docs/18_VISUAL_DIRECTION.md` locks "editorial hospitality + transactional
 * clarity", and names four rules this file has to honour:
 *
 *   · "Photography should carry most of the color." There is no licensed
 *     photography at launch, so the palette carries the page instead — and the
 *     answer to that is NOT more colour. It is contrast, measure and rhythm:
 *     deep-ink bands against warm paper, a real typographic scale, and one
 *     scarce accent.
 *   · "Primary transaction CTAs should default to deep ink." `.btn-primary`
 *     below is ink, deliberately, and NOT the botanical green. The green is
 *     reserved for semantic state (`.step-node`, `[data-semantic]`), which is
 *     why the only green on a marketing page marks real progression.
 *   · "Botanical green is scarce and semantic: trust, success, selection, active
 *     progress." Exactly one place uses it: the numbered Between Line nodes.
 *   · "Consumer cards/media are sharp or near-sharp and shadowless." Every
 *     radius is `--radius-sm`/`--radius-md` and there is no `box-shadow` in this
 *     file other than the focus ring.
 *
 * NO INLINE STYLES. The content-security policy is `style-src 'self'`, so every
 * declaration lives here. There is also no JavaScript on the public site, which
 * is why nothing below depends on a class being toggled at runtime.
 *
 * ACCESSIBILITY NOTES THAT ARE NOT OPTIONAL
 * -----------------------------------------
 *   · Every interactive element has a visible `:focus-visible` outline.
 *   · The skip link is the first focusable element and becomes visible on focus.
 *   · Text contrast is checked against the token values: `--fg` (#1f2723) on
 *     `--bg` (#f5f1e8) is ~12.6:1; `--muted` (#677069) on `--bg` is ~4.9:1,
 *     which clears 4.5:1 for body text; muted text is never used below 0.875rem.
 *   · Motion is limited to a colour transition and is disabled by the token
 *     stylesheet's own `prefers-reduced-motion` block.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ─── base ────────────────────────────────────────────────────────────────── */

.site {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-text-size-adjust: 100%;
}

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

/*
 * ONE GUTTER, THREE WAYS OF OPTING IN.
 *
 * `--gutter` collapses the three per-breakpoint tokens into a single value that reacts
 * to the viewport on its own, so the rule below does not have to be repeated inside
 * three media queries and cannot fall out of step with them.
 */
.site {
  --gutter: var(--container-gutter-phone);
}

@media (min-width: 700px) {
  .site {
    --gutter: var(--container-gutter-tablet);
  }
}

@media (min-width: 1000px) {
  .site {
    --gutter: var(--container-gutter-desktop);
  }
}

.site .wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/*
 * THE FIX FOR CONTENT THAT SAT AT x=0.
 *
 * `/services` and `/find` put blocks straight into `main.page` instead of inside a
 * `.wrap`. `.page` has no horizontal padding of its own - only `padding-bottom` - and
 * `.prose` and `.service-list` have none either, so the reading column ran to the exact
 * edge of the viewport: service headings, summaries, a whole grid of articles, a CTA row
 * and the entire request form.
 *
 * Every other page happened to wrap its blocks, which is why this survived review: it is
 * a defect of OMISSION, invisible on any page that remembered, and it reappears the next
 * time someone adds a section and forgets. So the fix is not to wrap those two pages by
 * hand. It is to make `main.page` unable to render unpadded content.
 *
 * `.wrap` is exempt because it applies the gutter itself, and `.band--bleed` is exempt
 * because a full-bleed visual field touching the viewport edge is deliberate - imagery
 * may go to the edge, text never should, and that contrast is the composition.
 */
.page > *:not(.wrap):not(.band--bleed) {
  padding-inline: var(--gutter);
}

/* ─── focus and skip link ─────────────────────────────────────────────────── */

.site a:focus-visible,
.site button:focus-visible,
.site summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.site .skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.site .skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

/* ─── header ──────────────────────────────────────────────────────────────── */

.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  min-height: 4.25rem;
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--fg);
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-display);
  line-height: 1;
}

/*
 * THE MOBILE HEADER.
 *
 * What was here: a horizontally scrolling nav row. It clipped the last destination -
 * "Trust" rendered as "Trus" at 390px - with no affordance that the row scrolled, and its
 * `order: 3; width: 100%` pushed the nav onto a third header row, making the phone header
 * TALLER than the desktop one.
 *
 * What replaces it: one compact row (brand, then a Menu disclosure), with the destinations
 * inside. `<details>` gives that for free - native focus, Enter/Space, Escape, and a list
 * that is only in the accessibility tree when open - so there is no JavaScript, no
 * aria-expanded bookkeeping to get wrong, and no hamburger that silently fails when a
 * script does not load.
 *
 * The primary CTA lives inside the disclosure on a phone and inline on desktop. At 360px
 * brand + CTA + toggle does not fit on one row, and a CTA that overflows is worse than a
 * CTA one tap away - the page body carries its own "Request a time" above the fold anyway.
 */
.nav-disclosure {
  order: 3;
  margin-inline-start: auto;
}

.nav-disclosure summary {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44px: a comfortable touch target, not a text-sized one */
  padding-inline: var(--space-3);
  cursor: pointer;
  list-style: none;
  color: var(--fg-2);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

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

.nav-disclosure[open] summary {
  color: var(--fg);
  border-color: var(--fg-2);
}

.site-nav {
  display: none;
}

.nav-disclosure[open] .site-nav {
  display: block;
}

/*
 * The open menu must not widen the page.
 *
 * The shared list rule is `white-space: nowrap`, which is right for a single inline row
 * on desktop and wrong inside a 360px disclosure: "How it works" plus the CTA made the
 * open menu 17px wider than the viewport, so opening the navigation produced the exact
 * horizontal overflow this change set out to remove. Measured on production at 360px
 * before this rule existed, and 0px after.
 */
.nav-disclosure .site-nav ul {
  flex-wrap: wrap;
  white-space: normal;
  gap: var(--space-2) var(--space-5);
}

.nav-disclosure-cta {
  margin: var(--space-4) 0 0;
}

/* Hidden on a phone: the disclosure carries it. */
.head-cta {
  display: none;
}

.site-nav ul,
.foot-nav ul {
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.site-nav a {
  display: inline-block;
  padding-block: var(--space-2);
  color: var(--fg-2);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.head-cta {
  margin: 0 0 0 auto;
}

/*
 * DESKTOP IS UNCHANGED.
 *
 * The disclosure is dissolved rather than restyled: the summary disappears, the nav is
 * forced visible with `!important` (the browser hides non-summary `<details>` content
 * unless the element is `open`, and no amount of `display` on the child overrides that
 * without it), and the inline CTA returns. Desktop never learns the mobile pattern existed.
 */
@media (min-width: 1000px) {
  .head-inner {
    flex-wrap: nowrap;
  }

  .nav-disclosure {
    order: 0;
    margin-inline-start: var(--space-8);
  }

  .nav-disclosure summary {
    display: none;
  }

  .site-nav {
    display: block !important;
    overflow: visible;
  }

  .nav-disclosure-cta {
    display: none;
  }

  .head-cta {
    display: block;
    margin-inline-start: auto;
  }
}

/* ─── buttons ─────────────────────────────────────────────────────────────── */

.site .btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--fg);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

/* Deep ink, per docs/18 — not the accent. */
.site .btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.site .btn-primary:hover {
  background: var(--fg-2);
}

.site .btn-quiet {
  border-color: var(--border);
  color: var(--fg);
  background: transparent;
}

.site .btn-quiet:hover {
  border-color: var(--fg);
}

/* ─── target size ─────────────────────────────────────────────────────────── */

/*
 * WCAG 2.2 AA 2.5.8 "Target Size (Minimum)" asks for 24x24 CSS pixels. The
 * criterion carries an explicit exception for links **inline within a sentence**,
 * which is why prose links are NOT enlarged here: padding a link that sits inside
 * a paragraph would push the line box apart and wreck the reading rhythm to
 * satisfy a rule that does not apply to it.
 *
 * What is not exempt is a standalone link, and a browser measurement found the
 * real ones: the header navigation was already 39px tall, but the FOOTER
 * navigation and the BREADCRUMBS were 16px and 14px. Those are the same
 * destinations as the header at a different position on the page, and a link is
 * not easier to hit at the bottom of a document than at the top of it.
 *
 * `padding-block` enlarges the hit area without changing the visual position of
 * the text, so the page looks identical and behaves properly.
 */
.site-nav a,
.foot-nav a,
.breadcrumbs a,
.plain-list a,
.foot-contact a,
.notice a {
  display: inline-block;
  padding-block: var(--space-2);
}

.foot-nav ul,
.plain-list {
  /* The extra padding must not add visible gaps between rows. */
  row-gap: 0;
}

/* ─── breadcrumbs ─────────────────────────────────────────────────────────── */

.breadcrumbs {
  padding-top: var(--space-4);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-xs);
  color: var(--muted);
}

.breadcrumbs li + li::before {
  content: '/';
  margin-inline-end: var(--space-2);
  color: var(--border);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--fg);
  text-decoration: underline;
}

/* ─── page opening ────────────────────────────────────────────────────────── */

.page {
  padding-bottom: var(--section-y-phone);
}

.page-title {
  margin: var(--space-6) 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw + 1rem, var(--text-4xl));
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  max-width: 20ch;
}

.lede {
  margin: var(--space-5) 0 0;
  max-width: 46ch;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--fg-2);
}

.eyebrow {
  margin: var(--space-6) 0 0;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.breadcrumbs + .page .eyebrow {
  margin-top: var(--space-4);
}

/* ─── bands ───────────────────────────────────────────────────────────────── */

.band {
  padding-block: var(--section-y-phone);
  border-top: 1px solid var(--border-soft);
}

.page > .band:first-of-type {
  margin-top: var(--section-y-phone);
}

.band-title {
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw + 0.9rem, var(--text-2xl));
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: var(--tracking-display);
  max-width: 26ch;
}

.band-lede {
  margin: calc(var(--space-5) * -1 + var(--space-2)) 0 var(--space-6);
  max-width: 52ch;
  color: var(--fg-2);
}

.band-more {
  margin: var(--space-6) 0 0;
  font-weight: 500;
}

.band-cta {
  background: var(--fg);
  color: var(--bg);
  border-top: 0;
}

.band-cta .band-title {
  color: var(--bg);
}

.band-cta .prose p {
  color: rgb(245 241 232 / 0.86);
}

/* ─── wide-screen band composition ────────────────────────────────────────── */

/*
 * Above ~1080px the heading stops sitting on top of its content and becomes a
 * left rail beside it.
 *
 * WHY. Measured at 1440px, the stacked layout left the right 40% of every prose
 * band empty: headings and body both capped at a reading measure, both starting
 * at the same left edge, and roughly 600px of nothing to their right. On a phone
 * that is correct — there is no width to use. On a laptop it reads as a page that
 * was never composed for the screen it is on, which is the opposite of what
 * docs/18_VISUAL_DIRECTION.md asks for.
 *
 * The rule is expressed as "the heading goes in column one, everything else in
 * column two" rather than by naming each block, so a band added later inherits the
 * composition instead of silently falling back to a single column.
 *
 * Below 1080px nothing changes: the grid is not declared, so the bands stay
 * stacked and the phone layout is untouched.
 */
@media (min-width: 1080px) {
  /*
   * SCOPED TO THE PLAIN BANDS, AND THAT SCOPING IS LOAD-BEARING.
   *
   * This rule is the site's original section grammar: heading on the left rail,
   * everything else in a wide right column. It is a good grammar and the prose pages
   * still use it.
   *
   * It was written as `.band > .wrap > *`, which is every band. That was fine while
   * every band WAS this grammar. The moment the Visual V2 pass added bands with their
   * own composition — a full-bleed photograph, an asymmetric split, a graphic canvas —
   * this rule captured them too and pushed their children into column two, which
   * silently collapsed each one into a single indented column. The symptom looked like
   * a broken grid in the new code; the cause was an unscoped selector in the old code.
   */
  .band:not(.band--bleed, .band--split, .band--canvas, .band--pair, .band--close, .band--ink) > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 22ch) minmax(0, 1fr);
    column-gap: var(--space-12);
    align-items: start;
  }

  .band:not(.band--bleed, .band--split, .band--canvas, .band--pair, .band--close, .band--ink) > .wrap > .eyebrow,
  .band:not(.band--bleed, .band--split, .band--canvas, .band--pair, .band--close, .band--ink) > .wrap > .band-title,
  .band:not(.band--bleed, .band--split, .band--canvas, .band--pair, .band--close, .band--ink) > .wrap > .band-lede {
    grid-column: 1;
  }

  .band:not(.band--bleed, .band--split, .band--canvas, .band--pair, .band--close, .band--ink) > .wrap > *:not(.eyebrow):not(.band-title):not(.band-lede) {
    grid-column: 2;
  }

  /* The lede belongs with the heading, so it takes the same rail without the
     negative margin it needs when it is stacked under a title. */
  .band-lede {
    margin-top: 0;
  }

  /* The page opening is not a band, and keeps its full measure: the `h1` is the
     one piece of type allowed to run wide. */
  .page .lede {
    max-width: 52ch;
  }
}

/* ─── prose ───────────────────────────────────────────────────────────────── */

.prose {
  max-width: 68ch;
}

.prose-wide {
  max-width: 74ch;
}

.prose p {
  margin: 0 0 var(--space-4);
  color: var(--fg-2);
}

.prose-wide p:first-child {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--fg);
}

.prose > p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--fg);
  font-weight: 600;
}

.prose a,
.band-more a,
.plain-list a,
.tick-list a,
.check-list a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover,
.band-more a:hover {
  color: var(--accent-hover);
}

.prose h2,
.article-body h2 {
  margin: var(--space-12) 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: var(--tracking-display);
  max-width: 30ch;
}

.prose h3,
.article-body h3 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.prose h4,
.article-body h4 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--text-base);
  font-weight: 700;
}

.prose ul,
.prose ol,
.article-body ul,
.article-body ol {
  margin: 0 0 var(--space-4);
  padding-inline-start: var(--space-6);
  color: var(--fg-2);
}

.prose li,
.article-body li {
  margin-bottom: var(--space-2);
}

.prose blockquote,
.article-body blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  border-left: 2px solid var(--accent);
  color: var(--fg-2);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code,
.article-body code {
  padding: 0.1em 0.35em;
  background: var(--surface-warm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose pre,
.article-body pre {
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  overflow-x: auto;
  background: var(--surface-warm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
}

.prose hr,
.article-body hr {
  margin: var(--space-8) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* Tables scroll rather than break the layout on a phone. */
.table-scroll {
  margin: 0 0 var(--space-6);
  overflow-x: auto;
}

.prose table,
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  text-align: left;
}

.prose th,
.prose td,
.article-body th,
.article-body td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.prose th,
.article-body th {
  border-bottom-color: var(--fg);
  font-weight: 600;
}

/* ─── lists used as content ───────────────────────────────────────────────── */

.tick-list,
.cross-list,
.check-list,
.plain-list,
.outcome-list,
.category-nav {
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  max-width: 68ch;
}

.tick-list li,
.cross-list li,
.check-list li,
.plain-list li,
.outcome-list li,
.category-nav li {
  position: relative;
  margin-bottom: var(--space-3);
  padding-inline-start: var(--space-6);
  color: var(--fg-2);
}

.tick-list li::before,
.cross-list li::before,
.check-list li::before,
.plain-list li::before {
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent);
  font-weight: 700;
}

.tick-list li::before,
.check-list li::before {
  content: '\2014';
}

.cross-list li::before {
  content: '\00D7';
  color: var(--muted);
}

.plain-list li::before {
  content: '\00B7';
  color: var(--muted);
}

.outcome-list {
  counter-reset: outcome;
}

.outcome-list li {
  counter-increment: outcome;
  padding-inline-start: var(--space-8);
}

.outcome-list li::before {
  content: counter(outcome);
  position: absolute;
  inset-inline-start: 0;
  top: 0.25em;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg);
}

.category-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-nav li {
  margin: 0;
  padding: 0;
}

.category-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-sm);
  text-decoration: none;
}

.category-nav a:hover {
  border-color: var(--fg);
}

.category-nav .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.list-reset {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ─── the Between Line (GRAPHICS.md) ──────────────────────────────────────── */

/*
 * Real progression only. The green node is the single place the accent appears on
 * a marketing page, which is what "scarce and semantic" means in practice.
 */
.between-steps {
  position: relative;
  display: grid;
  gap: var(--space-6);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.between-steps::before {
  content: '';
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 1px;
  background: var(--border);
}

.step {
  position: relative;
  padding-inline-start: var(--space-8);
}

.step-node {
  position: absolute;
  inset-inline-start: 0;
  top: 0.1em;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent-on);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step-label {
  display: block;
  font-weight: 600;
}

.step-note {
  display: block;
  color: var(--fg-2);
  font-size: var(--text-sm);
}

@media (min-width: 1000px) {
  .between-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }

  .between-steps::before {
    inset-inline: 0.75rem;
    top: 0.75rem;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .step {
    padding-inline-start: 0;
    padding-top: var(--space-6);
  }
}

/* ─── figure library (views/public/figures.ts) ────────────────────────────── */

/*
 * The figure module carries its geometry as SVG presentation attributes, so a
 * figure is legible with no stylesheet at all. What CSS owns here is the two
 * things an attribute cannot express: the figure's box in the page, and the
 * behaviour of the parts that must stay out of the drawing.
 *
 * Colour stays on the page's own vocabulary: ink for a stage name, `--fg-2` for its
 * detail, `--muted` for a note and for structure. The accent is not restated here —
 * where a figure makes a state claim it already carries `--accent` inside its own
 * markup, which is the only place it should be decided.
 */

.bb-figure {
  margin: 0;
  max-width: 100%;
}

.bb-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.bb-figure-caption {
  margin: var(--space-4) 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: var(--text-sm);
}

/*
 * THE ACCESSIBLE HALF OF THE BETWEEN LINE. `betweenLineFlow()` emits the same
 * stages twice: an `aria-hidden` SVG, which is the drawing, and an ordered list,
 * which is the content a screen reader reads. The list is clipped, never
 * `display: none` — `display: none` would take it out of the accessibility tree and
 * leave the figure with no content at all. This is the standard clip-rect utility,
 * and it deliberately has no breakpoint: a sighted reader sees the line at every
 * width and hears nothing, a screen-reader user hears the stages in order.
 */
.bb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * WIDE SCHEMATICS AND THE PHONE. A caption set inside SVG `<text>` cannot wrap or
 * reflow, so one viewBox has to stay legible from a 360px phone to a 1080px band.
 * These figures keep their authored scale inside a scroll container instead of
 * shrinking until an 11px caption is 4px off the page — the same treatment
 * `.table-scroll` already gives a wide table. Each `min-width` is the width at which
 * that figure's smallest caption still clears about 10px, so the scroll is short,
 * and on the desktop container nothing scrolls at all.
 */
.bb-figure-flow,
.bb-figure-request,
.bb-figure-wayfinding,
.bb-figure-time {
  overflow-x: auto;
  /*
   * A FADE THAT SAYS "THERE IS MORE", because a clipped edge says nothing.
   *
   * Below the point where these figures fit, the diagram is cut mid-word with no
   * indication it can be scrolled - the same failure the mobile nav had when "Trust"
   * rendered as "Trus". The gradient sits on the right edge of the visible area and
   * reads as content continuing rather than content ending.
   *
   * `background-attachment: local` makes the fade scroll away with the content, so it
   * disappears once the reader has reached the end rather than lying to them. That is
   * the one part of this that cannot be done without it.
   */
  background-image: linear-gradient(to right, transparent, var(--surface));
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 2.5rem 100%;
  background-attachment: local;
}

@media (min-width: 1000px) {
  /* Above this the figures fit, so there is nothing to signal. */
  .bb-figure-flow,
  .bb-figure-request,
  .bb-figure-wayfinding,
  .bb-figure-time {
    background-image: none;
  }
}

.bb-flow-svg {
  min-width: 62rem;
}

.bb-request-svg {
  min-width: 60rem;
}

.bb-wf-svg {
  min-width: 46rem;
}

.bb-time-svg {
  min-width: 60rem;
}

/* ─── verification and taxonomy rows ──────────────────────────────────────── */

/*
 * `verificationFigure()`. The glyph is the first column and the label and its
 * detail stack in the second, so a row reads as a heading with a description rather
 * than as one run-on line. `display: contents` on the wrapper lets the mark and the
 * name take the grid columns directly, which keeps the glyph on the label's baseline
 * instead of the row's centre.
 */
.bb-verify-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  max-width: 68ch;
  list-style: none;
}

.bb-verify-item {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  column-gap: var(--space-3);
  row-gap: 2px;
  align-items: center;
}

.bb-verify-head {
  display: contents;
}

.bb-verify-mark {
  grid-column: 1;
  grid-row: 1;
  color: var(--fg-2);
  line-height: 0;
}

.bb-verify-mark svg,
.bb-verify-not-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bb-verify-name {
  grid-column: 2;
  grid-row: 1;
  color: var(--fg);
  font-weight: 600;
}

.bb-verify-detail {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.bb-verify-not {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: start;
  margin: var(--space-6) 0 0;
  padding-top: var(--space-5);
  max-width: 68ch;
  border-top: 1px solid var(--border-soft);
}

.bb-verify-not-mark {
  color: var(--muted);
  line-height: 0;
}

.bb-verify-not-text {
  color: var(--fg-2);
  font-size: var(--text-sm);
}

/*
 * `serviceTaxonomyFigure()`. The order is the list's own and the marker is the only
 * number on the row — the drawn zero-padded index that used to sit beside it is
 * gone, because two numbers said the same thing twice. The `li` stays a list item
 * rather than becoming a grid or flex box, because a marker is only generated for
 * `display: list-item`, and that marker is now what carries the count.
 */
.bb-tax-list {
  margin: 0;
  padding-inline-start: var(--space-8);
  max-width: 42rem;
  list-style: decimal-leading-zero;
}

.bb-tax-item {
  padding-block: var(--space-3);
  border-top: 1px solid var(--border-soft);
  color: var(--fg);
}

.bb-tax-item::marker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.bb-tax-glyph {
  display: inline-flex;
  margin-inline-end: var(--space-3);
  color: var(--fg-2);
  vertical-align: middle;
}

.bb-tax-glyph svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bb-tax-name {
  vertical-align: middle;
}

.bb-tax-scope {
  margin: var(--space-6) 0 0;
  padding-top: var(--space-5);
  max-width: 68ch;
  border-top: 1px solid var(--border-soft);
  color: var(--fg-2);
  font-size: var(--text-sm);
}

/* ─── cards ───────────────────────────────────────────────────────────────── */

.card-row {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

@media (min-width: 700px) {
  .card-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .card-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  display: block;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  border-color: var(--fg);
}

.card h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
}

.card p {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.card-plain {
  background: transparent;
}

/* ─── service list ────────────────────────────────────────────────────────── */

.service-list {
  display: grid;
  gap: 0;
  margin-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.service {
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--border-soft);
}

.service h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: var(--tracking-display);
}

.service-summary {
  margin: 0 0 var(--space-3);
  max-width: 60ch;
  font-size: var(--text-base);
  color: var(--fg);
}

.service p:last-child {
  margin: 0;
  max-width: 68ch;
  color: var(--fg-2);
}

/* ─── guide grid ──────────────────────────────────────────────────────────── */

.guide-grid {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 700px) {
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .guide-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.guide-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
}

.guide-link:hover {
  border-color: var(--fg);
}

.guide-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.guide-category {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.guide-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--tracking-display);
}

.guide-summary {
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.guide-meta {
  margin-top: auto;
  padding-top: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ─── article ─────────────────────────────────────────────────────────────── */

.article {
  margin-top: var(--space-6);
}

.article-hero {
  margin: 0 0 var(--space-8);
}

.article-hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.article-hero figcaption {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0 0 var(--space-8);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--text-sm);
}

.article-author {
  color: var(--fg);
  font-weight: 600;
}

.article-body {
  max-width: 68ch;
}

.article-body > p:first-of-type {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--fg-2);
}

.article-sources {
  max-width: 68ch;
  margin-top: var(--section-y-phone);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.article-sources h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
}

.article-sources ol {
  margin: 0;
  padding-inline-start: var(--space-5);
  color: var(--fg-2);
  font-size: var(--text-sm);
}

.article-sources li {
  margin-bottom: var(--space-2);
}

.article-sources a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

/* ─── notices and calls to action ─────────────────────────────────────────── */

.notice {
  margin-top: var(--section-y-phone);
  padding: var(--space-6);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-inline-start: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  max-width: 68ch;
}

.notice-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
}

.notice p {
  margin: 0 0 var(--space-3);
  color: var(--fg-2);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin: var(--space-6) 0 0;
}

.cta-note {
  color: var(--muted);
  font-size: var(--text-sm);
}

.band-cta .cta-row {
  margin-top: var(--space-5);
}

.band-cta .btn {
  border-color: var(--bg);
  background: var(--bg);
  color: var(--fg);
}

.band-cta .btn:hover {
  background: transparent;
  color: var(--bg);
}

.contact-big {
  margin: var(--space-4) 0 var(--space-6);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw + 0.8rem, var(--text-2xl));
  word-break: break-word;
}

.contact-big a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ─── footer ──────────────────────────────────────────────────────────────── */

.site-foot {
  margin-top: var(--section-y-phone);
  padding-block: var(--section-y-phone) var(--space-6);
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}

.foot-inner {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 700px) {
  .foot-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .foot-inner {
    grid-template-columns: 1fr 2fr 1fr;
  }
}

.foot-name {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.foot-inner .meta,
.foot-honesty .meta {
  margin: 0;
  color: var(--muted);
}

.foot-nav ul {
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.foot-nav a {
  color: var(--fg-2);
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--fg);
  text-decoration: underline;
}

.foot-contact a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.foot-honesty {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-soft);
}

.foot-honesty .meta {
  max-width: 68ch;
}

/* ─── small print ─────────────────────────────────────────────────────────── */

.site .meta {
  color: var(--muted);
  font-size: var(--text-xs);
}

/* Windows High Contrast / forced-colors: make sure the steps survive. */
@media (forced-colors: active) {
  .step-node {
    border: 1px solid CanvasText;
  }

  .site .btn {
    border: 1px solid ButtonText;
  }
}
