/*
 * saidweekly shared styles: tokens, self-hosted fonts and the components every page will share.
 * Same-origin, so the site still makes no third-party request. Page-specific rules stay inline in
 * each page's <style>. See CLAUDE.md for the design direction this follows.
 *
 * One committed look, no dark variant: the logo's white speech bubble only reads on a light ground.
 */

/* ---------- Fonts (OFL, latin subsets; licenses beside them in /fonts) ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/instrument-serif-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --ink: #111111;
  --accent: #D62F22;
  --paper: #F2F0EC;
  --muted: #6B6B6B;
  --field: #FFFFFF;
  --line: #D8D5CF;

  /* Derived only: no new hues. */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--paper));
  --accent-deep: color-mix(in srgb, var(--accent) 80%, var(--ink));
  --ink-2: color-mix(in srgb, var(--ink) 88%, var(--paper));    /* cards on ink */
  --ink-3: color-mix(in srgb, var(--ink) 82%, var(--paper));    /* hairlines and empty cells on ink */
  --paper-dim: color-mix(in srgb, var(--paper) 65%, var(--ink)); /* quiet text on ink */
  --accent-light: color-mix(in srgb, var(--accent) 75%, var(--paper)); /* small red text on ink: 5.2:1, where --accent is 3.9:1 */

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-mark: Georgia, "Times New Roman", serif; /* the wordmark's own face, as in the logo */

  --step-hero: clamp(2.75rem, 6.6vw, 5.75rem);
  --step-h2: clamp(2.25rem, 4.6vw, 4rem);
  --step-h3: clamp(1.375rem, 2vw, 1.625rem);
  --step-body: 1.125rem;
  --step-meta: 0.8125rem;

  --gutter: clamp(16px, 4vw, 48px);
  --container: 1240px;
  --section-pad: clamp(5rem, 11vw, 9.5rem);
  --radius: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  font-optical-sizing: auto;
  line-height: 1.6;
  overflow-x: clip;
}

img, svg { max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; transition: color 150ms var(--ease); }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); border-radius: 999px;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: var(--section-pad); }
.on-ink { background: var(--ink); color: var(--paper); }

/* ---------- Type ---------- */

.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

.h2 {
  margin: 0;
  font-family: var(--font-display); font-size: var(--step-h2); font-weight: 800;
  line-height: 1; letter-spacing: -0.035em; text-wrap: balance;
}

/* File-name eyebrow: 03 / calendar.json */
.eyebrow {
  display: block; margin: 0 0 0.875rem;
  font-family: var(--font-mono); font-size: var(--step-meta); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow--red { color: var(--accent-deep); }
.on-ink .eyebrow--red { color: var(--accent-light); }

.wordmark { font-family: var(--font-mark); font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark span { color: var(--accent); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0.9rem 1.75rem;
  border: 2px solid var(--ink); border-radius: 999px;
  font-family: var(--font-body); font-size: 1.125rem; font-weight: 700; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--paper);
  box-shadow: 4px 4px 0 var(--accent);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.btn:hover { color: var(--paper); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--accent); }

.btn--ghost { background: transparent; color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost:hover { color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }

.btn--sm { min-height: 44px; padding: 0.6rem 1.35rem; font-size: 1rem; }
.btn--lg { padding: 1.1rem 2.1rem; font-size: 1.1875rem; }

/* On the red band the press shadow is paper, not red. */
.btn--on-red { box-shadow: 5px 5px 0 var(--paper); }
.btn--on-red:hover { box-shadow: 7px 7px 0 var(--paper); }
.btn--on-red:active { box-shadow: 0 0 0 var(--paper); }

/* The bracketed text CTA: [[ How it works ]] */
.bracket {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px;
  font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 600; text-decoration: none;
}

/* ---------- Stickers and cards ---------- */

.sticker {
  display: inline-block; padding: 0.6rem 1.1rem;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--accent); color: var(--field); /* white, not paper: 4.9:1 at this size */
  font-family: var(--font-mono); font-size: var(--step-meta); font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink);
}

.card { background: var(--field); border: 2px solid var(--ink); border-radius: var(--radius); }
.card--shadow { box-shadow: 6px 6px 0 var(--ink); }
.card--ink { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--accent); }

