/* ===== Tokens — src/styles/theme.css ===== */

/**
 * Design tokens — the only file with colour literals. The palette is the one of the previous
 * build of this site (owner's decision: the port keeps its look): near-black blue ground, cyan
 * and deep blue accents, a mint "hot" accent reserved for the top-ranked card.
 *
 * Font variables are NOT declared here: `<Font />` in `Base.astro` defines
 * `--font-display` (Outfit) and `--font-body` (Figtree) with their fallbacks.
 */
:root {
  color-scheme: dark;

  /* --- Layout --- */
  --layout-max-width: 1100px;
  --layout-padding-x: 1.25rem;
  --content-max-width: 48rem;

  /* --- Ground and surfaces --- */
  --color-bg: #05070f;
  --color-surface: #0c1426;
  --color-surface-2: #121c34;
  --color-logo-well: #060b16;
  --color-none: transparent;

  /* --- Text --- */
  --color-text: #f3f6ff;
  --color-text-muted: #8b9bb8;
  --color-text-subtle: #6a7a96;

  /* --- Lines --- */
  --color-border: #243152;

  /* --- Accents --- */
  --color-accent: #00d2ff;
  --color-accent-deep: #1a4bff;
  --color-on-accent: #041018;
  --color-cta: linear-gradient(90deg, #00d2ff 0%, #1a4bff 100%);
  --color-cta-hover: linear-gradient(90deg, #4de0ff 0%, #3d63ff 100%);
  --color-accent-glow: rgba(0, 210, 255, 0.35);
  --color-accent-line: linear-gradient(
    90deg,
    transparent 0%,
    #00d2ff 22%,
    #1a4bff 78%,
    transparent 100%
  );

  /* Second accent, reserved for the top-ranked card: its badge, stars and CTA. */
  --color-hot: #5cf2c9;
  --color-on-hot: #03140f;
  --color-cta-hot: linear-gradient(90deg, #5cf2c9 0%, #00d2ff 100%);
  --color-cta-hot-hover: linear-gradient(90deg, #8af7dc 0%, #4de0ff 100%);
  --color-hot-glow: rgba(92, 242, 201, 0.55);

  /* --- Cards --- */
  --color-card: linear-gradient(145deg, #07111f 0%, #0e1e3c 46%, #16345c 100%);
  --color-card-sheen: linear-gradient(
    180deg,
    rgba(0, 210, 255, 0.16) 0%,
    transparent 46%
  );
  --color-card-top1: linear-gradient(
    145deg,
    #0a1834 0%,
    #143868 48%,
    #1a4c94 100%
  );
  --color-card-sheen-top: linear-gradient(
    180deg,
    rgba(0, 210, 255, 0.3) 0%,
    transparent 52%
  );
  --color-card-top23: linear-gradient(
    145deg,
    #081424 0%,
    #12284c 50%,
    #183a6e 100%
  );

  /* --- Section washes --- */
  --color-band: linear-gradient(
    180deg,
    transparent,
    #0c1426 20%,
    #0c1426 80%,
    transparent
  );
  --color-rail: linear-gradient(180deg, #00d2ff, #1a4bff);
  --color-rail-across: linear-gradient(90deg, #00d2ff, #1a4bff);
  --color-callout: linear-gradient(
    165deg,
    rgba(0, 210, 255, 0.1),
    transparent 48%
  );

  /* --- Chrome (sticky header, footer) and overlays --- */
  --color-chrome: rgba(5, 7, 15, 0.55);
  --color-chrome-strong: rgba(5, 7, 15, 0.78);
  --color-overlay: rgba(2, 6, 18, 0.72);
  --color-overlay-strong: rgba(2, 6, 18, 0.88);

  /* Light plate behind official marks, which are dark artwork on a transparent ground. */
  --color-plate: #eef3ff;

  /* --- Radii (no pill on informational elements) --- */
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* --- Template token names, mapped onto this palette. Read by the template components that
     are kept on disk unmounted (age gate, refusal, cookie notice, sticky bar, promo modal,
     brand banner), so a rollback renders in the site's colours. --- */
  --color-surface-muted: var(--color-surface-2);
  --color-surface-subtle: var(--color-surface-2);
  --color-text-secondary: var(--color-text-muted);
  --color-text-faint: var(--color-text-subtle);
  --color-text-faintest: var(--color-text-subtle);
  --color-border-strong: var(--color-accent);
  --color-border-soft: var(--color-border);
  --color-border-softer: var(--color-border);
  --color-border-input: var(--color-border);
  --color-border-muted: var(--color-border);
  --color-inverted-bg: var(--color-accent);
  --color-inverted-bg-hover: var(--color-accent-deep);
  --color-inverted-text: var(--color-on-accent);
  --color-contrast-bg: var(--color-surface-2);
  --color-contrast-text: var(--color-text);
  --color-overlay-soft: var(--color-overlay);
  --color-spinner-track: var(--color-border);
  --color-spinner-head: var(--color-accent);
}

/* ===== Fonts ===== */

/* Font variables. In the source `<Font />` (Astro Fonts API) declared them; here the
   families come from Google Fonts (<link> in every page) and are declared explicitly —
   name and fallbacks from `fonts` in astro.config.mjs. */
:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Figtree', 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.15;
  -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,
h4 {
  font-family: var(--font-display);
}

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

button {
  cursor: pointer;
}

/* Load-bearing. `hidden` is how AgeGate, AccessDenied, PromoModal and
   CookieBanner 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 and nothing to show for
   it: the age gate's denied panel covered the page permanently, and "Verify
   age again" looked dead. Keep the `!important`; it is what makes the
   attribute win against a component that sets `display`. */
[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;
}

/* Anchors of the home page (`SECTION_IDS` in src/content.ts) clear the sticky header. */
#ponude,
#uzrast,
#pre-naloga,
#provera,
#pitanja,
#napomena {
  scroll-margin-top: 5.75rem;
}

/* 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;
}

/* ===== Site background — Ambience ===== */

/* Behind everything: a negative z-index paints above the canvas (the body background
   propagates there) and below every in-flow block, so no wrapper is needed. */
.ambience {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambience__image {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

/* ===== Header — Topline ===== */

.topline {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: var(--color-chrome-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topline::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: var(--color-accent-line);
  opacity: 0.7;
}

.topline__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0.7rem var(--layout-padding-x) 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topline__home {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.topline__home:hover {
  opacity: 0.88;
}

.topline__logo {
  width: auto;
  height: 2.5rem;
  max-width: 11rem;
  object-fit: contain;
}

.topline__age {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 0 var(--layout-padding-x) 0.45rem;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--color-text-muted);
  text-align: center;
}

.topline__age-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.08rem 0.3rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--color-on-accent);
  background: var(--color-cta);
}

@media (min-width: 769px) {
  .topline__logo {
    height: 3.15rem;
    max-width: 14rem;
  }
}

/* ===== Home — Mainhall ===== */

/* Home page (role `home`): the main column grows so the footer sits at the bottom. */
.mainhall {
  flex: 1;
}

/* ===== Hero — Frontispiece ===== */

.frontispiece {
  position: relative;
  text-align: center;
  padding: 0.8rem var(--layout-padding-x) 0.65rem;
}

.frontispiece__inner {
  max-width: 44rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.frontispiece__badge {
  margin: 0 0 0.4rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--color-on-accent);
  background: var(--color-cta);
}

.frontispiece__title {
  margin: 0 0 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text);
  font-size: clamp(1.45rem, 3.5vw, 2.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.frontispiece__accent {
  color: var(--color-accent);
  background: var(--color-cta);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: var(--color-none);
}

.frontispiece__lead {
  margin: 0 0 0.75rem;
  max-width: 42rem;
  font-size: 0.88rem;
  line-height: 1.42;
  color: var(--color-text-muted);
}

.frontispiece__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  padding: 0.45rem 1.05rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--color-on-accent);
  background: var(--color-cta);
}

.frontispiece__cta:hover {
  opacity: 0.92;
}

/* ===== Age plate — AgeStrip ===== */

.agestrip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  max-width: 960px;
  margin: 0 auto 0.65rem;
  padding: 0.35rem var(--layout-padding-x);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted);
}

.agestrip__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.12rem 0.35rem;
  border: 1px solid
    color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--color-on-accent);
  background: var(--color-cta);
}

.agestrip__text {
  text-align: left;
}

/* ===== Offer list — Lineup ===== */

.lineup {
  padding: 1.5rem 0 2rem;
}

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

/* One column at every width: only the inside of a card changes layout on desktop. */
.lineup__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

/* Sentinel the promo modal observes: a visible 1px element, never `display: none`. */
.lineup__end {
  width: 100%;
  height: 1px;
}

/* ===== Offer anchor — OfferLink ===== */

/* Positioning only — no colours. The look of the button comes from the caller's `class`. */
.offer-link {
  position: relative;
  display: flex;
  width: 100%;
}

/* `pointer-events` is set on the anchor and the overlay themselves, not inherited from the
   wrapper: the card's inner grid runs with `pointer-events: none`. The anchor's
   `position: relative` alone would lift it above the overlay, so both z-indexes are explicit. */
.offer-link__anchor {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  text-decoration: none;
}

.offer-link__cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
  border-radius: inherit;
}

/* ===== Offer card — Docket ===== */

/* Offer card. Square corners, gradient ground with a cyan sheen; the rank tier sets border,
   ground, badge and CTA. Look carried over from the previous build of this site. */
.docket {
  --docket-pad: 1.15rem;
  position: relative;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  background-image: var(--color-card-sheen), var(--color-card);
}

.docket--top {
  border: 2px solid var(--color-accent);
  background-image: var(--color-card-sheen-top), var(--color-card-top1);
  animation: docket-glow 2.6s ease-in-out infinite alternate;
}

.docket--featured {
  border-color: color-mix(
    in srgb,
    var(--color-accent) 55%,
    var(--color-border)
  );
  background-image: var(--color-card-sheen), var(--color-card-top23);
}

.docket--plain {
  background-image: var(--color-card);
}

@keyframes docket-glow {
  from {
    box-shadow: 0 0 0 0 var(--color-none);
  }
  to {
    box-shadow: 0 0 30px var(--color-accent-glow);
  }
}

/* --- Rank badge --- */
.docket__badge {
  position: absolute;
  top: -0.7rem;
  left: var(--docket-pad);
  z-index: 1;
  margin: 0;
  padding: 0.22rem 0.55rem;
  border: 1px solid
    color-mix(in srgb, var(--color-accent) 60%, var(--color-border));
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-accent);
  background: var(--color-surface-2);
}

