/* ==== Tokens (src/styles/theme.css) ==== */
/**
 * Design tokens — the only file with colour literals. Dark theme in the
 * logo's palette: navy night ground, gold for the lead accent (the top card,
 * its button, the hero button), royal blue for the cool accent (frames, rating,
 * the other buttons), red in small doses. The ornament language is porteño
 * fileteado: double rules and gold scrolls on dark lacquer.
 */
:root {
  /* --- Ground and surfaces --- */
  --color-bg: #0a1430;
  --color-bg-deep: #060d22;
  --color-surface: #0f1c42;
  --color-surface-raised: #142555;
  --color-surface-muted: #0c1838;
  --color-surface-subtle: #12214b;
  --color-skeleton: #1a2b5c;
  --color-skeleton-strong: #22366e;

  /* --- Text --- */
  --color-text: #eef1fa;
  --color-text-secondary: #ccd4ec;
  --color-text-muted: #aab4d3;
  --color-text-subtle: #929ec3;
  --color-text-faint: #7a86ad;
  --color-text-faintest: #4d5a85;

  /* --- Lines --- */
  --color-border: #23356a;
  --color-border-strong: #3a52a0;
  --color-border-soft: #1c2c5c;
  --color-border-softer: #19284f;
  --color-border-input: #2c4180;
  --color-border-muted: #2a3a6e;

  /* --- Gold: the lead accent --- */
  --color-gold: #f5b21b;
  --color-gold-bright: #ffd15c;
  --color-gold-deep: #c98a06;
  --color-gold-ink: #1d1404;
  --color-gold-glow: rgba(245, 178, 27, 0.55);
  --color-gold-glow-strong: rgba(255, 209, 92, 0.85);
  --color-gold-haze: rgba(245, 178, 27, 0.1);

  /* --- Royal blue: the cool accent --- */
  --color-royal: #2f6be0;
  --color-royal-bright: #6b97f2;
  --color-royal-deep: #1f4fb4;
  --color-royal-haze: rgba(47, 107, 224, 0.16);
  --color-royal-glow: rgba(47, 107, 224, 0.45);

  /* --- Red: in small doses --- */
  --color-red: #e0313a;
  --color-red-bright: #f0565d;
  --color-red-haze: rgba(224, 49, 58, 0.12);

  /* Text on royal or red. */
  --color-on-accent: #f7f9ff;

  /* Light backing for official marks drawn dark on a transparent ground. */
  --color-mark-pad: #f3f5fa;

  /* --- Inverted (template names, kept for the template-shaped modules) --- */
  --color-inverted-bg: #2f6be0;
  --color-inverted-bg-hover: #1f4fb4;
  --color-inverted-text: #f7f9ff;
  --color-contrast-bg: #f5b21b;
  --color-contrast-text: #1d1404;

  /* --- Overlay --- */
  --color-overlay: rgba(4, 9, 24, 0.94);
  --color-overlay-soft: rgba(4, 9, 24, 0.72);

  /* --- Spinner --- */
  --color-spinner-track: #23356a;
  --color-spinner-head: #f5b21b;

  --color-focus: #ffd15c;
  --color-shadow: rgba(2, 6, 18, 0.55);

  /* --- Layout ---
     One width for the header, the footer, the offer list and every section. */
  --layout-max-width: 1120px;
  --layout-padding-x: 1.25rem;
  --content-max-width: 760px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ==== Fonts (astro.config.mjs fonts → Google Fonts <link>) ==== */
/* Declared by Astro's <Font cssVariable> in the source; declared here in the
   static build. Family names and fallbacks as in astro.config.mjs. */
:root {
  --font-display: 'Gloock', serif;
  --font-body: 'Onest', sans-serif;
}

/* ==== Reset (src/styles/global.css) ==== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.005em;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* Load-bearing. `hidden` is how the age gate, its refusal panel, the promo
   modal and the cookie notice are toggled, and the UA rule behind it is
   `[hidden] { display: none }` from the browser's own stylesheet — any
   `display` in a component's CSS module outranks it. An overlay with
   `display: flex` then stays on screen with its attribute dutifully flipped.
   Keep the `!important`; it is what makes the attribute win. */
[hidden] {
  display: none !important;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Every in-page anchor of the home page (`SECTION_IDS` in src/content.ts). */
#plataformas,
#como-comparamos,
#antes-de-registrarte,
#preguntas-frecuentes,
#nota-editorial {
  scroll-margin-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Keeps a control operable by keyboard while invisible — used by the CSS-only
   disclosure toggles, which must not fall out of the tab order. */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==== Horizon ==== */
/* Night over the river: a royal-blue glow from the upper left, a faint gold
   one from the upper right, deepening towards the bottom. Fixed, so the
   light stays put while the page scrolls past it. */
.horizon {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      70rem 40rem at 8% -12%,
      var(--color-royal-haze),
      transparent 62%
    ),
    radial-gradient(
      48rem 28rem at 96% 2%,
      var(--color-gold-haze),
      transparent 60%
    ),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-deep) 100%);
}

