/*
 * pinthoppers.com - the one stylesheet (T45, D-A30; two themes since T48, D-A35;
 * the landing page since D-A70).
 *
 * THE COLOURS ARE THE APP'S, BY NAME. Each `--color-*` below is a role from
 * `src/ui/tokens.ts`, and `tests/web/site.test.ts` compares the values and the
 * text/background pairs used here with that file's `readablePairs`, so the site
 * cannot drift to a contrast nobody measured. No hex appears outside the two
 * palette blocks. (Lower case because Prettier writes CSS hex that way; the
 * test compares without case.)
 *
 * TWO PALETTES, ONE SET OF RULES. The light palette is the top-level `:root`,
 * the dark one the `:root` in the `prefers-color-scheme: dark` query under it,
 * and the page follows the reader's system theme as the app does. Every rule
 * below is written once, by role, and the dark block does nothing but redefine
 * the palette: that is what lets one pairs check hold in both themes, so the
 * test refuses a dark block that restyles anything. It also refuses one that
 * forgets a role - the role would keep its light value, and the light text on
 * the dark ground is 1.28:1.
 *
 * `color-scheme` tells the browser the page comes in both, so what it draws
 * itself (the policy table's scrollbar, any form control) follows the theme
 * too. It is here and not in a `<meta>` in each page: the stylesheet is
 * render-blocking, so the browser knows it before the first paint, and the
 * declaration sits beside the palettes it describes.
 *
 * ONE FONT FILE, SERVED FROM HERE. Headings are Righteous, the app's heading
 * face (`src/ui/fonts.ts`), so the site reads as the app does. It is the same
 * OFL file the app bundles, served from this origin with its licence beside
 * it (`/fonts/OFL.txt`) - no font service, no request anywhere else; the CSP
 * allows `font-src 'self'` and nothing more. Body text stays on the system
 * face: the policy pages are read, not admired.
 *
 * THE CARDS ARE THE APP'S WARM SURFACE. A step and the "no drinks are counted"
 * card sit on `surfaceWarm`, the ground of the app's home card; the text on it
 * is `text` and `textMuted`, both measured there by the app.
 */
@font-face {
  font-family: 'Righteous';
  src: url('/fonts/righteous.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --color-text: #14342b;
  --color-text-muted: #526860;
  --color-surface: #f3f1eb;
  --color-surface-warm: #f1e0c5;
  --color-border: #72847c;
  --color-accent: #e8a33d;
  --color-on-accent: #14342b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f3f1eb;
    --color-text-muted: #89908a;
    --color-surface: #0c1e19;
    --color-surface-warm: #102b23;
    --color-border: #69736d;
    --color-accent: #e8a33d;
    --color-on-accent: #14342b;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
.brand {
  font-family:
    'Righteous',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-weight: 400;
}

/* ── Header and footer, on every page ─────────────────────────────────────── */

.bar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 72rem;
  padding: 1rem 1.25rem;
}

.brand {
  align-items: center;
  color: var(--color-text);
  display: inline-flex;
  font-size: 1.4rem;
  gap: 0.6rem;
  text-decoration: none;
}

.brand img {
  border-radius: 0.6rem;
  display: block;
}

.lang {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 0.3rem 0.9rem;
  text-decoration: none;
}

.foot {
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  margin: 3rem auto 0;
  max-width: 72rem;
  padding: 1.5rem 1.25rem 2.5rem;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

/* ── The policy and support pages ─────────────────────────────────────────── */

main {
  margin: 0 auto;
  max-width: 44rem;
  padding: 1.5rem 1rem 1rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
}

a {
  color: var(--color-text);
}

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

table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem 0.5rem 0;
  text-align: left;
  vertical-align: top;
}

/* ── The landing page ─────────────────────────────────────────────────────── */

.landing {
  max-width: 72rem;
  padding: 0 1.25rem 1rem;
}

.hero {
  align-items: center;
  display: grid;
  gap: 2.5rem;
  padding: 2rem 0 3.5rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  line-height: 1.05;
  margin: 1rem 0 1.25rem;
}

.lead {
  font-size: 1.25rem;
  margin: 0 0 1rem;
  max-width: 34rem;
}

.badge {
  background: var(--color-accent);
  border-radius: 999px;
  color: var(--color-on-accent);
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  padding: 0.35rem 0.9rem;
}

.phone {
  justify-self: center;
  margin: 0;
}

.phone img {
  border: 0.55rem solid var(--color-text);
  border-radius: 2.4rem;
  display: block;
  height: auto;
  max-width: 100%;
  width: 19rem;
}

.landing h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.landing section {
  padding: 3rem 0;
}

.steps {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.step {
  background: var(--color-surface-warm);
  border-radius: 1.25rem;
  color: var(--color-text);
  padding: 1.5rem;
}

.step h3 {
  font-size: 1.3rem;
  margin: 0.75rem 0 0.25rem;
}

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

.num {
  background: var(--color-accent);
  border-radius: 50%;
  color: var(--color-on-accent);
  display: inline-grid;
  font-family:
    'Righteous',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  height: 2.4rem;
  place-items: center;
  width: 2.4rem;
}

.feature {
  align-items: center;
  display: grid;
  gap: 2.5rem;
}

.feature p {
  font-size: 1.15rem;
  max-width: 32rem;
}

.card {
  background: var(--color-surface-warm);
  border-radius: 1.5rem;
  color: var(--color-text);
  padding: 2rem 1.5rem;
}

.card p {
  font-size: 1.15rem;
  margin: 0;
  max-width: 40rem;
}

.areas {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.area {
  background: var(--color-surface-warm);
  border-radius: 1.5rem;
  color: var(--color-text);
  overflow: hidden;
}

.area img {
  aspect-ratio: 4 / 3;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.area h3 {
  font-size: 1.6rem;
  margin: 1.25rem 1.5rem 0.25rem;
}

.area p {
  margin: 0 1.5rem 0.75rem;
}

.area .credit {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.area .credit a {
  color: var(--color-text-muted);
}

.faq details {
  border-bottom: 1px solid var(--color-border);
  padding: 1.1rem 0;
}

.faq summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
}

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

/* A chevron drawn from two borders: no glyph, so no font needs to carry it. */
.faq summary::after {
  border-bottom: 2px solid var(--color-text);
  border-right: 2px solid var(--color-text);
  content: '';
  flex: none;
  height: 0.6rem;
  margin-right: 0.3rem;
  transform: rotate(45deg);
  transition: transform 0.2s;
  width: 0.6rem;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq details p {
  margin: 0.75rem 0 0;
}

@media (min-width: 52rem) {
  .hero {
    gap: 4rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 3rem 0 4.5rem;
  }

  .hero .phone,
  .feature .phone {
    justify-self: stretch;
  }

  .phone img {
    width: 21rem;
  }

  .areas {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .card {
    padding: 3rem;
  }
}
