/* baromoon — the moon-ledger.
   Design contract: DESIGN.md. Paper by day, water-dark by night, one brass moon.
   Ornament budget: one triskele, manuscript double rules, lunar glyphs. */

:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #10140d;          /* loam — page */
  --bg-2: #141910;        /* sunken field */
  --panel: #192015;       /* moss shadow — cards */
  --panel-2: #202817;     /* raised moss */
  --line: #333c28;        /* bracken */
  --line-2: #252d1b;      /* under-rule */

  /* ink */
  --ink: #ece7d5;         /* bone */
  --dim: #9d9a82;         /* dry rush */
  --faint: #6d6e59;       /* faded pencil */

  /* accents */
  --gold: #d3aa5f;        /* moon-brass — the one accent */
  --gold-bright: #e7c47e;
  --gold-dim: #8a744a;
  --lichen: #93b36b;      /* good */
  --water: #8fa7b8;       /* twilight water — sky data */
  --ember: #c98a52;
  --error: #c0604a;

  /* type */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  /* measure & rhythm */
  --wrap: 74rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header: rgba(16, 20, 13, .9);
  --hover: rgba(255, 255, 255, .025);
  --shadow: 0 30px 60px -40px rgba(0, 0, 0, .8);
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.66 var(--font-body);
  letter-spacing: .001em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--gold) 24%, transparent); color: var(--ink); }

img, svg { max-width: 100%; }
a { color: var(--gold); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-bright); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 .55em;
  text-wrap: balance;
}
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.6rem 0; }
code {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 3px;
  padding: .08em .38em; font-family: var(--font-mono); font-size: .84em; color: var(--dim);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

/* ── chrome ─────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
nav {
  max-width: var(--wrap); margin: 0 auto;
  padding: .55rem var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .3rem 1.5rem;
  position: relative;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  letter-spacing: .005em; color: var(--ink); margin-right: .4rem;
}
.brand:hover { color: var(--ink); }
.brand .triskele { color: var(--gold); width: .72em; }
.nav-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.5rem;
}
.nav-links a {
  position: relative; color: var(--dim); padding: .5rem 0;
  font-size: .7rem; font-weight: 500; letter-spacing: .15em; text-transform: uppercase;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: .2rem;
  height: 1px; background: var(--gold); transition: right .25s ease;
}
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.on::after { right: 0; }
.nav-links a.on::after { background: var(--gold-dim); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 2px;
  color: var(--dim); padding: .42rem .5rem; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.nav-toggle:hover { color: var(--gold); border-color: var(--gold-dim); }
.nav-toggle svg { display: block; }

/* profile vault menu */
.menu { margin-left: .35rem; position: relative; }
.menu summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--dim); font-size: .68rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 2px; padding: .42rem .7rem;
  transition: color .2s, border-color .2s;
}
.menu summary::-webkit-details-marker { display: none; }
.theme-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 2px;
  color: var(--dim); padding: .42rem .5rem; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-dim); }
.theme-toggle svg { display: block; }
.theme-toggle .i-sun { display: none; }
html[data-theme="crisp-dark"] .theme-toggle .i-sun { display: block; }
html[data-theme="crisp-dark"] .theme-toggle .i-moon { display: none; }
.menu summary:hover { color: var(--gold); border-color: var(--gold-dim); }
.menu[open] summary { color: var(--gold); border-color: var(--gold-dim); }
.menu .chev { transition: transform .2s ease; opacity: .7; }
.menu[open] .chev { transform: rotate(180deg); }
.menu-body {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 16rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: .4rem; z-index: 50; box-shadow: var(--shadow);
}
/* Narrow screens: the summary can wrap to the left edge, so a right-anchored
   dropdown opened off-screen. Anchor it to the header instead, full width. */