/* ==== BrandRow ==== */
.brandrow {
  position: relative;
  background: var(--color-bg-deep);
}

/* The accent rule: fileteado's double line — gold over royal blue. */
.brandrow::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background:
    linear-gradient(var(--color-gold), var(--color-gold)) top / 100% 2px
      no-repeat,
    linear-gradient(var(--color-royal), var(--color-royal)) bottom / 100% 1px
      no-repeat;
}

.brandrow__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 0.75rem var(--layout-padding-x) 0.9rem;
  display: flex;
  align-items: center;
}

.brandrow__home {
  display: inline-flex;
}

.brandrow__logo {
  height: 50px;
  width: auto;
}

@media (max-width: 480px) {
  .brandrow__logo {
    height: 42px;
  }
}

/* ==== Commons ==== */
/* The home page's <main>: the sections set their own widths and rhythm. */
.home {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==== Prelude ==== */
.prelude {
  position: relative;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 2.25rem var(--layout-padding-x) 1.5rem;
  overflow: hidden;
}

.prelude__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

.prelude__place {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-royal-bright);
}

.prelude__place::before {
  content: '';
  width: 1.5rem;
  height: 2px;
  background: var(--color-royal);
}

.prelude__title {
  font-size: clamp(2rem, 4.6vw + 0.6rem, 3.35rem);
  line-height: 1.06;
  color: var(--color-text);
  text-wrap: balance;
}

/* The fact the page is built on — the permit — carries fileteado's double
   rule underneath: gold over red. */
.prelude__permit {
  display: inline;
  color: var(--color-gold-bright);
  background:
    linear-gradient(var(--color-gold), var(--color-gold)) 0 92% / 100% 2px
      no-repeat,
    linear-gradient(var(--color-red), var(--color-red)) 0 100% / 100% 1px
      no-repeat;
  padding-bottom: 0.08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.prelude__flourish {
  position: absolute;
  right: max(var(--layout-padding-x), 4%);
  bottom: 0.75rem;
  color: var(--color-gold);
  opacity: 0.32;
  transform: scaleX(-1);
}

@media (max-width: 760px) {
  .prelude {
    padding-top: 1.6rem;
    padding-bottom: 1.1rem;
  }

  .prelude__flourish {
    display: none;
  }
}

/* ==== AgeLine ==== */
.ageline {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 0 var(--layout-padding-x);
}

.ageline__inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--color-red);
  background: var(--color-red-haze);
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--color-text-secondary);
}

.ageline__text {
  min-width: 0;
}

.ageline__marker {
  flex: none;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--color-red-bright);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-red-bright);
}

/* ==== Offers ==== */
.roster {
  padding: 1.75rem 0 2.5rem;
}

.roster__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 0 var(--layout-padding-x);
}

.roster__list {
  display: grid;
  gap: 1.35rem;
}

.roster__note {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-faint);
}

/* The promo modal's IntersectionObserver target (threshold: 1): it must stay
   a visible 1px element, never display: none. */
.roster__end {
  height: 1px;
}

/* ==== Billet ==== */
/* The offer card. One layout for every rank; the rank only changes the
   frame, the ribbon and the button. */
.billet {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    180deg,
    var(--color-surface-raised) 0%,
    var(--color-surface) 100%
  );
}

/* The inner grid passes clicks through; the button turns them back on
   (pointer-events on the anchor itself, in OfferLink). */
.billet__inner {
  position: relative;
  pointer-events: none;
  display: grid;
  grid-template-columns: 3.25rem 6.5rem 9.5rem minmax(0, 1fr) 12rem;
  grid-template-areas: 'place mark score terms action';
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem;
}

.billet__place {
  grid-area: place;
  justify-self: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--color-text-faint);
}

.billet__mark {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.billet__mark-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.billet__score {
  grid-area: score;
  display: grid;
  gap: 0.3rem;
}

.billet__stars {
  display: flex;
  gap: 0.15rem;
  color: var(--color-royal-bright);
}

.billet__figure {
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text);
}

.billet__scale {
  margin-left: 0.15rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-faint);
}

.billet__terms {
  grid-area: terms;
  display: grid;
  gap: 0.25rem;
}

