/* Vanish design tokens.
 *
 * Twelve distinct values under fifteen names. Dark on every host and page:
 * there is no light ramp, no prefers-color-scheme branch and no toggle
 * (owner decision 1). Every ratio in the comments is computed from the sRGB
 * formula in docs/buildspec/10-visual-system.md and verified in CI.
 */
:root {
  color-scheme: dark;

  /* Grounds. --recess is a hover/pressed/selected ground only, never a
     resting one. */
  --ground: #1c1a22;
  --panel: #221a2a;
  --recess: #2e2439;

  /* Text. --text-dis is for disabled labels and ::placeholder only, and is
     deliberately exempt from AA. */
  --text: #efebf2;      /* 14.62 on ground, 14.28 on panel, 12.49 on recess */
  --text-2: #a79db2;    /*  6.65 /  6.49 /  5.68 */
  --text-dis: #7a6e85;  /*  3.60 /  3.52 /  3.08 */

  /* Lines. --hair fails 3:1 everywhere and is decorative by rule; --edge is
     the only meaningful control boundary. */
  --hair: #473c55;      /*  1.68 /  1.64 /  1.43 — decorative only */
  --edge: #7a6c8e;      /*  3.58 /  3.49 /  3.06 */

  /* Links and the live indicator, and nothing else. */
  --link: #8fa6ff;      /*  7.43 /  7.26 /  6.35 */

  /* Carmine, split by role. --mark is graphic only: the perforation and the
     unread dot. It is 4.37 on ground, so it is never text. --mark-text is
     the text form: errors, danger labels, 4xx/5xx in code. */
  --mark: #f03456;      /*  4.37 /  4.27 /  3.73 — graphic only */
  --mark-text: #ff8095; /*  7.19 /  7.02 /  6.15 */

  /* Aliases by value, so a change to --text cannot desynchronise them. */
  --fill: var(--text);
  --on-fill: var(--panel);  /* 14.28 on --fill */
  --focus: var(--text);     /* ring floor 12.49, on --recess */
  --fill-hover: #ffffff;    /* 16.81 label, 17.21 against the page */

  /* Type. Self-hosted, so neither Google Fonts origin appears in the CSP. */
  --serif: Newsreader, Charter, Cambria, Georgia, serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale. Newsreader carries the display sizes; Instrument Sans the prose;
     Martian Mono every address, token and code literal. */
  --t-hero: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  --t-h2: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --t-lede: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --t-body: 1rem;
  --t-small: 0.875rem;
  --t-code: 0.875rem;

  /* Motion. One orchestrated moment, not an effect per section. */
  --ease: cubic-bezier(0.2, 0, 0.3, 1);
  --d-fast: 90ms;
  --d-base: 120ms;
  --d-move: 180ms;

  --r0: 2px;
  --measure: 34em;
}

/* The brand host. No script runs here beyond the copy button, and nothing
 * loads from another origin. */

@font-face {
  font-family: Newsreader;
  src: url("/assets/fonts/Newsreader-1e7975a3fbf06337.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-9da355d554826ac4.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/MartianMono-8b08b1479ffb0c35.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 87.5% 100%;
  font-style: normal;
  font-display: swap;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--link); color: var(--panel); }

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }

/* --- masthead ---------------------------------------------------------- */

.masthead-in {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 28px;
  padding-top: 28px;
}
.masthead nav { display: flex; gap: 22px; font-size: var(--t-small); }
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.masthead nav a { color: var(--text-2); text-decoration: none; }
.masthead nav a:hover { color: var(--text); text-decoration: underline; }

/* --- hero -------------------------------------------------------------- */

.hero { padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(40px, 6vw, 72px); }

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-hero);
  line-height: 1.04;
  letter-spacing: -0.016em;
  margin: 0 0 0.5em;
  max-width: 15ch;
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.5;
  color: var(--text-2);
  max-width: var(--measure);
  margin: 0 0 2.5rem;
}

/* The ticket. The address is the product, so it gets the panel and the
   perforation; everything around it stays quiet. */
.ticket {
  background: var(--panel);
  border-radius: var(--r0);
  padding: 22px 22px 18px;
  max-width: 44rem;
}
.tear { display: block; width: 100%; height: auto; }

.ticket-addr {
  font-family: var(--mono);
  font-size: clamp(0.9375rem, 0.55rem + 1.7vw, 1.4375rem);
  font-variation-settings: "wdth" 100;
  line-height: 1.3;
  overflow-wrap: anywhere;
  margin: 0 0 20px;
}
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: var(--t-small);
  color: var(--text-2);
  margin-top: 14px;
}
.ticket-meta b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.caption {
  font-size: var(--t-small);
  color: var(--text-2);
  max-width: var(--measure);
  margin: 14px 0 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 2.25rem 0 0; }

.btn {
  display: inline-block;
  background: var(--fill);
  color: var(--on-fill);
  font-weight: 500;
  font-size: var(--t-body);
  padding: 11px 20px;
  border-radius: var(--r0);
  text-decoration: none;
  transition: background var(--d-base) var(--ease);
}
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: translateY(1px); }
.btn-quiet { color: var(--text-2); font-size: var(--t-small); text-decoration: none; }
.btn-quiet:hover { color: var(--text); text-decoration: underline; }

/* --- sections ---------------------------------------------------------- */

section { border-top: 1px solid var(--hair); }
section > .wrap { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--t-h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75em;
}

p { max-width: var(--measure); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li { counter-increment: step; margin: 0 0 28px; }
.steps > li:last-child { margin-bottom: 0; }
.steps h3 {
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 500;
  margin: 0 0 8px;
}
.steps h3::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--text-2);
  margin-right: 12px;
}
.steps p { color: var(--text-2); margin: 0 0 10px; }

/* Code. One ground, one surround, three colours and no more. */
pre {
  background: var(--ground);
  border: 1px solid var(--hair);
  border-radius: var(--r0);
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--t-code);
  line-height: 1.7;
  font-variation-settings: "wdth" 100;
}
pre .c { color: var(--text-2); }
pre .e { color: var(--mark-text); }

/* The D7 notice: chalk, body size, a rule and nothing else. No carmine, no
   frame, no dismiss. */
.notice {
  border-left: 2px solid var(--text-2);
  padding-left: 12px;
  margin: 0;
  max-width: var(--measure);
}
.notice p { margin: 0 0 0.6em; }
.notice p:last-child { margin-bottom: 0; }

.facts { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
}
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--text-2); }
.facts b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

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

footer { border-top: 1px solid var(--hair); }
footer > .wrap { padding-top: clamp(40px, 6vw, 64px); padding-bottom: 72px; }
.absence { max-width: var(--measure); margin: 0 0 2rem; color: var(--text-2); }
.absence p { margin: 0 0 0.5em; }
.absence p:last-child { margin-bottom: 0; }
.footlinks { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: var(--t-small); padding: 0; margin: 0; list-style: none; }
.footlinks a { color: var(--text-2); text-decoration: none; }
.footlinks a:hover { color: var(--text); text-decoration: underline; }

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