@media (max-width: 46rem) {
  nav { gap: .3rem .5rem; padding: .5rem var(--gutter); }
  .brand { font-size: 1.45rem; margin-right: .1rem; }
  .menu summary { letter-spacing: .1em; padding: .42rem .55rem; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .theme-toggle { margin-left: .25rem; }
  .nav-links { display: none; }
  nav.open .nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: .35rem var(--gutter) .8rem; gap: 0;
    max-height: calc(100vh - 4rem); overflow-y: auto;
    box-shadow: var(--shadow); z-index: 60;
  }
  nav.open .nav-links a { padding: .68rem 0; border-bottom: 1px solid var(--line-2); }
  nav.open .nav-links a:last-child { border-bottom: 0; }
  nav.open .nav-links a::after { display: none; }
  .menu { position: static; }
  .menu-body {
    left: 0; right: 0; top: 100%; min-width: 0; width: auto;
    max-height: 70vh; overflow-y: auto; border-radius: 0 0 3px 3px;
  }
}
.mrow {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: 2px; cursor: pointer;
  color: var(--ink); font-size: .84rem; letter-spacing: 0;
}
.mrow:hover { background: var(--panel-2); }
.mrow.on { color: var(--lichen); }
.micons a { color: var(--faint); margin-left: .55rem; font-size: .72rem; }
.micons a:hover { color: var(--gold); }
.mhint {
  padding: .5rem .6rem .35rem; color: var(--faint);
  font-size: .72rem; line-height: 1.5; border-top: 1px solid var(--line-2); margin-top: .3rem;
}

/* ── layout ─────────────────────────────────────────────────────────────── */
main {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 2.8rem) var(--gutter) clamp(4rem, 10vw, 7rem);
}
.narrow { max-width: 48rem; }
.cols { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 52rem) { .cols { grid-template-columns: 1fr; gap: 2.5rem; } }

/* type helpers */
.smallcaps, .eyebrow {
  font-size: .7rem; font-weight: 500; letter-spacing: .17em;
  text-transform: uppercase; color: var(--faint);
}
.eyebrow { display: block; margin-bottom: 1.3rem; }
.fine { color: var(--dim); font-size: .85rem; }
.dim { color: var(--dim); }
.error { color: var(--error); }
.rule-double {
  position: relative; border-bottom: 1px solid var(--line);
  padding-bottom: .55rem; margin-bottom: 1rem;
}
.rule-double::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 1px; background: var(--line-2);
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap;
  position: relative; border-bottom: 1px solid var(--line);
  padding-bottom: .7rem; margin-bottom: 1.1rem;
}
.section-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px;
  height: 1px; background: var(--line-2);
}
.section-head h2 { margin: 0; border: 0; font-size: clamp(1.5rem, 2.6vw, 1.95rem); color: var(--ink); }

/* ── mark (traced triskelion) & dividers ──────────────────────────────────
   The mark is a mask so it inherits the theme colour: faithful + bold cuts
   (triskelion.svg / triskelion-bold.svg), extra-bold for the favicon. */
.triskele {
  display: inline-block; width: 1.1em; aspect-ratio: 360 / 344;
  color: var(--gold); background-color: currentColor; opacity: .85;
  -webkit-mask: url("/static/triskelion-bold.svg") center / contain no-repeat;
  mask: url("/static/triskelion-bold.svg") center / contain no-repeat;
}
.triskele-lg { width: 22px; opacity: .6; }
.divider { display: flex; align-items: center; gap: 1.1rem; margin: clamp(2rem, 5vw, 3.5rem) 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-2); }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-size: .72rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; text-decoration: none;
  padding: .8rem 1.5rem; border: 1px solid var(--line); border-radius: 2px;
  background: transparent; color: var(--dim); cursor: pointer;
  transition: background .22s ease, color .22s ease, border-color .22s ease;
}
.btn:hover, button:hover:not(:disabled) { color: var(--gold); border-color: var(--gold-dim); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--bg); font-weight: 600; }
.btn.primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--bg); }
.btn.ghost { border-color: var(--line); color: var(--dim); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ── forms ──────────────────────────────────────────────────────────────── */
.grid { display: flex; gap: .9rem 1rem; flex-wrap: wrap; align-items: end; margin: 1.2rem 0 1.6rem; }
.grid label { flex: 1 1 11rem; min-width: 9rem; }
.grid button { flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 1.15rem; max-width: 34rem; }
.grid label, .stack label { display: flex; flex-direction: column; gap: .38rem; color: var(--dim); font-size: .82rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px;
  padding: .62rem .72rem; appearance: none;
  transition: border-color .2s ease, background .2s ease;
}
input::placeholder { color: var(--faint); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239d9a82' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem;
}
input:hover, select:hover { border-color: var(--gold-dim); }
input:focus-visible, select:focus-visible, textarea:focus-visible,
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 1px solid var(--gold); outline-offset: 2px;
}
label.inline { flex-direction: row; align-items: center; gap: .5rem; color: var(--dim); }
label.inline input { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ── tag fields (interview multi-value inputs) ──────────────────────────── */
.tagfield {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  gap: .3rem .35rem; min-height: 2.62rem; padding: .32rem .45rem;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px;
  transition: border-color .2s ease;
}
.tagfield:hover, .tagfield:focus-within { border-color: var(--gold-dim); }
.tag-chips { display: contents; }
.tag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .12rem .18rem .12rem .5rem; border-radius: 2px;
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  color: var(--ink); font-size: .84rem; line-height: 1.5;
}
.tag button {
  border: 0; background: none; padding: 0 .18rem; cursor: pointer;
  color: var(--dim); font-size: .95rem; line-height: 1;
}
.tag button:hover { color: var(--error); }
.tagfield input.tag-text {
  flex: 1 1 7rem; width: auto; min-width: 7rem; padding: .2rem .15rem;
  border: 0; background: none; font-size: .95rem;
}
.tagfield input.tag-text:focus-visible { outline: none; }
.tag-menu {
  position: absolute; z-index: 30; top: calc(100% + .28rem); left: 0; right: 0;
  max-height: 13rem; overflow-y: auto; padding: .22rem;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: var(--shadow);
}
.tag-opt {
  padding: .42rem .6rem; border-radius: 2px; color: var(--dim);
  font-size: .86rem; cursor: pointer;
}
.tag-opt:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--ink); }