.billet__terms-label {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.billet__action {
  grid-area: action;
}

.billet__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--color-royal);
  color: var(--color-on-accent);
  font-weight: 700;
  text-align: center;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.billet:hover .billet__cta {
  background: var(--color-royal-deep);
  box-shadow: 0 0 0 1px var(--color-royal-bright);
}

/* --- Ranks 2 and 3: identical, moderate --- */
.billet--podium {
  border-color: var(--color-royal);
  box-shadow: 0 0 1.5rem var(--color-royal-haze);
}

.billet--podium .billet__place {
  color: var(--color-royal-bright);
}

/* --- Rank 1: the gold double rule, the corner scrolls, the glow --- */
.billet--first {
  margin-top: 0.5rem;
  border-color: var(--color-gold);
  background: linear-gradient(
    180deg,
    var(--color-surface-raised) 0%,
    var(--color-surface) 70%,
    var(--color-surface-muted) 100%
  );
  box-shadow:
    inset 0 0 0 4px var(--color-surface-raised),
    inset 0 0 0 5px var(--color-gold-deep),
    0 0 0.5rem var(--color-gold-haze);
  animation: billet-glow 2.8s ease-in-out infinite alternate;
}

.billet--first .billet__place {
  color: var(--color-gold);
}

.billet--first .billet__inner {
  padding-block: 1.6rem 1.35rem;
}

.billet__cta--first {
  background: var(--color-gold);
  color: var(--color-gold-ink);
  box-shadow:
    0 0 0 1px var(--color-gold-bright),
    0 0 1.4rem var(--color-gold-glow-strong);
}

.billet--first:hover .billet__cta--first {
  background: var(--color-gold-bright);
  box-shadow:
    0 0 0 1px var(--color-gold-bright),
    0 0 2rem var(--color-gold-glow-strong);
}

.billet__flourish {
  position: absolute;
  color: var(--color-gold);
  opacity: 0.55;
  pointer-events: none;
}

.billet__flourish--top {
  top: 0.45rem;
  right: 0.45rem;
  transform: rotate(180deg);
}

.billet__flourish--bottom {
  bottom: 0.45rem;
  left: 0.45rem;
}

/* The ribbon: a banner with notched ends, never a pill. */
.billet__ribbon {
  position: absolute;
  top: -0.8rem;
  left: 1.1rem;
  z-index: 3;
  padding: 0.25rem 1.1rem;
  background: var(--color-royal);
  color: var(--color-on-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  clip-path: polygon(
    0 0,
    100% 0,
    calc(100% - 0.55rem) 50%,
    100% 100%,
    0 100%,
    0.55rem 50%
  );
}

.billet__ribbon--first {
  top: -0.95rem;
  padding: 0.3rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-gold-ink);
  background: linear-gradient(
      100deg,
      transparent 30%,
      var(--color-gold-glow-strong) 50%,
      transparent 70%
    )
    var(--color-gold);
  background-size: 250% 100%;
  animation: billet-shimmer 3.2s linear infinite;
}

@keyframes billet-glow {
  from {
    box-shadow:
      inset 0 0 0 4px var(--color-surface-raised),
      inset 0 0 0 5px var(--color-gold-deep),
      0 0 0.5rem var(--color-gold-haze);
  }
  to {
    box-shadow:
      inset 0 0 0 4px var(--color-surface-raised),
      inset 0 0 0 5px var(--color-gold-deep),
      0 0 2.4rem var(--color-gold-glow);
  }
}

@keyframes billet-shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}

