/* Candela — site design tokens + base components.
   Derived from docs/brand/BRAND.md (decided 2026-07-18: the Kept Candle v2,
   "papers by candlelight" — Night chrome, Paper content, one glow, instrument
   details, stillness). docs/brand/style/tokens.css was the seed; this file is
   the site's own copy — the repo is authoritative, the brand folder proposes.

   Palette discipline (BRAND.md §3): Flame belongs to participants, 555 green
   belongs to measurement. Platform chrome stays Night / Paper / Ash. */

:root {
  /* palette: on Night */
  --night: #101623;
  --night-raised: #161d2e;
  --flame: #E8A33D;
  --flame-heart: #F4E3BC;
  --measure: #A8D948;
  --paper: #F4EFE6;
  --ash: #5C6472;
  --ash-light: #8A93A3;

  /* palette: ink variants for Paper surfaces (AA contrast) */
  --ink: #1C2433;
  --ink-soft: #4A5266;
  --measure-ink: #4A6B14;
  --flame-ink: #8A5A10;
  --dispute-ink: #8C3B2E;
  --paper-edge: #E3DCCD;
  --paper-shade: #ECE5D6;

  /* type */
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* rhythm */
  --hairline: 1px solid rgba(138, 147, 163, 0.25);
  --hairline-paper: 1px solid rgba(28, 36, 51, 0.15);
  --radius: 6px;
  --pool-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

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

body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

/* ------------------------------------------------------------------
   Chrome: the dark room the papers sit in.
   ------------------------------------------------------------------ */

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px; border-bottom: var(--hairline);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 19px; letter-spacing: 1px;
  color: var(--paper); text-decoration: none;
}
.site-header nav a {
  color: var(--ash-light); text-decoration: none; font-size: 14px;
  letter-spacing: 0.5px; margin-left: 32px;
}
.site-header nav a:hover { color: var(--paper); }
.site-header nav a[aria-current="page"] { color: var(--paper); }

