/* ComboCrusher — shared styles
   Palette: cool oyster paper, blue-black machine panel, pine, goldenrod flag.
   Type: Archivo (expanded) display / Newsreader body / IBM Plex Mono data. */

:root {
  --paper: #E8E9E3;
  --paper-2: #DFE1D9;
  --paper-3: #D5D8CE;
  --ink: #15181A;
  --slate: #59635C;
  --slate-2: #7C857D;
  --rule: #C4C8BC;
  --machine: #0D1115;
  --machine-2: #161B21;
  --machine-3: #1F262D;
  --machine-ink: #C6CFCB;
  --machine-dim: #6B7780;
  --pine: #2C5D51;
  --pine-lt: #4A8577;
  --flag: #B8861B;
  --flag-lt: #D9A63A;
  --reject: #77827A;
  --measure: 34rem;
  --gutter: 9.5rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 19px;
  line-height: 1.58;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* ---------- type primitives ---------- */

.display {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-variation-settings: "wdth" 112, "wght" 650;
  letter-spacing: -0.022em;
  line-height: 0.98;
  margin: 0;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}

a { color: var(--pine); text-decoration: none; border-bottom: 1px solid rgba(44,93,81,0.32); }
a:hover { border-bottom-color: var(--pine); background: rgba(44,93,81,0.06); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

/* ---------- shell ---------- */

.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.75rem; }

.topbar {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 40;
  background: rgba(232,233,227,0.94);
  backdrop-filter: blur(6px);
}
.topbar .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.25rem; padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.brand {
  font-family: "Archivo", sans-serif;
  font-variation-settings: "wdth" 118, "wght" 700;
  font-size: 0.92rem; letter-spacing: 0.02em;
  color: var(--ink); border: 0; text-transform: uppercase;
}
.brand:hover { background: none; }
.brand span { color: var(--pine); }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--slate); border: 0; padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); background: none; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--flag); }

/* ---------- gutter grid ---------- */

.block {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 2.25rem;
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.block:last-of-type { border-bottom: 0; }
.block > .tag { padding-top: 0.55rem; }
.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--slate-2); line-height: 1.5;
}
.tag b { display: block; color: var(--ink); font-weight: 500; }
.body { max-width: var(--measure); }
.body > *:first-child { margin-top: 0; }
.body > *:last-child { margin-bottom: 0; }

h2.head {
  font-family: "Archivo", sans-serif;
  font-variation-settings: "wdth" 108, "wght" 620;
  font-size: 1.72rem; line-height: 1.08; letter-spacing: -0.018em;
  margin: 0 0 1rem;
}
h3.sub {
  font-family: "Archivo", sans-serif;
  font-variation-settings: "wdth" 100, "wght" 600;
  font-size: 1rem; letter-spacing: 0.005em;
  margin: 2rem 0 0.5rem;
}
p { margin: 0 0 1.05rem; }
.lede { font-size: 1.22rem; line-height: 1.5; color: var(--ink); }
.fine { font-size: 0.86rem; line-height: 1.55; color: var(--slate); }

ul.list, ol.list { margin: 0 0 1.1rem; padding-left: 1.1rem; }
ul.list li, ol.list li { margin-bottom: 0.5rem; }
ul.tight li { margin-bottom: 0.25rem; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 2.25rem 0; }

/* ---------- hero ---------- */

.hero { padding: 5rem 0 3.5rem; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: clamp(2.6rem, 7.4vw, 5.1rem); max-width: 15ch; }
.hero .lede { max-width: 33rem; margin-top: 1.9rem; }
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pine); margin: 0 0 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); max-width: 12rem; }

/* ---------- scanner (signature element) ---------- */

.scanner {
  background: var(--machine);
  color: var(--machine-ink);
  border-radius: 3px;
  margin: 3rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5), 0 18px 44px -28px rgba(13,17,21,0.85);
}
.scanner-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--machine-3);
  font-size: 0.63rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--machine-dim);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pine-lt); flex: none; }
.scanner-bar .spacer { flex: 1; }
.scanner-body { padding: 1.35rem 1.1rem 1.1rem; }