@media (max-width: 900px) {
  .billet__inner {
    grid-template-columns: 2.5rem 5.5rem minmax(0, 1fr) 10.5rem;
    grid-template-areas:
      'place mark score action'
      'place mark terms action';
    row-gap: 0.6rem;
  }

  .billet__mark {
    width: 5.5rem;
    height: 5.5rem;
  }

  .billet__mark-img {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 620px) {
  .billet__inner {
    grid-template-columns: 4.75rem minmax(0, 1fr) 2.25rem;
    grid-template-areas:
      'mark score place'
      'terms terms terms'
      'action action action';
    gap: 0.85rem;
    padding: 1.25rem 1rem 1rem;
  }

  .billet--first .billet__inner {
    padding-block: 1.5rem 1rem;
  }

  .billet__place {
    align-self: start;
    font-size: 1.9rem;
  }

  .billet__mark {
    width: 4.75rem;
    height: 4.75rem;
  }

  .billet__mark-img {
    width: 64px;
    height: 64px;
  }

  .billet__flourish {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .billet--first,
  .billet__ribbon--first {
    animation: none;
  }

  .billet__cta {
    transition: none;
  }
}

/* ==== OfferLink ==== */
/* Positioning only — no colours: the button's look comes in on the anchor's
   `class`. pointer-events are set on the anchor and the overlay each, not
   inherited: the card's inner grid runs with `pointer-events: none`. */
.knob {
  position: relative;
  display: grid;
}

.knob__face {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  text-decoration: none;
}

/* Above the anchor by an explicit z-index, never by paint order: a positioned
   anchor would otherwise rise over it and take the clicks itself. */
.knob__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

/* ==== PerkLine ==== */
.perk {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  text-wrap: balance;
}

/* ==== Episodes ==== */
/* --- The criteria ledger --- */
.ledger {
  padding: 3rem 0;
}

.ledger__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 0 var(--layout-padding-x);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: start;
}

.ledger__head {
  position: sticky;
  top: 1.5rem;
}

.ledger__title {
  font-size: clamp(1.6rem, 2.4vw + 0.8rem, 2.3rem);
}

.ledger__intro {
  margin-top: 0.75rem;
  max-width: 26rem;
  color: var(--color-text-muted);
}

/* Rows ruled like a register: a gold hairline over a faint blue one. */
.ledger__rows {
  border-top: 1px solid var(--color-gold-deep);
}

.ledger__row {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.ledger__term {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--color-text);
}

.ledger__glyph {
  flex: none;
  margin-top: 0.1rem;
  color: var(--color-gold);
}

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

/* --- The steps track --- */
.track {
  padding: 3rem 0;
  background: linear-gradient(
    180deg,
    transparent,
    var(--color-surface-muted) 18%,
    var(--color-surface-muted) 82%,
    transparent
  );
}

.track__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 0 var(--layout-padding-x);
}

.track__title {
  font-size: clamp(1.6rem, 2.4vw + 0.8rem, 2.3rem);
}

.track__intro {
  margin-top: 0.5rem;
  color: var(--color-text-muted);
}

.track__steps {
  list-style: none;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  counter-reset: none;
}

.track__step {
  position: relative;
  padding-top: 3.6rem;
}

/* The royal line that strings the steps together. */
.track__step::before {
  content: '';
  position: absolute;
  top: 1.35rem;
  left: 2.9rem;
  right: -1.5rem;
  height: 1px;
  background: var(--color-royal);
}

.track__step:last-child::before {
  display: none;
}

.track__number {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--color-gold);
}

.track__step-title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0;
}

.track__step-text {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

/* --- The questions --- */
.queries {
  padding: 3rem 0 3.5rem;
}

.queries__inner {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding: 0 var(--layout-padding-x);
}

.queries__title {
  font-size: clamp(1.6rem, 2.4vw + 0.8rem, 2.3rem);
  text-align: center;
}

.queries__list {
  margin-top: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.queries__item + .queries__item {
  border-top: 1px solid var(--color-border-soft);
}

.queries__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  list-style: none;
  font-weight: 500;
  cursor: pointer;
}

.queries__question::-webkit-details-marker {
  display: none;
}

.queries__icon {
  flex: none;
  color: var(--color-gold);
  transition: transform 0.2s ease;
}

.queries__item[open] .queries__icon {
  transform: rotate(45deg);
}

.queries__answer {
  padding: 0 1.25rem 1.15rem;
  color: var(--color-text-muted);
}

@media (max-width: 860px) {
  .ledger__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .ledger__head {
    position: static;
  }

  .track__steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }

  .track__step {
    padding-top: 0;
    padding-left: 3.75rem;
    min-height: 2.7rem;
  }

  .track__step::before {
    top: 2.7rem;
    bottom: -1.25rem;
    left: 1.35rem;
    right: auto;
    width: 1px;
    height: auto;
  }
}

@media (max-width: 560px) {
  .ledger__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .queries__icon {
    transition: none;
  }
}

/* ==== OpenBook ==== */
.openbook {
  padding: 0 0 3rem;
}

.openbook__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 1.75rem var(--layout-padding-x) 0;
  border-top: 1px solid var(--color-border-soft);
}

.openbook__title {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
}

.openbook__blocks {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.openbook__block {
  min-width: 0;
}

.openbook__subtitle {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text-secondary);
}

.openbook__text {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--color-text-subtle);
}

@media (max-width: 760px) {
  .openbook__blocks {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

/* ==== Baseboard ==== */
/* Set apart from the page by a gradient band, not a grey line. */
.baseboard {
  position: relative;
  margin-top: auto;
  background: var(--color-bg-deep);
}

.baseboard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-royal) 0%,
    var(--color-gold) 50%,
    var(--color-red) 100%
  );
}