/* The logo's speech-bubble tail, hung under a .card. Set --tail-left to place it. */
.bubble-tail { display: block; width: 64px; height: 44px; margin: -2px 0 0 var(--tail-left, 72px); overflow: visible; }
.bubble-tail path { fill: var(--field); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.bubble-tail .seam { fill: none; stroke: var(--field); stroke-width: 4; }

/* ---------- Marquee: CSS only, pauses on hover, still under reduced motion ---------- */

.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Site header ---------- */

.site-head .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding-block: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand .wordmark { font-size: 1.5rem; color: var(--ink); }
.brand:hover { color: inherit; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 clamp(1rem, 3vw, 2.25rem); }
.site-nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-mono); font-size: 0.875rem; text-decoration: none;
}
/* The page you are on: --accent-deep, since plain red at this size is under 4.5:1 on paper. */
.site-nav a[aria-current="page"] { color: var(--accent-deep); }
/* With a button in the nav, phones keep just the button; without one, the links wrap instead. */
@media (max-width: 720px) {
  .site-nav--cta a.nav-link { display: none; }
}
@media (max-width: 380px) {
  .brand .wordmark { font-size: 1.25rem; }
  .site-nav .btn { padding-inline: 1rem; }
}

/* ---------- Site footer ---------- */

.site-foot { background: var(--ink); color: var(--paper); padding: clamp(4rem, 8vw, 7rem) 0 2.5rem; }
.site-foot .wordmark { display: block; margin-bottom: 3rem; font-size: clamp(4rem, 15vw, 13.75rem); line-height: 0.85; letter-spacing: -0.04em; }
.foot-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--ink-3); font-family: var(--font-mono); font-size: 0.875rem; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); }
.foot-nav a:hover { color: var(--accent); }
.foot-nav small { margin-left: auto; padding-block: 0.75rem; color: var(--paper-dim); font-size: inherit; }

/* Slim footer: the links only, for pages that end on an ink section of their own. */
.site-foot--slim { padding: 0.5rem 0 2rem; border-top: 1px solid var(--ink-3); }
.site-foot--slim .foot-nav { padding-top: 0.75rem; border-top: 0; }

/* ---------- Documents: terms and privacy (numbered contents, sections, tables) ---------- */

.doc-hero .container { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.doc-hero .eyebrow { margin-bottom: 1.5rem; }
.doc-hero h1 { margin: 0 0 1.75rem; font-size: clamp(3.25rem, 8vw, 7.25rem); font-weight: 800; line-height: 0.92; letter-spacing: -0.05em; }
.doc-hero h1 .serif { color: var(--accent); }
.date-pill { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 8px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 0.8125rem; }
.date-pill strong { font-weight: 600; }
.date-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.doc { padding-bottom: var(--section-pad); }
.doc > .container { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(2rem, 5vw, 4rem); }
.toc { flex: 1 1 260px; min-width: 0; padding: 22px 16px; background: var(--field); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.4; }
@media (min-width: 900px) { .toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; } }
.toc-label { margin: 0; padding: 0 10px 12px; color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; border-radius: 10px; text-decoration: none; }
/* With a mouse the mockup's tighter list; on touch every entry keeps a 44px target. */
@media (pointer: fine) { .toc a { min-height: 0; padding-block: 7px; } }
.toc a:hover { background: var(--paper); color: var(--ink); }
.toc a span { flex: none; color: var(--accent-deep); }

.doc-body { flex: 999 1 560px; min-width: 0; max-width: 760px; line-height: 1.65; }
.doc-body a { text-decoration-color: var(--accent); }
.doc-body p, .doc-body ul { margin: 0 0 16px; }
.doc-body ul { padding-left: 22px; }
.doc-body li { margin-bottom: 8px; }
.doc-body h3 { margin: 30px 0 12px; font-size: 1.3125rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
.doc-intro { margin-bottom: 48px; padding: clamp(24px, 3vw, 34px); background: var(--field); border: 2px solid var(--ink); border-radius: 22px; font-size: 1.1875rem; }
.doc-intro p:last-child { margin-bottom: 0; }
.doc-sec { padding: 40px 0; border-top: 2px dashed var(--line); scroll-margin-top: 24px; }
.doc-sec:first-child, .doc-intro + .doc-sec { padding-top: 0; border-top: 0; }
.doc-sec h2 { margin: 0 0 18px; font-size: clamp(1.625rem, 2.6vw, 2.125rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
.doc-num { margin-right: 0.35em; color: var(--accent-deep); font-family: var(--font-mono); font-weight: 600; }
.callout { padding: 16px 20px; border-radius: 14px; background: var(--accent-soft); }
.callout--strong { font-weight: 700; }

.doc-table { overflow-x: auto; margin: 0 0 18px; background: var(--field); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink); }
.doc-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.doc-table thead th { padding: 12px 18px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.doc-table tbody th { width: 34%; padding: 14px 18px; font-weight: 700; text-align: left; vertical-align: top; }
.doc-table tbody td { padding: 14px 18px; vertical-align: top; }
.doc-table tbody tr + tr th, .doc-table tbody tr + tr td { border-top: 1px solid var(--line); }

/* ---------- Motion: nothing moves for anyone who asked for less ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