.docket__badge--top {
  border-color: var(--color-none);
  color: var(--color-on-hot);
  background: var(--color-cta-hot);
  animation: docket-badge-lift 1.8s ease-in-out infinite alternate;
}

@keyframes docket-badge-lift {
  from {
    transform: translateY(0);
    box-shadow: 0 0 0 0 var(--color-none);
  }
  to {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--color-hot-glow);
  }
}

/* --- Inner grid: the card itself is not a link, only the CTA is --- */
.docket__inner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    'mark line'
    'cta cta';
  align-items: center;
  gap: 0.8rem 1rem;
  padding: 1.15rem var(--docket-pad) 0.9rem;
  pointer-events: none;
}

.docket__mark {
  grid-area: mark;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.docket__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
  background: var(--color-surface-2);
  box-shadow: 0 0 0 1px var(--color-border);
}

.docket--top .docket__rank {
  color: var(--color-on-accent);
  background: var(--color-cta);
  box-shadow: none;
}

.docket__well {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.25rem;
  height: 3.75rem;
  flex-shrink: 0;
  background: var(--color-logo-well);
  border: 1px solid var(--color-border);
}

.docket__logo {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  padding: 0.3rem;
}

/* --- Offer line --- */
.docket__line {
  grid-area: line;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
}

/* --- CTA (the only offer link of the card) --- */
.docket__cta {
  grid-area: cta;
  display: flex;
}

