/* p256check, on the Queast (Noria) design tokens: https://quea.st/style-library */
@font-face { font-family: "Instrument Serif"; src: url("/static/fonts/instrument-serif-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/manrope-semibold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  /* Colours (01 · Colours) */
  --color-canvas: #ffffff;
  --color-surface: #f6f6f3;
  --color-raised: #edf2ed;
  --color-text: #171815;
  --color-muted: #676963;
  --color-subtle: rgba(23, 24, 21, 0.48);
  --color-accent: #40664d;
  --color-border: #dedfd9;
  --color-conditional: #9a603f;
  --color-information: #46657b;
  --color-error: #9c3f3f;
  --noria-ivory: #f5f2eb;
  --noria-sage: #edf2ed;
  --noria-mist: #edf1f5;
  --noria-clay: #f5eeea;
  --noria-limestone: #eeece3;
  /* Type (02 · Typography) */
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: Manrope, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-field: 6px;
  --radius-card: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-canvas); color: var(--color-text); font: 400 16px/1.7 var(--font-sans); }
a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { color: var(--color-text); }
code, .mono { font-family: var(--font-mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type roles */
.type-display, h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(48px, 8vw, 96px); line-height: .98; letter-spacing: -0.045em; margin: 0 0 20px; }
.page-head h1 { font-size: clamp(40px, 6vw, 62px); line-height: 1.08; letter-spacing: -0.035em; }
.type-section-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 16px; }
.type-component-title { font-family: var(--font-serif); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; }
.type-label { font-size: 12px; line-height: 1.45; font-weight: 500; letter-spacing: .055em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 14px; }
.lede { font-size: 18px; line-height: 1.65; color: var(--color-muted); max-width: 640px; margin: 0 0 28px; }
.lede strong { color: var(--color-text); font-weight: 600; }
.sub { color: var(--color-muted); font-size: 13px; line-height: 1.5; }
.subtle { color: var(--color-subtle); font-size: 13px; }

/* Header */
.top { border-bottom: 1px solid var(--color-border); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand { color: var(--color-text); text-decoration: none; font: 700 24px/1 var(--font-sans); letter-spacing: -0.03em; }
.brand-dot { color: var(--color-accent); }
nav { display: flex; gap: 22px; }
nav a { color: var(--color-muted); text-decoration: none; font-size: 13px; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-text); }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 8px; text-decoration-color: var(--color-accent); }