/* ── interview builds (step 4) ─────────────────────────────────────────── */
.build-card {
  border: 1px solid var(--line); border-radius: 4px;
  padding: .9rem 1rem; margin-bottom: .9rem; background: var(--bg-2);
}
.build-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .55rem; gap: 1rem; }
.build-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem .8rem; }
.build-grid label {
  display: flex; flex-direction: column; gap: .25rem;
  color: var(--dim); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
}
.build-grid input { font-size: .88rem; padding: .45rem .55rem; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(15rem, .82fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 58rem) { .hero { grid-template-columns: 1fr; gap: 2.5rem; } }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.9rem, 6.2vw, 4.6rem); line-height: .97; margin-bottom: 1.1rem; }
.hero h1 em { font-style: italic; color: var(--gold); }
.lede { max-width: 33rem; color: var(--dim); font-size: 1.12rem; line-height: 1.62; }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.7rem 0 0; }
.hero-proof { margin-top: 1rem; max-width: 33rem; color: var(--faint); }

/* astrology glyphs: sized to the text, tinted by currentColor */
.astro-sym { width: 1.05em; height: 1.05em; vertical-align: -0.14em; margin-right: .1em; }
.sg-glyphs { display: flex; flex-wrap: wrap; gap: 1.1rem 1.6rem; margin-top: 1rem; }
.sg-glyph { display: flex; flex-direction: column; align-items: center; gap: .35rem;
  min-width: 3.4rem; color: var(--ink); }

/* tonight readout */
.readout {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 1.5rem 1.6rem 1.6rem; box-shadow: var(--shadow);
}
.r-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.r-score { font-family: var(--font-display); font-weight: 600; line-height: .9;
  font-size: clamp(3.2rem, 6vw, 4.2rem); color: var(--gold); margin: .7rem 0 0; }
.r-score span { font-family: var(--font-mono); font-size: .95rem; color: var(--faint); letter-spacing: 0; }
.r-meta { display: grid; gap: .65rem; margin: 1.2rem 0 0; padding-top: 1.1rem;
  border-top: 1px solid var(--line-2); }
.r-meta > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.r-meta dt { color: var(--faint); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; }
.r-meta dd { margin: 0; font-family: var(--font-mono); font-size: .88rem; color: var(--ink); }
.r-meta dd .lune { color: var(--water); }
.moon-svg { display: inline-block; vertical-align: -1.5px; }
.r-link { display: inline-block; margin-top: 1.3rem; font-size: .7rem; letter-spacing: .13em;
  text-transform: uppercase; }

/* ── ledger ─────────────────────────────────────────────────────────────── */
.ledger, .band { margin-top: clamp(3rem, 8vw, 6rem); }
.ledger-note { max-width: 40rem; margin-bottom: 1.4rem; }
.tier-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.trow {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .9fr) 3.4rem;
  align-items: baseline; gap: 0 1.25rem;
  padding: 1.1rem .5rem 1.1rem 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
  transition: background .2s ease, padding-left .2s ease;
}
.trow:hover { background: var(--hover); padding-left: .55rem; }
.trow .tier { grid-column: 1; font-family: var(--font-display); font-size: 1.5rem;
  font-weight: 700; line-height: .9; color: var(--faint); }