.docket__cta-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--color-accent);
  background: var(--color-none);
  box-shadow: inset 0 0 0 1px var(--color-accent);
  transition:
    background 160ms ease,
    color 160ms ease;
}

.docket__cta-link:hover {
  color: var(--color-on-accent);
  background: var(--color-cta);
  box-shadow: none;
}

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

.docket--featured .docket__cta-link {
  color: var(--color-on-accent);
  background: var(--color-cta);
  box-shadow: none;
}

.docket--featured .docket__cta-link:hover {
  background: var(--color-cta-hover);
}

.docket--top .docket__cta-link {
  color: var(--color-on-hot);
  background: var(--color-cta-hot);
  box-shadow: 0 0 22px var(--color-hot-glow);
  animation: docket-cta-pulse 2.2s ease-in-out infinite alternate;
}

.docket--top .docket__cta-link:hover {
  background: var(--color-cta-hot-hover);
}

.docket--top .docket__cta-link:focus-visible {
  outline-color: var(--color-hot);
}

@keyframes docket-cta-pulse {
  from {
    filter: brightness(1);
    box-shadow: 0 0 14px var(--color-hot-glow);
  }
  to {
    filter: brightness(1.1);
    box-shadow: 0 0 30px var(--color-hot-glow);
  }
}

/* --- Terms line under the card: outside the button, its link is not the offer --- */
.docket__terms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.45rem;
  margin: 0;
  padding: 0.55rem var(--docket-pad) 0.7rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--color-text-subtle);
}

