/*
 * The public site's own rules for A1 (#543). Every value is a token from
 * tokens.css (docs/brand/tokens/tokens.css, copied in by build.mjs; never
 * edited here) except the four widths below, which have no token. They are
 * the "no token" list the PR reports, and site/check.mjs fails on any other
 * px, hex or ms literal in this file:
 *
 *   1040px  the desktop measure (drawn: "held to a 1040px measure")
 *    560px  the copy column's measure, desktop and mobile (drawn at 560px)
 *    140px  a desktop tile's width (drawn)
 *   1024px  the desktop breakpoint, a literal because custom properties do
 *           not work in media queries (docs/brand/tokens/breakpoints.ts)
 *
 * No script, no photo, no spinner, no italic. Press state on every link is
 * a background shift plus scale(0.97); reduced motion keeps the colour and
 * drops the transform (brand/RULES.md, Motion).
 */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: var(--border-width-thick) solid var(--focus-ring);
  outline-offset: var(--space-2);
}

p,
h1 {
  margin: 0;
}

/* ── Mobile, the base style (drawn at 390) ───────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--space-24) var(--space-24);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.top-link {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent-text);
  text-decoration: none;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding-top: var(--space-16);
}

.tiles {
  display: flex;
  gap: var(--space-12);
}

.tile {
  width: var(--space-64);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--mark-ink);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

/* One class per colourway, so the page needs no style attribute and the
   policy in _headers can refuse inline style. The letters are as drawn. */
.tile-2 {
  background: var(--mark-2);
}

.tile-3 {
  background: var(--mark-3);
}

.tile-5 {
  background: var(--mark-5);
}

.tile-7 {
  background: var(--mark-7);
}

.tile-desktop-only {
  display: none;
}

.copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  width: 100%;
  max-width: 560px;
}

.lede {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.lede p {
  font-size: var(--text-md);
  line-height: var(--leading-md);
  color: var(--text-muted);
}

.cta {
  min-height: var(--tap-min-bottom);
  padding: 0 var(--space-16);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-solid);
  color: var(--on-accent);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  padding: var(--space-16);
  background: var(--bg-subtle);
  border: var(--border-width) solid var(--line-subtle);
  border-radius: var(--radius-lg);
}

.note-icon {
  flex-shrink: 0;
  width: var(--icon-md);
  height: var(--icon-md);
  color: var(--text-muted);
}

.note-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
  color: var(--text-muted);
}

.note-title {
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.foot {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-24);
  padding-top: var(--space-16);
  border-top: var(--border-width) solid var(--line-subtle);
}

.adults {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--text-muted);
}

.adults-icon {
  width: var(--icon-xs);
  height: var(--icon-xs);
}

.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-20);
}

.legal a {
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: underline;
}

/* ── Press state: a background shift and scale(0.97) ─────────────────── */

.top-link,
.cta,
.legal a {
  transition:
    transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.top-link:active,
.cta:active,
.legal a:active {
  background: var(--surface-active);
  transform: scale(0.97);
}

.cta:active {
  background: var(--accent-solid-hover);
}

@media (prefers-reduced-motion: reduce) {
  .top-link,
  .cta,
  .legal a {
    transition: background var(--duration-instant) var(--ease-out);
  }

  .top-link:active,
  .cta:active,
  .legal a:active {
    transform: none;
  }
}

/* ── Desktop (drawn at 1280): the same parts in two columns ──────────── */

@media (min-width: 1024px) {
  .page {
    padding: 0 var(--space-32);
  }

  .top {
    height: var(--space-64);
  }

  .wordmark {
    font-size: var(--text-xl);
  }

  .top-link {
    padding: 0 var(--space-16);
    border: var(--border-width) solid var(--line-strong);
    border-radius: var(--radius-md);
    color: var(--text);
  }

  .hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-64);
    padding-top: 0;
  }

  .copy {
    flex: 1;
  }

  h1 {
    font-size: var(--text-3xl);
    line-height: var(--leading-3xl);
  }

  .lede {
    gap: var(--space-16);
  }

  .cta {
    align-self: flex-start;
    display: inline-flex;
    padding: 0 var(--space-32);
  }

  .tiles {
    order: 2;
    display: grid;
    grid-template-columns: repeat(2, auto);
    align-content: center;
    gap: var(--space-16);
  }

  .tile {
    width: 140px;
  }

  .tile-desktop-only {
    display: flex;
  }

  .foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: var(--space-64);
    margin-top: 0;
    padding-top: 0;
  }
}

/* ── The legal pages (#977) ──────────────────────────────────────────── */

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

.doc {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 100%;
  max-width: 560px;
  padding-top: var(--space-16);
  padding-bottom: var(--space-32);
}

.doc h1 {
  font-size: var(--text-xl);
  line-height: var(--leading-xl);
}

.doc h2 {
  margin: var(--space-16) 0 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  font-weight: var(--weight-semibold);
}

.doc p,
.doc ul {
  margin: 0;
}

.doc ul {
  padding-left: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.doc .voice,
.doc .doc-version {
  color: var(--text-muted);
}

.doc .doc-version {
  font-size: var(--text-sm);
}

.doc a {
  color: var(--accent-text);
}

/* A table scrolls inside its own box on a narrow screen, never the page. */
.table-wrap {
  overflow-x: auto;
  border: var(--border-width) solid var(--line-subtle);
  border-radius: var(--radius-md);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.doc th,
.doc td {
  padding: var(--space-8) var(--space-12);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-width) solid var(--line-subtle);
}

.doc th {
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
}

.doc tr:last-child td {
  border-bottom: 0;
}

/* A gap the text marks as still to be filled. Kept visible on purpose: it is
   not filled in, hidden or softened (#977). Colour is not the only cue: the
   marker's own words ("OWNER", "GAP") are shown. */
.gap {
  padding: 0 var(--space-4);
  background: var(--warn-bg);
  color: var(--warn-text);
  border: var(--border-width) solid var(--warn-line);
  border-radius: var(--radius-sm);
}