.trow.S .tier { color: var(--gold); }
.trow.A .tier { color: var(--lichen); }
.trow.B .tier { color: var(--water); }
.trow .when { grid-column: 2; font-family: var(--font-display); font-size: 1.18rem; color: var(--ink); }
.trow .when .day { font-weight: 600; }
.trow .when .clock { font-family: var(--font-mono); font-size: .8rem; color: var(--dim);
  letter-spacing: 0; margin-left: .45rem; }
.trow .lune { color: var(--water); margin-left: .5rem; font-size: .95rem; }
.trow .where { grid-column: 3; font-size: .86rem; color: var(--dim); }
.trow .rig { grid-column: 4; font-size: .86rem; color: var(--dim); text-align: right; }
.trow .score { grid-column: 5; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 1rem; color: var(--dim); text-align: right; }
.trow .score i { font-style: normal; font-size: .6rem; color: var(--faint); }
.trow.S .score { color: var(--gold); }
@media (max-width: 46rem) {
  .trow { grid-template-columns: 1.6rem 1fr auto; gap: .15rem .9rem; padding: 1rem 0; }
  .trow:hover { padding-left: .4rem; }
  .trow .tier { grid-row: 1; grid-column: 1; }
  .trow .when { grid-row: 1; grid-column: 2; font-size: 1.06rem; }
  .trow .score { grid-row: 1; grid-column: 3; }
  .trow .where { grid-row: 2; grid-column: 2 / 4; }
  .trow .rig { grid-row: 3; grid-column: 2 / 4; text-align: left; }
}

/* ── prose lists ────────────────────────────────────────────────────────── */
.plain { list-style: none; padding-left: 0; margin: 0; }
ol.plain { counter-reset: step; }
ol.plain > li { counter-increment: step; position: relative; padding: 0 0 .9rem 2.1rem;
  color: var(--dim); }
ol.plain > li::before { content: counter(step); position: absolute; left: 0; top: .05rem;
  font-family: var(--font-display); font-size: 1.05rem; color: var(--gold); }
ol.plain strong, ul.plain strong { color: var(--ink); font-weight: 600; }
ul.plain > li { padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
ul.plain > li:last-child { border-bottom: 0; }
ul.lakes > li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
ul.lakes a { color: var(--ink); }
ul.lakes a:hover { color: var(--gold); }

/* ── tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .92rem; }
th {
  text-align: left; font-size: .68rem; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint);
  padding: .55rem .7rem; border-bottom: 1px solid var(--line);
}
td { padding: .72rem .7rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
.table-scroll > table { margin: 0; min-width: 100%; }
.table-scroll td, .table-scroll th { overflow-wrap: anywhere; }

/* no side-scroll on small screens: each row becomes a labeled ledger entry */
@media (max-width: 46rem) {
  .table-scroll { overflow-x: visible; }
  .table-scroll table, .table-scroll tbody { display: block; }
  .table-scroll thead { display: none; }
  .table-scroll tr { display: block; padding: .7rem 0; border-top: 1px solid var(--line); }
  .table-scroll tbody tr:first-child { border-top: 0; padding-top: 0; }
  .table-scroll td { display: block; padding: .22rem 0; border-bottom: 0; }
  .table-scroll td::before {
    content: attr(data-label); display: block; margin-bottom: .12rem;
    font-size: .62rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--faint);
  }
  .table-scroll td[data-label=""]::before { display: none; }
  tr:hover td { background: none; }
}

/* ── badges, pills, moon row ────────────────────────────────────────────── */
.badge { display: inline-block; font-size: .6rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; padding: .2rem .5rem; border-radius: 2px; margin-right: .4rem;
  border: 1px solid var(--line); color: var(--dim); vertical-align: .06em; }
.badge.ok { color: var(--lichen); border-color: color-mix(in srgb, var(--lichen) 45%, transparent);
  background: color-mix(in srgb, var(--lichen) 9%, transparent); }
.badge.pend { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 42%, transparent);
  background: color-mix(in srgb, var(--ember) 8%, transparent); }
.badge.mine { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 9%, transparent); }
.badge.gap { color: var(--ember); border-color: color-mix(in srgb, var(--ember) 45%, transparent);
  background: color-mix(in srgb, var(--ember) 9%, transparent); }
.moonrow { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.moon { color: var(--dim); font-size: .84rem; font-family: var(--font-mono); }
.moon.peak { color: var(--gold); }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 2px;
  padding: .4rem .8rem; font-size: .8rem; color: var(--dim); margin: .6rem 0; }