.docket__terms-age {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-text-muted);
}

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

.docket__terms-link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.docket__terms-link:hover {
  color: var(--color-accent);
}

@media (min-width: 769px) {
  .docket__inner {
    grid-template-columns: 9.25rem minmax(0, 1fr) 11rem;
    grid-template-areas: 'mark line cta';
    gap: 1.25rem;
    padding: 1.2rem var(--docket-pad);
  }
}

@media (prefers-reduced-motion: reduce) {
  .docket--top,
  .docket__badge--top,
  .docket--top .docket__cta-link {
    animation: none;
  }
}

/* ===== Home sections — Chapters ===== */

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

.chapters__inner--narrow {
  max-width: 48rem;
}

.chapters__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.35rem, 2.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.chapters__lead {
  max-width: 38rem;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* --- Five questions: a panel with a gradient rail on the left --- */
.before {
  padding: 1.5rem 0 2.25rem;
}

.before__panel {
  position: relative;
  display: grid;
  gap: 1.4rem;
  padding: 1.5rem 1.4rem 1.5rem 1.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.before__panel::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 4px;
  background: var(--color-cta);
}

.before__list {
  display: grid;
  gap: 0.95rem;
  margin: 0;
  list-style: none;
}

.before__item {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.before__tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid
    color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  border-radius: var(--radius-md);
  color: var(--color-accent);
}

.before__tick svg {
  width: 1rem;
  height: 1rem;
}

.before__question {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.before__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* --- How the list is made: a four-step timeline on a soft band --- */
.checks {
  padding: 2.25rem 0;
  background: var(--color-band);
}

.checks__track {
  position: relative;
  display: grid;
  gap: 1.5rem;
  margin: 1.6rem 0 0;
  list-style: none;
}

.checks__track::before {
  content: '';
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 1rem;
  width: 2px;
  background: var(--color-rail);
}

.checks__step {
  position: relative;
  display: grid;
  grid-template-columns: 2rem 1fr;
  column-gap: 0.95rem;
  row-gap: 0.3rem;
}

.checks__node {
  grid-row: span 2;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-on-accent);
  background: var(--color-cta);
  box-shadow: 0 0 0 4px var(--color-bg);
}

.checks__step-title {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.checks__step-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* --- FAQ on native details --- */
.questions {
  padding: 2.25rem 0 1.5rem;
}

.questions__list {
  margin-top: 1.1rem;
  border-top: 1px solid var(--color-border);
}

.questions__item {
  border-bottom: 1px solid var(--color-border);
}

.questions__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

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

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

.questions__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-accent);
  transition: transform 180ms ease;
}

