/**
 * SPY — the design system. Loaded by every page except profile.html.
 *
 * THE IDIOM. Editorial, warm, quiet, with one loud note. Cream paper, near-black
 * text set large and tight, generous vertical whitespace, and a neon yellow that
 * appears rarely enough to still mean something when it does.
 *
 * ── THE ONE RULE ABOUT THE YELLOW ────────────────────────────────────
 *
 * #E4FF3A on cream is a contrast ratio of about 1.2:1. It is invisible as text.
 * It is not a text colour and there is no size at which it becomes one.
 *
 * It is a SURFACE: yellow behind near-black type (17.5:1, better than the body
 * text itself) for buttons and highlights, and a hairline or a dot where a
 * graphic accent is wanted. Every use in this file follows that. If you find
 * yourself writing `color: var(--neon)`, the answer is a yellow background with
 * `--ink` on top instead.
 *
 * ── TYPE ─────────────────────────────────────────────────────────────
 *
 * System fonts, deliberately. A webfont would mean either a third-party CDN on
 * every page — the same dependency argued against for the auth library, and
 * this one blocks first paint — or font files this repo does not have. The
 * editorial feel is carried by SIZE, TIGHT TRACKING and LINE HEIGHT instead,
 * which costs nothing and cannot fail to load. On a Mac this resolves to SF
 * Pro, which is already a clean grotesk.
 *
 * ── CLASS CONTRACT ───────────────────────────────────────────────────
 *
 * The legal pages (privacy, terms, guidelines, support, delete-account) were
 * written against the OLD stylesheet and their markup has not been touched.
 * They use `header.site`, `.brand`, `.updated`, `.card`, `.card a.block`,
 * `.btn`, `.note` and a plain `<main>`. Every one of those still works below,
 * restyled. Renaming any of them silently breaks five pages that nothing else
 * references.
 */

:root {
  /* Paper */
  --cream: #FAF7F2;
  --cream-deep: #F2EDE4; /* section banding */
  --card: #FFFFFF;

  /* Ink */
  --ink: #14110F;
  --ink-soft: #5F574F;  /* 7.2:1 on --cream */
  --ink-faint: #726A62; /* 5.0:1 on cream, 4.6:1 on the banded sections */

  /* The one loud note. A surface, never a text colour — see above. */
  --neon: #E4FF3A;
  /**
   * The rim of anything yellow, and it has to be THIS dark.
   *
   * Neon on cream is 1.05:1 — the fill gives a button no perceivable shape at
   * all, so the border is the only thing that says "this is a control", and
   * WCAG 1.4.11 wants 3:1 for that. #85980F is 3.2:1 on white and 3.0:1 on
   * cream. A lighter, prettier olive fails the one job this colour has.
   */
  --neon-deep: #85980F;

  /**
   * Two greys, on purpose.
   *
   * `--line` is decoration: dividers, banding, the edge of a card whose job is
   * just to look tidy. `--line-strong` is for anything INTERACTIVE — inputs,
   * selects, the outline of a control. A white panel on cream is 1.07:1 and a
   * cream input inside it is another 1.07:1, so on this palette a form field is
   * literally invisible except for its border. That border therefore has to
   * clear 3:1, which --line does not and --line-strong does.
   */
  --line: #E3DCD1;
  --line-strong: #8A867F;
  --line-soft: #EFE9E0;

  --ok: #1B6B45;
  --bad: #A3231B;

  --radius: 18px;
  --radius-lg: 26px;
  --measure: 66ch;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
    Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  /* Optical niceties that cost nothing and read as "designed". */
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

/* ── type scale ──────────────────────────────────────────────────────
   The whole editorial effect lives in three properties: big size, tight
   leading, negative tracking. Loosen any of them and this turns back into
   a generic template. */

h1 {
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  /* Inyo breaks its headlines across two deliberate lines. `balance` gets the
     same shape without hand-placed <br>s that go wrong on a phone. */
  text-wrap: balance;
}

h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
  margin: 44px 0 14px;
  text-wrap: balance;
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

p, li {
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: var(--measure);
}

ul { padding-left: 22px; margin-bottom: 14px; }
li { margin-bottom: 8px; }

strong, b { color: var(--ink); font-weight: 600; }

a {
  color: var(--ink);
  text-decoration-color: var(--neon-deep);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--ink); }

/**
 * The eyebrow — Inyo's "Designed with science" label. Small, uppercase, widely
 * tracked, sitting above a headline. The cheapest device there is for making a
 * page feel art-directed rather than assembled.
 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  /* Ringed so the dot survives on white cards, where neon alone vanishes. */
  box-shadow: 0 0 0 1.5px var(--neon-deep);
}

.lede {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 30px;
}

.updated { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 30px; }

/* The #embed rules that let legal.js frame these documents in a modal are
   gone with it — the legal pages are ordinary pages again, on legal.css. */

/* ── site chrome ─────────────────────────────────────────────────────
   `header.site` is the legal pages' header. It was a violet slab; now it is
   quiet paper with a hairline, so the content leads instead of the bar. */

header.site {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 22px 24px;
  text-align: center;
}
header.site a.brand,
header.app a.brand {
  display: inline-block;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* re-centres text that has a trailing letter-space */
  text-decoration: none;
}
header.site p {
  color: var(--ink-faint);
  font-size: 13px;
  margin: 6px auto 0;
  max-width: none;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px 90px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 30px 24px 54px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13.5px;
}
footer a { margin: 0 9px; white-space: nowrap; color: var(--ink-soft); }
footer p { color: var(--ink-faint); max-width: none; }

/* ── cards ───────────────────────────────────────────────────────────
   Used by the legal index and the landing page. */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--ink); }
.card h3 { margin-bottom: 5px; }
.card p { font-size: 15px; margin-bottom: 0; color: var(--ink-soft); }
.card a.block { display: block; text-decoration: none; }

/**
 * A link-card grows a yellow rule down its left edge on hover — somewhere for
 * the colour to be loud without ever having to be legible.
 */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--neon);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.card:hover::before { opacity: 1; }

/* ── buttons ─────────────────────────────────────────────────────────
   The primary button IS the yellow: neon behind near-black type, 17.5:1.
   Loud, and more readable than the body copy around it. */

.btn,
button.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 30px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
  background: var(--neon);
  border: 1px solid var(--neon-deep);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.btn:hover,
button.primary:hover,
a.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(228, 255, 58, 0.55);
}
button.primary:disabled {
  background: var(--line-soft);
  border-color: var(--line);
  color: var(--ink-faint) !important;
  cursor: default;
  transform: none;
  box-shadow: none;
}

button.quiet,
a.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
}
button.quiet:hover { border-color: var(--ink); }
button.danger { color: var(--bad); border-color: rgba(163, 35, 27, 0.3); }

/* ── note ────────────────────────────────────────────────────────────
   The legal pages' callout. Yellow bar on the left, white fill. */

.note {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--neon);
  padding: 16px 20px;
  border-radius: 12px;
  margin: 22px 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}
.note strong { color: var(--ink); }

/* ── focus ───────────────────────────────────────────────────────────
   Yellow alone is not a visible focus ring on cream. Two rings: ink for the
   contrast, neon outside it for the brand. Never replace this with none. */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(228, 255, 58, 0.55);
  border-radius: 6px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  background: var(--card);
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