.site-footer {
  border-top: var(--hairline); padding: 26px 48px;
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  color: var(--ash); font-size: 13px;
}
.site-footer a { color: var(--ash-light); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.site-footer .m { font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------------------------
   The instrument showing through: calibration ticks.
   ------------------------------------------------------------------ */

.ticks {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 26px; padding: 10px 0 56px;
}
.ticks span { width: 1.5px; background: var(--measure); opacity: 0.55; height: 9px; }
.ticks span:nth-child(4n+1) { height: 16px; opacity: 0.9; }

/* Section divider on Paper: a labeled row of ticks, the scale carrying on. */
.sec-ticks { display: flex; align-items: center; gap: 14px; margin: 34px 0 20px; }
.sec-ticks span:not(.label) {
  width: 1.5px; background: var(--measure-ink); opacity: 0.4; height: 7px; flex: none;
}
.sec-ticks span:not(.label):nth-of-type(4n+2) { height: 12px; opacity: 0.7; }
.sec-ticks::after {
  content: ""; flex: 1; border-top: var(--hairline-paper); margin-left: 12px;
}
.sec-ticks .label {
  font-size: 11.5px; letter-spacing: 2.5px; color: var(--measure-ink);
  font-weight: 600; text-transform: uppercase; white-space: nowrap; margin-right: 10px;
}

/* ------------------------------------------------------------------
   Paper: the content surface, lying in the pool of light.
   ------------------------------------------------------------------ */

.paper {
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--pool-shadow);
}

.page { max-width: 1120px; margin: 44px auto 90px; padding: 0 32px; }
.page-narrow { max-width: 780px; }

.sheet { padding: 44px 52px 40px; }

.kicker {
  font-size: 11.5px; letter-spacing: 2.5px; color: var(--ink-soft);
  text-transform: uppercase; font-weight: 600;
}

h1.paper-title {
  font-family: var(--serif); font-weight: 600; font-size: 29px;
  line-height: 1.3; margin: 12px 0 14px;
}

.meta { font-size: 13.5px; color: var(--ink-soft); }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------------
   Grades: the binding scale and finding states, on Paper (ink variants).
   proven/verified anchor on 555; Flame marks participant-side states;
   the platform itself never takes a color.
   ------------------------------------------------------------------ */

.grade {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  padding: 3px 10px; border-radius: 20px; text-transform: uppercase;
  white-space: nowrap; border: 1px solid var(--ink-soft); color: var(--ink-soft);
}
.g-proven, .g-verified { color: var(--measure-ink); border-color: var(--measure-ink); }
.g-supported { color: var(--flame-ink); border-color: var(--flame-ink); }
.g-asserted, .g-neutral, .g-overturned, .g-withdrawn {
  color: var(--ink-soft); border-color: var(--ink-soft);
}
.g-disputed, .g-failed, .g-revoked, .g-removed {
  color: var(--dispute-ink); border-color: var(--dispute-ink);
}

/* ------------------------------------------------------------------
   Buttons: platform chrome — Night/Paper/Ash only.
   ------------------------------------------------------------------ */

.btn {
  display: inline-block; font-size: 15px; padding: 11px 26px;
  border-radius: var(--radius); text-decoration: none; letter-spacing: 0.3px;
}
.btn-paper { background: var(--paper); color: var(--ink); font-weight: 500; }
.btn-ghost { color: var(--paper); border: 1px solid var(--ash); }
.btn-ghost:hover { border-color: var(--paper); }

/* ------------------------------------------------------------------
   Landing: the candle in the dark, then papers in the pool of light.
   ------------------------------------------------------------------ */

.hero { text-align: center; padding: 88px 24px 72px; }
.hero .lockup { width: 330px; margin: 0 auto; }
.hero .lockup img { width: 100%; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.45;
  max-width: 640px; margin: 44px auto 0;
}
.hero p.sub {
  color: var(--ash-light); font-size: 16.5px; line-height: 1.6;
  max-width: 560px; margin: 18px auto 0;
}
.cta { margin-top: 40px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.principles {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  padding: 0 48px 96px;
}
.card {
  background: var(--paper); color: var(--ink); width: 320px;
  padding: 30px 28px 26px; border-radius: var(--radius); box-shadow: var(--pool-shadow);
}
.card .kicker { color: var(--measure-ink); }
.card h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 12px 0 10px; }
.card p { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }

/* ------------------------------------------------------------------
   The record: a ledger on the dark desk. Newest first; no ranking.
   ------------------------------------------------------------------ */

.ledger { overflow: hidden; }
.ledger .ledger-head {
  padding: 22px 32px; border-bottom: var(--hairline-paper);
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.ledger .ledger-head .t { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.ledger .ledger-head .h { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

.ledger-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  padding: 15px 32px; border-bottom: var(--hairline-paper);
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row .what { min-width: 0; }
.ledger-row .what a {
  color: var(--ink); font-family: var(--serif); font-size: 16.5px;
  text-decoration: none; border-bottom: 1px solid transparent;
}
.ledger-row .what a:hover { border-bottom-color: var(--ink-soft); }
.ledger-row .cite {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  white-space: nowrap; text-align: right;
}
.ledger-row .grades { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.ledger-empty { padding: 28px 32px; color: var(--ink-soft); font-size: 14.5px; }

/* Source filter: quiet instrument labels. */
.filters { font-size: 13px; color: var(--ash-light); margin: 0 0 22px; letter-spacing: 0.5px; }
.filters a { color: var(--ash-light); text-decoration: none; margin-right: 18px; }
.filters a:hover { color: var(--paper); }
.filters a.active { color: var(--paper); border-bottom: 1px solid var(--measure); padding-bottom: 2px; }

/* ------------------------------------------------------------------
   Artifact: one paper in the light; the platform's facts in the dark.
   ------------------------------------------------------------------ */

.layout { display: flex; gap: 32px; align-items: flex-start; }
.layout .sheet { flex: 1; min-width: 0; }

.byline { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 4px; }
.byline .grade { font-size: 10.5px; letter-spacing: 1px; padding: 2px 8px; vertical-align: 1px; }
.doi { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); margin-bottom: 26px; }
.doi a { color: var(--ink-soft); }
.abstract {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.7;
  border-top: var(--hairline-paper); padding-top: 22px;
}

.status-banner { margin-bottom: 22px; }
.status-banner .why { font-size: 13.5px; color: var(--ink-soft); margin-left: 10px; }

.files { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.files code {
  font-family: var(--mono); font-size: 12px; word-break: break-all;
}

.sheet-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }

.finding {
  padding: 14px 16px; background: var(--paper-shade); border-radius: var(--radius);
  margin-bottom: 12px; font-size: 14.5px; line-height: 1.6;
}
.finding .property { font-weight: 600; margin-top: 8px; }
.finding .detail { color: var(--ink); }
.finding .family {
  font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 6px;
}
.finding .ev {
  display: block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-soft); margin-top: 7px; overflow-x: auto;
}

/* Sidebar: the platform's own voice stays in the dark chrome. */
aside { width: 300px; flex: none; }
.panel {
  background: var(--night-raised); border: var(--hairline);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.panel h4 {
  font-size: 11.5px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--ash-light); font-weight: 600; margin-bottom: 14px;
}
.panel .kv {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 6px 0; color: var(--paper);
}
.panel .kv .k { color: var(--ash-light); flex: none; }
.panel .kv .v { text-align: right; word-break: break-all; }
.panel .kv .v.mono { font-family: var(--mono); font-size: 12px; }
.panel .kv .v a { color: var(--paper); }

/* ------------------------------------------------------------------
   Forms: on Paper, quiet and exact.
   ------------------------------------------------------------------ */

.form-card { max-width: 560px; padding: 40px 44px 36px; }
.form-card h1 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 10px 0 12px; }
.form-card .lede { font-size: 14.5px; color: var(--ink-soft); line-height: 1.65; }
.form-card form { margin-top: 26px; }
.form-card label {
  display: block; font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase;
  font-weight: 600; color: var(--ink-soft); margin-top: 22px;
}
.form-card label .opt { font-weight: 400; text-transform: none; letter-spacing: 0.3px; }
.form-card input, .form-card textarea {
  display: block; width: 100%; margin-top: 8px; padding: 10px 12px;
  font: 15px var(--sans); color: var(--ink);
  border: 1px solid var(--paper-edge); border-radius: var(--radius); background: #fff;
}
.form-card textarea { min-height: 9rem; line-height: 1.6; font-family: var(--serif); }
.form-card input:focus, .form-card textarea:focus {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
.form-card input[type=file] { border: 0; padding: 6px 0; background: transparent; }
.form-card .hint {
  font-size: 12.5px; color: var(--ink-soft); margin-top: 6px;
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.form-card button {
  margin-top: 28px; padding: 11px 26px; font: 500 15px var(--sans);
  letter-spacing: 0.3px; background: var(--ink); color: var(--paper);
  border: 0; border-radius: var(--radius); cursor: pointer;
}
.form-card .error { color: var(--dispute-ink); font-size: 14px; margin-top: 18px; }
.form-card a { color: var(--ink); }

/* ------------------------------------------------------------------
   Page-level titles on Night, and small per-template pieces.
   ------------------------------------------------------------------ */

.page-title {
  font-family: var(--serif); font-weight: 600; font-size: 26px;
  margin-bottom: 8px; color: var(--paper);
}
.page-lede { color: var(--ash-light); font-size: 14.5px; margin-bottom: 22px; }

.sheet a { color: var(--ink); }
.ledger .ledger-head .h a { color: var(--ink-soft); text-decoration: none; }
.ledger .ledger-head .h a:hover { color: var(--ink); }

.badge-row { margin: 14px 0 4px; display: flex; gap: 8px; flex-wrap: wrap; }

.id-entry { padding: 12px 0; border-bottom: var(--hairline-paper); }
.id-entry:last-of-type { border-bottom: none; }
.id-entry a {
  font-family: var(--serif); font-size: 16.5px; text-decoration: none;
  border-bottom: 1px solid transparent;
}
.id-entry a:hover { border-bottom-color: var(--ink-soft); }
.id-entry .grade { margin-top: 6px; }

.permanent { margin-top: 26px; }

.form-card { margin: 0 auto; }
.form-card code { font-family: var(--mono); font-size: 13px; }
.signed-in { margin-top: 10px; }
.signed-in a { color: var(--ink); }

/* ------------------------------------------------------------------
   Stillness and small rooms.
   ------------------------------------------------------------------ */

@media (max-width: 920px) {
  .site-header { padding: 16px 24px; }
  .site-header nav a { margin-left: 20px; }
  .site-footer { padding: 22px 24px; }
  .page { padding: 0 20px; margin: 28px auto 64px; }
  .sheet { padding: 30px 26px 28px; }
  .layout { flex-direction: column; }
  aside { width: 100%; }
  .principles { padding: 0 20px 64px; }
  .hero { padding: 56px 20px 56px; }
  .ledger-row { flex-direction: column; gap: 6px; }
  .ledger-row .cite { text-align: left; }
}
