@import url("tokens.css");

/* wick.css — the page.

   THE SURFACE DIVISION, written here and obeyed everywhere. Every colour comes
   from css/tokens.css, which tools/palette.mjs SOLVED and proved; a chromatic
   literal typed into this file is refused by tools/validate.mjs, because a brand
   hue typed into CSS is the thing that drifts.

     .ground     the photograph. Nothing sits directly on it: every word on this
                 site sits on a surface of its own. A sentence standing on a
                 picture is the recurring failure in this family of sites.
     .sheet      the THIN pane (--surface, 54% glass). Display type and graphic
                 panels only — 3:1 — because 54% glass over the dark end of this
                 photograph cannot carry body prose.
     .card       the BODY card (--surface-2, 66%). Every paragraph, label and
                 number — 4.5:1.
     .slab       the DENSE slab (--surface-3, 82%). Figures and tables.
     .band       the one dark band. Type never sits on the band itself; it sits
                 on a .band .card, which is proved against it.

   The glass is thin on purpose. A big pane of 82% white over a blurred
   photograph IS a fill whatever the CSS says, and this family has shipped
   near-white-on-near-white nineteen times. tools/audit-live.mjs measures the
   painted pixels of every built page and refuses a frame flatter than the
   reference's flattest. */

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--ground-fill);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--ember); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--ember-2); }
code, .mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: .92em; }
h1, h2, h3, h4 { font-family: Fraunces, Georgia, "Times New Roman", serif; font-weight: 600; line-height: 1.12; letter-spacing: -0.012em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 500; letter-spacing: -0.028em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; font-family: inherit; font-weight: 650; letter-spacing: 0; }
p { margin: 0 0 1em; }
p:last-child, ul:last-child { margin-bottom: 0; }
small, .fine { font-size: .845rem; line-height: 1.55; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--ember); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- ground */
.ground {
  position: fixed; inset: 0; z-index: -1;
  background-image: url(../img/ground.jpg);
  background-size: cover;
  background-position: center 38%;
  background-color: var(--ground-fill);
}
/* The ground is a photograph and photographs have a top and a bottom: a very
   faint warm veil at the very top keeps the nav pill's own glass from sitting
   on the brightest strip of the picture. It is 6% — a veil, not a scrim. */
.ground::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(var(--ink-rgb), .12), rgba(var(--ink-rgb), 0) 22%, rgba(var(--ink-rgb), 0) 78%, rgba(var(--ink-rgb), .10));
}

/* ---------------------------------------------------------------- layout */
.wrap { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 48px)); margin-inline: auto; }
section { padding: clamp(48px, 7vw, 96px) 0; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .wrap, .narrow { width: calc(100% - 32px); }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 16.5px; }
}

/* ---------------------------------------------------------------- surfaces */
.sheet, .card, .slab {
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: clamp(20px, 2.6vw, 30px);
}
.sheet { background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.card  { background: var(--surface-2); backdrop-filter: var(--blur-lite); -webkit-backdrop-filter: var(--blur-lite); }
.slab  { background: var(--surface-3); }
.card p, .slab p { color: var(--ink-2); }
.card h3, .slab h3, .card h4 { color: var(--ink); }
.tight { padding: 16px 18px; border-radius: 14px; }
.flush { padding: 0; overflow: hidden; }

/* the one dark band */
.band { background: var(--ink); color: var(--bright); border-radius: 26px; padding: clamp(28px, 4vw, 52px); }
.band h2, .band h3 { color: var(--bright); }
.band > p { color: var(--glow); }
.band .card {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .14);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none;
}
.band .card h3, .band .card h4, .band .card b { color: var(--bright); }
.band .card p, .band .card .fine { color: var(--glow); }
.band .card .num, .band .card strong { color: var(--grain); }

/* ---------------------------------------------------------------- nav */
.head { position: sticky; top: 14px; z-index: 40; margin-top: 14px; }
.head .bar {
  display: flex; align-items: center; gap: 22px;
  background: var(--head); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 9px 12px 9px 18px;
}
.head a { color: var(--ink); text-decoration: none; font-size: .95rem; }
/* The nav's button is a BUTTON: white on ember, not the nav's own ink. Without
   this line the rule above wins and the live audit measured it at 2.08:1 — the
   kind of failure a stylesheet never looks like it has. */
.head a.btn, .head button.btn { color: #fff; }
.head nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.head nav a:hover { color: var(--ember); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: Fraunces, Georgia, serif; font-size: 1.28rem; font-weight: 600; letter-spacing: -0.01em; }
.brand svg { display: block; }
@media (max-width: 860px) { .head nav a.opt { display: none; } }

/* ---------------------------------------------------------------- bits */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .98rem; cursor: pointer;
  background: var(--ember); color: #fff; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: 0 2px 10px rgba(var(--ember-rgb), .28);
}
.btn:hover { background: var(--ember-2); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--surface-3); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--grain); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: .88rem; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  font-size: .86rem; color: var(--ink-2); text-decoration: none;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip.on { background: var(--sprout); color: var(--ink); border-color: transparent; }
.chip.warm { background: var(--glow); color: var(--ink); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); display: inline-block; }
.dot.off { background: var(--ink-3); }
.dot.bad { background: var(--down); }
.kbd { background: var(--grain); color: var(--grain-ink); padding: 1px 6px; border-radius: 5px; font-size: .86em; }
.eyebrow { font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; margin-bottom: 12px; }
.lede { font-size: clamp(1.06rem, 1.7vw, 1.2rem); color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { position: relative; padding-left: 22px; margin-bottom: 9px; color: var(--ink-2); }
ul.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--ember); }
ul.ticks li:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 650; color: var(--ink-2); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
td b { color: var(--ink); }
/* Zebra rows are a readability decision that also stops a forty-row table
   being one uniform pane of glass — a table IS a pane, and a big one measured
   32% flat on a sibling. */
tbody tr:nth-child(even) td { background: var(--grain-wash); }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(255, 255, 255, .72); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px;
}
input:focus, select:focus { border-color: var(--ember); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  font: inherit; font-size: .9rem; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--ember); border-color: transparent; color: #fff; font-weight: 600; }
.note { border-left: 3px solid var(--ember); padding-left: 14px; color: var(--ink-2); }
.bad { color: var(--down); }
.good { color: var(--up); }

/* ---------------------------------------------------------------- footer */
footer { padding: 40px 0 56px; }
footer .card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
footer .links { display: flex; gap: 9px; flex-wrap: wrap; margin-left: auto; }

/* ---------------------------------------------------------------- app */
.wickrow { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.wickrow + .wickrow { margin-top: 12px; }
.meter { height: 7px; border-radius: 999px; background: var(--grain-wash); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--ember); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bright); padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 60; font-size: .92rem; max-width: min(90vw, 620px);
}
.toast a { color: var(--grain); }

/* A long table shows a dozen rows and keeps the rest behind a button: forty rows
   of pale glass is one uniform pane, and a sibling's measured 32% flat where the
   reference's worst frame was 15%. */
tbody.more { display: none; }
tbody.more.all { display: table-row-group; }