.combo-meta {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.63rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--machine-dim); margin-bottom: 1rem;
}
.leg { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.34rem 0; }
.leg .idx { color: var(--machine-dim); font-size: 0.66rem; letter-spacing: 0.1em; flex: none; width: 3.2rem; }
.leg .name { flex: 1; color: var(--machine-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg .px { color: #fff; font-weight: 500; flex: none; }

.calc { border-top: 1px solid var(--machine-3); margin-top: 0.8rem; padding-top: 0.8rem; }
.calc-row { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.28rem 0; }
.calc-row .k { flex: 1; color: var(--machine-dim); font-size: 0.72rem; letter-spacing: 0.06em; }
.calc-row .v { color: var(--machine-ink); }
.calc-row.delta .k { color: var(--machine-ink); }
.calc-row.delta .v { font-weight: 600; }

.meter { height: 3px; background: var(--machine-3); margin: 1rem 0 0.7rem; position: relative; }
.meter-fill { height: 100%; background: var(--reject); width: 8%; transition: width .5s cubic-bezier(.4,0,.2,1), background .3s; }
.meter-thresh { position: absolute; top: -4px; bottom: -4px; left: 62%; width: 1px; background: var(--flag); }
.meter-thresh::after {
  content: "alert threshold"; position: absolute; left: 6px; top: -3px;
  font-size: 0.55rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--flag);
  white-space: nowrap;
}

.verdict {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 1.5rem; padding-top: 0.85rem; border-top: 1px solid var(--machine-3);
  font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase;
}
.verdict .label { color: var(--reject); font-weight: 600; }
.verdict .why { color: var(--machine-dim); letter-spacing: 0.04em; text-transform: none; font-size: 0.74rem; }
.scanner.is-flagged .verdict .label { color: var(--flag-lt); }
.scanner.is-flagged .meter-fill { background: var(--flag-lt); }
.scanner.is-flagged .dot { background: var(--flag-lt); }

.tally {
  display: flex; gap: 2rem; flex-wrap: wrap;
  border-top: 1px solid var(--machine-3);
  padding: 0.85rem 1.1rem;
  font-size: 0.63rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--machine-dim);
}
.tally b { color: var(--machine-ink); font-weight: 500; }

/* ---------- data table ---------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin: 0 0 1.25rem; }
.tbl th, .tbl td { text-align: left; padding: 0.6rem 0.7rem 0.6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl th {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--slate); font-weight: 500; border-bottom-color: var(--ink);
}
.tbl td.num { font-family: "IBM Plex Mono", monospace; }
.tbl .empty { color: var(--slate-2); font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; }

/* ---------- stage list (engine) ---------- */

.stage { display: grid; grid-template-columns: 10.5rem minmax(0,1fr); gap: 1.75rem; padding: 1.6rem 0; border-top: 1px solid var(--rule); }
.stage:first-of-type { border-top: 1px solid var(--ink); }
.stage .file {
  font-family: "IBM Plex Mono", monospace; font-size: 0.76rem;
  color: var(--ink); letter-spacing: 0.01em;
}
.stage .file small { display: block; margin-top: 0.3rem; font-size: 0.62rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--slate-2); }
.stage p { margin-bottom: 0.6rem; font-size: 0.96rem; }
.stage p:last-child { margin-bottom: 0; }

/* ---------- callout ---------- */

.note {
  border-left: 2px solid var(--flag);
  background: rgba(184,134,27,0.07);
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.note .mono { display: block; margin-bottom: 0.4rem; color: var(--flag); }
.note p:last-child { margin-bottom: 0; }

.panel {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 1.35rem 1.4rem;
  margin: 1.5rem 0;
}
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }

/* ---------- form ---------- */

.form { max-width: 27rem; }
.field { margin-bottom: 1.15rem; }
.field label {
  display: block; margin-bottom: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--slate);
}
.field input[type="email"], .field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 0.68rem 0.75rem;
  font-family: "IBM Plex Mono", monospace; font-size: 0.86rem;
  background: #fff; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 2px;
}
.field textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 0.65rem; align-items: flex-start; margin-bottom: 1.35rem; font-size: 0.85rem; line-height: 1.45; }
.check input { margin-top: 0.28rem; flex: none; width: 15px; height: 15px; accent-color: var(--pine); }

.btn {
  font-family: "Archivo", sans-serif;
  font-variation-settings: "wdth" 108, "wght" 620;
  font-size: 0.88rem; letter-spacing: 0.01em;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 2px;
  padding: 0.72rem 1.5rem; cursor: pointer;
}
.btn:hover { background: var(--pine); border-color: var(--pine); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.formmsg { margin-top: 1rem; font-size: 0.88rem; padding: 0.75rem 0.9rem; border-left: 2px solid var(--slate-2); background: var(--paper-2); }
.formmsg.ok { border-left-color: var(--pine); }
.formmsg.err { border-left-color: #9A3B22; }
.formmsg[hidden] { display: none; }

/* ---------- legal doc pages ---------- */

.doc { max-width: 40rem; padding: 3rem 0 1rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin-bottom: 1rem; }
.doc h2 {
  font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 104, "wght" 620;
  font-size: 1.1rem; margin: 2.6rem 0 0.7rem; letter-spacing: -0.005em;
}
.doc h3 {
  font-family: "Archivo", sans-serif; font-variation-settings: "wdth" 100, "wght" 600;
  font-size: 0.94rem; margin: 1.6rem 0 0.45rem;
}
.doc p, .doc li { font-size: 0.98rem; line-height: 1.62; }
.doc ul, .doc ol { padding-left: 1.15rem; margin-bottom: 1.1rem; }
.doc li { margin-bottom: 0.45rem; }
.doc .meta { display: flex; gap: 1.75rem; flex-wrap: wrap; padding: 0.85rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 2.25rem; }

.ph { background: rgba(184,134,27,0.16); padding: 0 0.25em; border-bottom: 1px dashed var(--flag); }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--ink); margin-top: 2rem; padding: 2.5rem 0 3.5rem; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 2rem; margin-bottom: 2.25rem; }
.foot h4 { font-family: "IBM Plex Mono", monospace; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate); margin: 0 0 0.7rem; font-weight: 500; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.4rem; font-size: 0.88rem; }
.foot a { color: var(--ink); border-bottom-color: var(--rule); }
.disclaimer { font-size: 0.78rem; line-height: 1.6; color: var(--slate); max-width: 44rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.disclaimer strong { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 17.5px; }
  .block { grid-template-columns: 1fr; gap: 0.9rem; padding: 2.5rem 0; }
  .block > .tag { padding-top: 0; }
  .stage { grid-template-columns: 1fr; gap: 0.6rem; }
  .hero { padding: 3.25rem 0 2.5rem; }
  .topbar .wrap { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .nav { gap: 1rem; }
  .meter-thresh::after { display: none; }
  .leg .idx { width: 2.6rem; }
  .scanner { font-size: 0.74rem; }
}

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