.questions__item[open] .questions__icon {
  transform: rotate(45deg);
}

.questions__answer {
  margin: 0 0 1.1rem;
  padding-right: 2.25rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.questions__more {
  margin: 1.1rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.questions__more-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (min-width: 769px) {
  .before__panel {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 2.5rem;
    padding: 2rem 2rem 2rem 2.4rem;
  }

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

  .checks__track::before {
    top: 1rem;
    bottom: auto;
    left: 1rem;
    right: 1rem;
    width: auto;
    height: 2px;
    background: var(--color-rail-across);
  }

  .checks__step {
    grid-template-columns: 1fr;
    row-gap: 0.5rem;
  }

  .checks__node {
    grid-row: auto;
  }
}

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

/* ===== Closing note — Candor ===== */

.candor {
  padding: 1.6rem var(--layout-padding-x) 2.8rem;
}

.candor__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.candor__title {
  margin: 0 0 1.15rem;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.candor__grid {
  display: grid;
  gap: 0.85rem;
}

.candor__block {
  padding: 1.05rem 1.1rem 1.15rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.candor__heading {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
}

.candor__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

@media (min-width: 769px) {
  .candor__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

/* ===== Footer — Footing ===== */

.footing {
  margin-top: auto;
  position: relative;
  color: var(--color-text);
  background: var(--color-chrome-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Separated from the content by a gradient, not a grey rule. */
.footing::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: var(--color-accent-line);
  opacity: 0.7;
}

.footing__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 2.5rem var(--layout-padding-x) 2rem;
}

.footing__statement {
  margin: 0 0 1.75rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface));
}

.footing__statement-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* The statement itself: main text colour, larger and bolder than the rest of the footer. */
.footing__statement-text {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--color-text);
}

.footing__statement .footing__note {
  margin: 0 0 1rem;
}

.footing__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(10rem, 0.6fr) minmax(
      12rem,
      0.7fr
    );
  gap: 2.5rem 3rem;
  align-items: start;
}

.footing__brand {
  max-width: 32rem;
}

.footing__logo-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.footing__logo-link:hover {
  opacity: 0.88;
}

.footing__logo {
  width: auto;
  height: 2.4rem;
  max-width: 7.8125rem;
  object-fit: contain;
}

.footing__desc {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.footing__nav-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.footing__nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footing__link {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--color-text);
  opacity: 0.88;
}

.footing__link:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footing__block {
  margin-top: 1.75rem;
}

.footing__note {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.footing__note a,
.footing__org-text a,
.footing__copy a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footing__note a:hover,
.footing__org-text a:hover,
.footing__copy a:hover {
  color: var(--color-accent);
}

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

.footing__licensees li {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.footing__licensees strong {
  font-size: 0.88rem;
  color: var(--color-text);
}

.footing__contacts {
  display: grid;
  gap: 0.5rem;
}

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

.footing__org {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.footing__org-text {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.footing__org-text .footing__org-name {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

/* Official marks are dark artwork on a clear ground: a light plate on the dark theme. */
.footing__plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-plate);
}

.footing__plate img {
  display: block;
  width: auto;
  height: 40px;
}

.footing__age-line {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text);
}

.footing__age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.45rem;
  padding: 0.12rem 0.35rem;
  border: 1px solid
    color-mix(in srgb, var(--color-accent) 55%, var(--color-border));
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  vertical-align: middle;
  background: var(--color-cta);
  color: var(--color-on-accent);
}

.footing__company {
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

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

.footing__copy {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-subtle);
}

@media (min-width: 769px) {
  .footing__licensees {
    grid-template-columns: 1fr 1fr;
  }

  .footing__contacts {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 720px) {
  .footing__top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* ===== Legal pages — Codex ===== */

/* Legal pages (role `legal-page`): a header block, the article and a side list of the other
   pages. Look carried over from the previous build. */
.codex {
  flex: 1;
  padding: 1.35rem var(--layout-padding-x) 3.5rem;
  color: var(--color-text);
}

.codex__inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.codex__hero {
  margin-bottom: 1.75rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--color-border);
}

.codex__kicker {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.codex__title {
  margin: 0 0 0.7rem;
  max-width: 18ch;
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.codex__lead {
  margin: 0 0 0.85rem;
  max-width: 40rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.codex__updated {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.codex__layout {
  display: grid;
  gap: 1.75rem;
}

/* --- Article body: element rules, since the copy is plain markup in each page --- */
.codex__article h2 {
  margin: 1.75rem 0 0.7rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--color-border);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.codex__article > h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.codex__article p,
.codex__article li {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.codex__article p {
  margin: 0 0 0.85rem;
}

.codex__article p:last-child,
.codex__article ul:last-child {
  margin-bottom: 0;
}

.codex__article ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}

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

.codex__article a:hover {
  color: var(--color-accent);
}

/* --- Facts: labelled rows with an accent rail --- */
.codex__facts {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0;
}

.codex__article .codex__facts {
  padding-left: 0;
}

.codex__facts li {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-2);
}

.codex__fact-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

.codex__article .codex__fact-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* --- Callout with the age mark --- */
.codex__callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  margin: 0 0 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--color-border);
  background: var(--color-callout), var(--color-surface);
}

.codex__age {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  background: var(--color-cta);
  color: var(--color-on-accent);
}

.codex__article .codex__callout-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* --- Help and contact boxes --- */
.codex__help {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 0;
}

.codex__article .codex__help {
  padding-left: 0;
}

.codex__help li {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.codex__help-label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
}

/* --- Side list of the other pages --- */
.codex__aside {
  padding: 1.1rem 1rem 1.2rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.codex__aside-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

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

.codex__aside-link,
.codex__aside-current {
  display: block;
  font-size: 0.9rem;
  line-height: 1.35;
}

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

.codex__aside-link:hover {
  color: var(--color-accent);
}

.codex__aside-current {
  font-weight: 700;
  color: var(--color-text);
}

@media (min-width: 900px) {
  .codex__layout {
    grid-template-columns: minmax(0, 1fr) 16.5rem;
    gap: 2.25rem;
    align-items: start;
  }

  .codex__aside {
    position: sticky;
    top: 6.25rem;
  }
}

/* ===== 404 — Waypoint ===== */

/* Full-screen states (role `interstitial`): the click hop's redirect page, /access-restricted
   and /error, the 404 and the 500. */
.waypoint {
  flex: 1;
  min-height: 70svh;
  display: grid;
  place-items: center;
  padding: 3rem var(--layout-padding-x);
}

.waypoint__card {
  width: min(34rem, 100%);
  text-align: center;
  border: 1px solid var(--color-border);
  padding: 1.8rem 1.5rem;
  background: var(--color-surface);
}

.waypoint__code {
  display: block;
  margin-bottom: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--color-accent);
}

.waypoint__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.waypoint__text {
  max-width: 44ch;
  margin: 0 auto 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.waypoint__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
  transition:
    background 160ms ease,
    color 160ms ease;
}

.waypoint__back:hover {
  color: var(--color-on-accent);
  background: var(--color-cta);
  box-shadow: none;
}
