/*
 * equesty.app — the base every page shares (launch-1 D-10, AD-11; website-1
 * AD-11, AD-12): the font faces, the reset, the frame (header, footer, .wrap)
 * and the legal chrome's primitives. The home and result pages add home.css;
 * the legal pages add legal.css.
 *
 * Every colour, radius, font family and spacing step comes from tokens.css, which is
 * GENERATED from design/tokens.json (`yarn tokens:generate`). Never write a colour
 * literal here: add or change the token instead.
 *
 * The @font-face names below ARE the font token values (`--font-display` is
 * 'PlayfairDisplay_700Bold', `--font-display-regular` 'PlayfairDisplay_400Regular'),
 * one family per weight exactly as in the app, so the font tokens can be used as
 * they are; the 400 family carries two faces, normal and italic. Each face declares
 * its real weight and `font-synthesis: none` stops the browser from faking a bolder
 * or a slanted one.
 * Fonts: DM Sans and Playfair Display, SIL Open Font License 1.1 (fonts/OFL-*.txt),
 * unmodified byte copies from @expo-google-fonts 0.4.2 — the Reserved Font Name
 * forbids a subset under that name (website-1 AD-11). Only the weights a page uses.
 */

@font-face {
  font-family: 'DMSans_400Regular';
  src: url('fonts/DMSans_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DMSans_600SemiBold';
  src: url('fonts/DMSans_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PlayfairDisplay_400Regular';
  src: url('fonts/PlayfairDisplay_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PlayfairDisplay_400Regular';
  src: url('fonts/PlayfairDisplay_400Regular_Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'PlayfairDisplay_700Bold';
  src: url('fonts/PlayfairDisplay_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: var(--font-primary), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans-strong:
    var(--font-primary-semi-bold), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: var(--font-display), Georgia, 'Times New Roman', serif;
  --page-inline: var(--spacing-gutter);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg-parchment);
  color: var(--color-ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

strong,
h3 {
  font-family: var(--sans-strong);
  font-weight: 600;
}

.wrap {
  width: 100%;
  max-width: 1168px;
  margin-inline: auto;
  padding-inline: var(--page-inline);
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--color-linen);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.3px;
  color: var(--color-primary);
  text-decoration: none;
}

/*
 * A 44 px tap target with no layout change: each link is at least 44 px tall,
 * with its text centred, and a negative block margin takes the extra back, so
 * its margin box stays one line (`body` line-height 1.55, above). The text does
 * not move; only the area that takes the tap grows.
 */
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: calc((1.55em - 44px) / 2);
}

/* ── Type ───────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--sans-strong);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-dark-text);
}

h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.5px;
  text-wrap: balance;
}

h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
}

/* ── Buttons (the legal chrome) ─────────────────────────── */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 6px 12px;
  border-radius: var(--radius-m);
  font-family: var(--sans-strong);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.button-secondary {
  flex: 1 1 7.5rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-linen);
  color: var(--color-ink);
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--color-linen);
}

/*
 * The row gap keeps wrapped rows at least 44 px apart (one 1.55em line plus the
 * gap), so the links' 44 px tap areas (`.site-footer a`, above) touch but never
 * overlap when larger text puts them on separate lines. It is never under 8 px,
 * and on one row it changes nothing.
 */
.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: max(8px, 44px - 1.55em) 18px;
  padding-block: 22px 28px;
  font-size: 13px;
  color: var(--color-ink-muted-text);
}

.site-footer a {
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Wider screens ──────────────────────────────────────── */

@media (min-width: 640px) {
  :root {
    --page-inline: 40px;
  }

  h1 {
    font-size: 44px;
  }
}

@media (min-width: 960px) {
  :root {
    --page-inline: 64px;
  }

  .site-header-inner {
    padding-block: 22px;
  }

  h1 {
    font-size: 52px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: opacity 120ms ease;
  }
}

.button:hover {
  opacity: 0.92;
}