.baseboard__inner {
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding: 2.25rem var(--layout-padding-x) 1.5rem;
  display: grid;
  gap: 1.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* --- The statement: first, framed --- */
.baseboard__statement {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-md);
  background: var(--color-gold-haze);
}

.baseboard__statement-icon {
  flex: none;
  color: var(--color-gold);
}

.baseboard__statement-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text);
}

.baseboard__statement-text {
  margin-top: 0.25rem;
  color: var(--color-text-secondary);
}

/* --- Three columns --- */
.baseboard__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.baseboard__block {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.baseboard__heading {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--color-text);
}

.baseboard__licences {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.baseboard__licence {
  display: grid;
  gap: 0.05rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--color-royal);
}

.baseboard__licensee {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.baseboard__permit,
.baseboard__domain {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.baseboard__registry,
.baseboard__web {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  color: var(--color-royal-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.baseboard__org {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Official marks keep their drawn colours; a dark-on-transparent mark gets the
   light backing token. */
.baseboard__mark {
  flex: none;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.baseboard__mark--pad {
  padding: 0.2rem 0.35rem;
  background: var(--color-mark-pad);
  box-sizing: content-box;
}

.baseboard__org-name {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.baseboard__line {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}

.baseboard__glyph {
  flex: none;
  margin-top: 0.15rem;
  color: var(--color-gold);
}

.baseboard__phones {
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.baseboard__phone {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: var(--color-text);
  font-weight: 700;
}

.baseboard__phone-label {
  color: var(--color-text-subtle);
}

.baseboard__service {
  display: grid;
  gap: 0.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--color-border-softer);
}

.baseboard__service:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.baseboard__service-text {
  color: var(--color-text-subtle);
}

/* --- Age, navigation, company, fine print --- */
.baseboard__age {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-left: 2px solid var(--color-red);
  background: var(--color-red-haze);
  color: var(--color-text-secondary);
}

.baseboard__age-marker {
  flex: none;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--color-red-bright);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--color-red-bright);
}

.baseboard__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-soft);
}

.baseboard__nav-link {
  color: var(--color-text-secondary);
}

.baseboard__nav-link:hover {
  color: var(--color-gold-bright);
}

.baseboard__company,
.baseboard__fineprint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--color-text-faint);
}

.baseboard__mail {
  color: var(--color-text-subtle);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .baseboard__columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* ==== Codex (legal pages) ==== */
/* Legal and compliance pages: one readable column. */
.codex {
  flex: 1;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 2.25rem var(--layout-padding-x) 3.5rem;
  color: var(--color-text);
}

.codex h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.codex h2 {
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-soft);
  font-size: 1.45rem;
}

.codex h3 {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0;
}

.codex p,
.codex li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.codex p + p {
  margin-top: 0.75rem;
}

.codex ul,
.codex ol {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
}

.codex ul {
  list-style: disc;
}

.codex li + li {
  margin-top: 0.3rem;
}

.codex a {
  color: var(--color-royal-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.codex strong {
  color: var(--color-text);
}

.codex__lead {
  font-size: 1.125rem;
}

/* A framed warning: age and compulsive play on the compliance pages. */
.codex__alert {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--color-red);
  background: var(--color-red-haze);
}

.codex__alert p {
  color: var(--color-text);
}

/* Contact cards: help lines, centres, authorities. */
.codex__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.codex__card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.codex__card h3 {
  margin-top: 0;
}

.codex__card p {
  font-size: 0.9375rem;
  line-height: 1.55;
}

.codex__card p + p {
  margin-top: 0.35rem;
}

.codex__partner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-gold-deep);
  border-radius: var(--radius-md);
  background: var(--color-gold-haze);
}

.codex__partner-mark {
  border-radius: var(--radius-sm);
}

.codex__partner p {
  margin: 0;
  color: var(--color-text);
}

@media (max-width: 640px) {
  .codex__cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==== Handoff (404) ==== */
/* Full-screen states rendered without the site chrome: the click hop's
   redirect page, /error, the 404 and the 500. */
.handoff {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.handoff__panel {
  max-width: 36rem;
  padding: 2rem 1.75rem;
  text-align: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.handoff__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.handoff__text {
  margin: 0 0 1rem;
  color: var(--color-text-muted);
}

.handoff__back {
  display: inline-block;
  color: var(--color-royal-bright);
  text-decoration: underline;
}

.handoff__code {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1;
  color: var(--color-gold);
}