.pill.on { border-color: color-mix(in srgb, var(--lichen) 45%, transparent); color: var(--lichen);
  background: color-mix(in srgb, var(--lichen) 7%, transparent); }

/* review marks (local calibration) */
.mark { color: var(--gold); }
.mark.exact, .mark.miss-yes { color: var(--lichen); }
.mark.close, .mark.style { color: var(--ember); }
.mark.miss { color: var(--error); }
.mark.na, .mark.benched { color: var(--dim); }

/* ── report render ──────────────────────────────────────────────────────── */
.report { margin-top: 2rem; max-width: 46rem; }
.report h1 { font-size: clamp(1.7rem, 3vw, 2.25rem); }
.report h2 { font-size: 1.3rem; color: var(--gold); margin-top: 2.2rem; }
.report h3 { font-family: var(--font-body); font-weight: 600; font-size: .7rem;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-top: 1.6rem; }
.report p, .report li { color: var(--dim); }
.report strong { color: var(--ink); }
.report ul { padding-left: 1.2rem; }
.report hr { margin: 1.8rem 0; }
.scorebar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .8rem;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .82rem;
  color: var(--dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-2);
  padding: .95rem 0; margin: 1.2rem 0 0;
}
.scorebar strong { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600;
  color: var(--gold); line-height: 1; }

/* tackle / sources */
.tackle { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.tackle h2 { font-size: 1.25rem; color: var(--ink); }
.tackle ul.plain > li { padding: .85rem 0; }
.build { margin-top: .3rem; }
.build .sc { color: var(--faint); text-transform: uppercase; letter-spacing: .1em;
  font-size: .66rem; }

/* water page stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem 1.5rem; margin: 1.4rem 0; padding: 1.1rem 0;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.stats div { display: flex; flex-direction: column; gap: .15rem; }
.stats dt { color: var(--faint); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.stats dd { margin: 0; font-family: var(--font-mono); font-size: .9rem; color: var(--ink); }

/* waters map (Leaflet, dark tiles) */
.map { height: min(60vh, 460px); border: 1px solid var(--line); border-radius: 3px;
  margin: 1.2rem 0 1.6rem; background: var(--panel); z-index: 0; }
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); box-shadow: none; }
.leaflet-popup-content a { color: var(--gold); }
.leaflet-control-attribution { background: var(--header) !important; color: var(--faint); }
.leaflet-control-attribution a { color: var(--dim); }

/* ── wizard ─────────────────────────────────────────────────────────────── */
.progress { display: flex; list-style: none; padding: 0; margin: 1.8rem 0 1.4rem; }
.progress li { flex: 1; padding: .5rem .4rem; border-top: 1px solid var(--line-2);
  font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); }
.progress li.on { color: var(--gold); border-top-color: var(--gold); }
.istep { display: none; }
.istep.on { display: flex; flex-direction: column; gap: 1.2rem; }
.istep legend { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem;
  color: var(--ink); padding: 0 0 .4rem; }
.wiz-nav { display: flex; justify-content: space-between; gap: .8rem; margin-top: .4rem; }
.voice-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 42rem) { .voice-cards { grid-template-columns: 1fr; } }
.vcard { display: flex; flex-direction: column; gap: .25rem; border: 1px solid var(--line);
  border-radius: 3px; padding: .8rem .9rem; cursor: pointer; color: var(--ink);
  transition: border-color .2s, background .2s; }
.vcard:has(input:checked) { border-color: var(--gold-dim); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.vcard input { display: none; }
.vcard span { color: var(--dim); font-size: .78rem; }

/* ── footer ─────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line-2); margin-top: clamp(4rem, 10vw, 8rem); }
.footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2.2rem, 5vw, 3.5rem) var(--gutter) clamp(2.8rem, 6vw, 4rem);
}
footer .mark { display: flex; align-items: center; gap: .7rem; margin-bottom: .55rem; }
footer .wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.55rem;
  letter-spacing: .01em; color: var(--ink); }
footer p { max-width: 46rem; }
footer .fine { max-width: 52rem; }
.foot-legal { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem;
  margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid var(--line-2); }
.foot-legal a { font-size: .7rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--dim); }
.foot-legal a:hover { color: var(--gold); }

/* static snapshot notice (build_static.py) */
.snap { border: 1px solid var(--line); border-left: 2px solid var(--gold-dim);
  border-radius: 2px; padding: .65rem .9rem; margin: 0 0 1.6rem; color: var(--dim);
  background: var(--panel); }

/* full-page navigation feedback (app.js) */
.nav-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--gold); z-index: 200; opacity: 0; pointer-events: none; }
body.is-loading { cursor: progress; }
body.is-loading .nav-progress { width: 88%; opacity: 1;
  transition: width 5s cubic-bezier(.08, .62, .24, 1), opacity .18s ease; }

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