/* Atoms: actions and fields */
.btn, .check-form button {
  display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 14px 23px;
  font: 400 13px/1.5 var(--font-sans); text-decoration: none; cursor: pointer;
  background: var(--color-accent); color: #fff; border: 1px solid var(--color-accent);
}
.btn:hover, .check-form button:hover { background: #33523e; color: #fff; }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-surface); color: var(--color-text); }
.check-form button:disabled { opacity: .7; cursor: progress; }
.link-arrow { font-size: 13px; text-decoration: none; }
.link-arrow::after { content: " →"; }
.check-form { display: flex; gap: 10px; max-width: 620px; align-items: stretch; }
.check-form input {
  flex: 1; min-width: 0; padding: 12px 14px; font: 400 17px/1.6 var(--font-mono);
  border: 1px solid var(--color-muted); border-radius: var(--radius-field); background: var(--color-canvas); color: var(--color-text);
}
.check-form input::placeholder { color: var(--color-subtle); }
.check-form input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.hint { color: var(--color-muted); font-size: 13px; margin: 12px 0 0; }

/* Status atom: marker + text */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status-ready { color: var(--color-accent); }
.status-conditional { color: var(--color-conditional); }
.status-unavailable { color: var(--color-error); }
.status-neutral { color: var(--color-muted); }

/* Hero */
.hero { padding: 72px 0 40px; }
.teaser { margin: 28px 0 0; color: var(--color-muted); font-size: 13px; max-width: 620px; }
.teaser strong { color: var(--color-text); font-weight: 600; }

/* Result */
.result { margin: 8px 0 40px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.result-head h2 { font: 400 clamp(32px, 5vw, 48px)/1.08 var(--font-serif); letter-spacing: -0.03em; margin: 0; word-break: break-all; }
.meta { color: var(--color-muted); font-size: 13px; margin: 6px 0 24px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--color-accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.loading { color: var(--color-muted); font-family: var(--font-mono); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .loading { animation: none; } }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--color-border); border-radius: var(--radius-card); overflow: hidden; }
.tile { padding: 24px; background: var(--color-canvas); border-left: 1px solid var(--color-border); }
.tile:first-child { border-left: 0; }
.tile.wide { grid-column: 1 / -1; border: 1px solid var(--color-border); border-radius: var(--radius-card); }
.tile-label { font-size: 12px; font-weight: 500; letter-spacing: .055em; text-transform: uppercase; color: var(--color-muted); }
.tile-value { font: 400 32px/1.15 var(--font-serif); letter-spacing: -0.02em; margin: 10px 0 8px; }
.tile-note { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--color-muted); }
.tile-yes, .tile-good { background: var(--noria-sage); }
.tile-bad { background: var(--noria-clay); }
.tile-warn { background: var(--noria-ivory); }
.tile-no, .tile-unknown { background: var(--color-surface); }
.tile-bad .tile-value { color: var(--color-error); }
.tile-warn .tile-value { color: var(--color-conditional); }
.tile-yes .tile-value, .tile-good .tile-value { color: var(--color-accent); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 28px 0; padding: 22px 24px; background: var(--color-surface); border-radius: var(--radius-card); font-size: 14px; }
.facts dt { color: var(--color-muted); }
.facts dd { margin: 0; font-family: var(--font-mono); font-size: 13px; word-break: break-word; }
.chain h3 { font-size: 12px; font-weight: 500; letter-spacing: .055em; text-transform: uppercase; color: var(--color-muted); margin: 28px 0 10px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-card); }
table.checks { width: 100%; border-collapse: collapse; font-size: 14px; }
.checks th, .checks td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.checks th { background: var(--color-surface); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .055em; color: var(--color-muted); white-space: nowrap; }
.checks tbody tr:last-child td, .checks tbody tr:last-child th { border-bottom: 0; }
.checks .when, .checks .role { white-space: nowrap; color: var(--color-muted); }
.checks .site a { font-family: var(--font-mono); font-size: 13px; text-decoration: none; color: var(--color-text); }
.checks .site a:hover { color: var(--color-accent); text-decoration: underline; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font: 400 12px/1.6 var(--font-mono); white-space: nowrap; border: 1px solid var(--color-border); color: var(--color-muted); background: var(--color-canvas); }
.tag-bad { color: var(--color-error); border-color: color-mix(in srgb, var(--color-error) 35%, transparent); background: var(--noria-clay); }
.tag-yes { color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 35%, transparent); background: var(--noria-sage); }

/* Bands and sections */
.band { padding: 72px 0; }
.band-ivory { background: var(--noria-ivory); }
.band-sage { background: var(--noria-sage); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--color-border); margin-top: 32px; }
.card { padding: 28px 28px 8px 0; }
.card + .card { padding-left: 28px; border-left: 1px solid var(--color-border); }
.card p { color: var(--color-muted); margin: 0 0 14px; font-size: 15px; }
.card .num { font: 400 42px/1.1 var(--font-serif); color: var(--color-accent); margin: 0 0 6px; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: step; max-width: 760px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; padding: 18px 0; border-top: 1px solid var(--color-border); }
.steps li::before { content: counter(step, decimal-leading-zero); font-size: 12px; font-weight: 500; letter-spacing: .055em; color: var(--color-muted); padding-top: 4px; }
.steps strong { font-weight: 600; display: block; }
.steps span { color: var(--color-muted); font-size: 15px; }

/* Disclosure (FAQ) */
.faq { max-width: 760px; border-top: 1px solid var(--color-border); margin-top: 24px; }
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--color-muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 20px; color: var(--color-muted); }
.sources { font-size: 13px; color: var(--color-muted); margin-top: 28px; }

