/* ============================================================================
   recall — the threshold
   ----------------------------------------------------------------------------
   One stylesheet, no framework, no build step, no runtime network request.

   The whole product is one decision boundary: is this prompt close enough to
   something we already answered? So the page has ONE accent, and it means
   exactly one thing — SERVED FROM MEMORY, which costs nothing. Everything that
   went upstream stays neutral ink, because that is the half you pay for. A
   second colour appears only on the honest caveats, and never as decoration.

   Light-first, and set in a serif, because the subject is remembering rather
   than throughput. Both are deliberate departures from the sibling product
   pages, which are dark instruments set in a monospace.
   ============================================================================ */

@font-face {
  font-family: "Shippori Mincho";
  src: url("fonts/shippori-mincho-latin-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ────────────────────────────────────────────────────────────────
   Complete light palette on bare :root, because the viewer's default setting
   stamps nothing. The dark block is guarded against an explicit light choice,
   and [data-theme] wins both ways. No component declares a colour outside
   these three blocks. */

:root {
  --paper: #f8f8f7;
  --paper-2: #efefec;
  --paper-3: #e5e5e1;
  --ink: #17181a;
  --ink-2: #494c52;
  --ink-3: #5e626a;
  --rule: #dbdbd7;
  --rule-lit: #bbbbb5;

  /* The one accent. It means "served from memory" and nothing else. */
  --hit: #7c2f5c;
  --hit-wash: #f3e7ee;

  /* Only on caveats and the false-hit risk. Never decorative. */
  --warn: #9c3527;
  --warn-wash: #f7e6e3;

  --serif: "Shippori Mincho", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --t-xs: 0.6875rem;
  --t-sm: 0.8125rem;
  --t-md: 1rem;
  --t-lg: 1.1875rem;
  --t-h3: 1.25rem;
  --t-h2: clamp(1.75rem, 1.1rem + 2.6vw, 2.9rem);
  --t-hero: clamp(2.1rem, 1rem + 4.6vw, 4.4rem);

  --gutter: clamp(1.15rem, 4vw, 2.75rem);
  --max: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141416;
    --paper-2: #1c1c1f;
    --paper-3: #24242a;
    --ink: #eceae8;
    --ink-2: #a8a6a4;
    --ink-3: #918f8e;
    --rule: #2c2c31;
    --rule-lit: #3f3f46;

    /* Deep plum has nowhere near enough contrast on a dark ground, so the
       token lifts rather than any component changing. */
    --hit: #dd8fb8;
    --hit-wash: #2b1a24;
    --warn: #e79184;
    --warn-wash: #2c1a17;
  }
}

:root[data-theme="dark"] {
  --paper: #141416;
  --paper-2: #1c1c1f;
  --paper-3: #24242a;
  --ink: #eceae8;
  --ink-2: #a8a6a4;
  --ink-3: #918f8e;
  --rule: #2c2c31;
  --rule-lit: #3f3f46;
  --hit: #dd8fb8;
  --hit-wash: #2b1a24;
  --warn: #e79184;
  --warn-wash: #2c1a17;
}

/* ── Base ──────────────────────────────────────────────────────────────── */

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a:hover {
  color: var(--ink);
}

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

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

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

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  z-index: 100;
  font-family: var(--mono);
  font-size: var(--t-xs);
}

.skip:focus {
  left: 0;
}

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

/* ── Masthead ──────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

@supports not (backdrop-filter: blur(1px)) {
  .top {
    background: var(--paper);
  }
}

.top__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover {
  color: var(--ink);
}

.logo svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.2vw, 1.6rem);
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--hit);
}

.nav__cta {
  color: var(--hit) !important;
  font-weight: 700;
}

@media (max-width: 46rem) {
  .nav__opt {
    display: none;
  }
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.band {
  border-top: 1px solid var(--rule);
}

.band--fill {
  background: var(--paper-2);
}

.band__in {
  padding-block: clamp(2.75rem, 6.5vw, 5rem);
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hit);
}

h2 {
  margin-top: 0.9rem;
  font-family: var(--serif);
  font-size: var(--t-h2);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
  max-width: 21ch;
}

h3 {
  font-size: var(--t-h3);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.lead {
  margin-top: 1.1rem;
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
}

.prose {
  margin-top: 1.3rem;
  max-width: 66ch;
  color: var(--ink-2);
}

.prose p + p {
  margin-top: 0.9em;
}

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

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.25rem) clamp(1.25rem, 2.5vw, 2rem);
}

h1 {
  margin-top: 1.2rem;
  font-family: var(--serif);
  font-size: var(--t-hero);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 17ch;
  text-wrap: balance;
}

h1 .h {
  color: var(--hit);
}

.hero__lead {
  margin-top: 1.5rem;
  font-size: var(--t-lg);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

.acts {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--hit);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.btn--solid {
  background: var(--hit);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn--ghost {
  color: var(--hit);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--hit-wash);
  color: var(--hit);
}

/* ── The two paths: what a hit costs, and what a miss costs ────────────── */