/* ── theme variants (local /styleguide; see the styleguide page) ─────────────
   Same components, swapped tokens. `loam` is the current production theme;
   `first-light`, `crisp-dark`, and `almanac` are the design directions. */
html[data-theme="loam"] { color-scheme: dark; }

html[data-theme="first-light"] {
  color-scheme: light;
  --bg: #f7f5ef; --bg-2: #efece2; --panel: #fffdf8; --panel-2: #f3f0e7;
  --line: #b8b2a0; --line-2: #e5e1d5;
  --ink: #14232a; --dim: #4e5c5f; --faint: #68726e;
  --gold: #8a5f16; --gold-bright: #a8761f; --gold-dim: #c8b183;
  --lichen: #33663a; --water: #17606f; --ember: #a9551f; --error: #9c2f22;
  --header: rgba(247, 245, 239, .88);
  --hover: rgba(20, 35, 42, .035);
  --shadow: 0 24px 50px -36px rgba(20, 35, 42, .35);
}
html[data-theme="first-light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234e5c5f' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

html[data-theme="crisp-dark"] {
  color-scheme: dark;
  --bg: #0a0f12; --bg-2: #0d1417; --panel: #16232a; --panel-2: #1c2b33;
  --line: #3a5057; --line-2: #22343b;
  --ink: #f2efe6; --dim: #a9b2ab; --faint: #7e8b86;
  --gold: #e2b35f; --gold-bright: #f2ca7e; --gold-dim: #8e7444;
  --lichen: #9ed07b; --water: #8ccadd; --ember: #dd9560; --error: #e3735c;
  --header: rgba(10, 15, 18, .9);
  --hover: rgba(255, 255, 255, .03);
  --shadow: 0 30px 60px -40px rgba(0, 0, 0, .8);
}
html[data-theme="crisp-dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a9b2ab' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

html[data-theme="almanac"] {
  color-scheme: light;
  --bg: #f3eddc; --bg-2: #ece5d0; --panel: #faf6ea; --panel-2: #f0e9d5;
  --line: #beb394; --line-2: #ded6bf;
  --ink: #1c1812; --dim: #565040; --faint: #6f6752;
  --gold: #7d5310; --gold-bright: #96661a; --gold-dim: #bda87b;
  --lichen: #41632c; --water: #275668; --ember: #96461e; --error: #872c20;
  --header: rgba(243, 237, 220, .9);
  --hover: rgba(28, 24, 18, .035);
  --shadow: 0 18px 40px -34px rgba(28, 24, 18, .45);
}
html[data-theme="almanac"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23565040' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ── field mode: print / pocket card ────────────────────────────────────────
   Light tokens so the journal survives a laser printer; chrome, forms and
   nav disappear; the ledger, windows and rigs stay. */
@media print {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #fff; --bg-2: #f7f7f4; --panel: #fff; --panel-2: #f3f3f0;
    --ink: #141810; --dim: #444; --faint: #666; --line: #b9b9b3; --line-2: #d8d8d2;
    --gold: #7a5c1e; --gold-bright: #8a6a24; --gold-dim: #a98a4a;
    --lichen: #3d6b2f; --water: #31566b; --ember: #8a5324; --error: #8a2f22;
    --header: transparent;
    --hover: transparent;
  }
  header, footer, nav, form, #profile-menu, .no-print, .nav-progress,
  .foot-legal, .menu-body, .menu { display: none !important; }
  body { background: #fff !important; color: var(--ink) !important; }
  .narrow { max-width: none; margin: 0; padding: 0; }
  .report { font-size: 12px; }
  a { text-decoration: none; }
  h1 { font-size: 20px; }
  table { font-size: 11px; }
}

/* ── session timeline (server-rendered SVG) ───────────────────────────────── */
.timeline { margin: 6px 0 16px; }
.timeline svg { display: block; width: 100%; height: auto; }

/* ── PWA install affordance ───────────────────────────────────────────────── */
.foot-install { margin: 10px 0 0; }
.install-btn { font: inherit; font-size: 13px; color: var(--ink); background: none;
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 12px; cursor: pointer; }
.install-btn:hover { border-color: var(--gold); color: var(--gold); }