/* Queast promotion: shown only after a check */
.queast { margin: 40px 0 0; padding: 32px; border-radius: var(--radius-card); background: var(--noria-sage); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.queast h2 { font: 400 clamp(28px, 4vw, 38px)/1.1 var(--font-serif); letter-spacing: -0.025em; margin: 0 0 10px; }
.queast p { margin: 0; color: var(--color-muted); max-width: 560px; }
.queast .type-label { margin-bottom: 10px; }

/* Checks, stats and site pages */
.page-head { padding: 56px 0 16px; }
.table-tools { display: flex; gap: 16px; align-items: center; margin: 8px 0 14px; flex-wrap: wrap; }
.table-tools input[type="search"] { padding: 10px 12px; border: 1px solid var(--color-muted); border-radius: var(--radius-field); background: var(--color-canvas); color: var(--color-text); font: 14px var(--font-mono); min-width: 260px; }
.toggle { color: var(--color-muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.toggle input { accent-color: var(--color-accent); }
.empty { color: var(--color-muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--color-border); border-radius: var(--radius-card); overflow: hidden; margin: 24px 0 12px; }
.stat { padding: 24px; border-left: 1px solid var(--color-border); }
.stat:first-child { border-left: 0; }
.stat-label { font-size: 12px; font-weight: 500; letter-spacing: .055em; text-transform: uppercase; color: var(--color-muted); min-height: 2.9em; }
.stat-value { font: 400 56px/1.05 var(--font-serif); letter-spacing: -0.03em; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.stat-note { margin: 10px 0 0; font-size: 13px; color: var(--color-muted); }
svg.meter, svg.bar-track { display: block; width: 100%; height: 6px; }
svg .track { fill: var(--color-border); }
svg .fill { fill: var(--color-accent); }
svg.meter-bad .fill { fill: var(--color-error); }
.section-title { font: 400 28px/1.2 var(--font-serif); letter-spacing: -0.01em; margin: 44px 0 6px; }
.checks.numbers td { font-variant-numeric: tabular-nums; }
.checks.numbers tbody th { text-align: left; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--color-text); background: none; white-space: normal; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.bars { list-style: none; padding: 0; margin: 14px 0 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--color-border); }
.bar-name { font-family: var(--font-mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 64px; }
.crumbs { margin-top: 28px; font-size: 13px; color: var(--color-muted); }
.crumbs + .page-head { padding-top: 12px; }

.foot { border-top: 1px solid var(--color-border); margin-top: 0; padding-top: 28px; padding-bottom: 48px; color: var(--color-muted); font-size: 13px; }
.foot p { margin: 0 0 8px; max-width: 760px; }

@media (max-width: 760px) {
  .tiles, .stats, .cards, .two-col { grid-template-columns: 1fr; }
  .tile, .stat { border-left: 0; border-top: 1px solid var(--color-border); }
  .tile:first-child, .stat:first-child { border-top: 0; }
  .card, .card + .card { padding: 24px 0 8px; border-left: 0; border-top: 1px solid var(--color-border); }
  .card:first-child { border-top: 0; }
  .stat-label { min-height: 0; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .check-form { flex-direction: column; }
  .check-form button { justify-content: center; }
  .queast { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
  nav { gap: 12px; }
  nav a { white-space: nowrap; font-size: 12px; }
  .brand { font-size: 18px; }
  .top-inner { gap: 12px; }
  nav { gap: 10px; }
  .top-inner { height: 60px; }
}

/* Full-bleed bands inside the centred main column */
.band-ivory, .band-sage { background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); }
.band-ivory { --band: var(--noria-ivory); }
.band-sage { --band: var(--noria-sage); }
.band .cards { border-top-color: color-mix(in srgb, var(--color-text) 12%, transparent); }

/* Legal notice */
.legal { max-width: 760px; padding-bottom: 56px; }
.legal h2 { margin-top: 36px; }
.legal p, .legal li { color: var(--color-muted); }
.legal ul { padding-left: 20px; }

/* Line breaking: balanced headings, no orphans, and keep "P-256" and dates whole */
h1, h2, h3, .type-section-title, .type-component-title { text-wrap: balance; }
p, li, dd, summary { text-wrap: pretty; }
.nb { white-space: nowrap; }
.brand-tld { color: var(--color-accent); }