.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.p {
  background: var(--paper);
  padding: 1.2rem 1.35rem 1.4rem;
  min-width: 0;
}

.band--fill .p {
  background: var(--paper-2);
}

.p--hit {
  background: var(--hit-wash);
}

.band--fill .p--hit {
  background: var(--hit-wash);
}

.p__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.p--hit .p__k {
  color: var(--hit);
}

.p__n {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.p--hit .p__n {
  color: var(--hit);
}

.p__n small {
  font-size: 0.45em;
  color: var(--ink-2);
  letter-spacing: 0;
}

.p__d {
  margin-top: 0.65rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.5;
}

/* ── The latency split: one bar, two terms ─────────────────────────────── */

.split {
  margin-top: 2rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.3rem 1.4rem 1.5rem;
}

.band--fill .split {
  background: var(--paper);
}

.split__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 1rem;
}

.split__bar {
  display: flex;
  height: 2.4rem;
  border: 1px solid var(--rule-lit);
  overflow: hidden;
}

.split__seg {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.split__seg--embed {
  background: var(--hit);
  color: var(--paper);
  flex: 0 0 98.6%;
}

.split__seg--index {
  background: var(--paper-3);
  color: var(--ink);
  flex: 1 1 auto;
}

.split__legend {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.split__legend b {
  color: var(--ink);
}

/* ── Tables ────────────────────────────────────────────────────────────── */

.tw {
  overflow-x: auto;
  border: 1px solid var(--rule);
  margin-top: 1.75rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

thead th {
  text-align: left;
  font-weight: 700;
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule-lit);
  background: var(--paper-2);
}

.band--fill thead th {
  background: var(--paper-3);
}

tbody td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td:first-child {
  color: var(--ink);
}

td.num {
  text-align: right;
}

td.good {
  color: var(--hit);
  font-weight: 700;
}

td.bad {
  color: var(--warn);
  font-weight: 700;
  /* Shaded as well as coloured: plum and rust are adjacent hues, so on the
     one table that has to separate passing rows from failing ones the colour
     alone is not a distinction a reader makes at a glance — and it is no
     distinction at all without colour vision. */
  background: var(--warn-wash);
}

/* ── Terminal ──────────────────────────────────────────────────────────── */

.term {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: var(--t-sm);
  line-height: 1.7;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--ink);
  tab-size: 2;
}

.band--fill .term {
  background: var(--paper);
}

.term .c {
  color: var(--ink-3);
}

.term .p {
  color: var(--hit);
  font-weight: 700;
  user-select: none;
  background: none;
  padding: 0;
}

.term .k {
  color: var(--hit);
  font-weight: 700;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2rem;
}

.card {
  background: var(--paper);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.band--fill .card {
  background: var(--paper-2);
}

.card__k {
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hit);
}

.card p {
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.55;
}

.card ul {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.card li {
  position: relative;
  padding-left: 0.95rem;
  line-height: 1.45;
}

.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.4rem;
  height: 1px;
  background: var(--hit);
}

/* ── Caveat ────────────────────────────────────────────────────────────── */

.caveat {
  margin-top: 1.6rem;
  border-left: 2px solid var(--warn);
  background: var(--warn-wash);
  padding: 0.95rem 1.15rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 68ch;
}

.caveat b {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
  margin-bottom: 0.35rem;
}

.caveat i {
  font-style: normal;
  color: var(--ink);
  font-weight: 600;
}

.note {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 76ch;
}

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

.foot {
  border-top: 1px solid var(--rule-lit);
  background: var(--paper-2);
}

.foot__in {
  padding-block: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: 1.7;
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
}

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

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}
