/* ------------------------------------------------------------------
   One stylesheet for the whole site. No framework, no build step for
   CSS — this file is served as written.

   The look is a drafting table: cool gray-blue ink on warm paper, one
   high-visibility accent for the things you act on, and a monospaced
   face for every figure so numbers line up in a column the way they
   would on a printed order.
   ------------------------------------------------------------------ */

@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
/* Only the wordmark uses this. Archivo ships no variable axis here, and a
   browser can synthesize bolder but never lighter, so the light half of the
   lockup needs a real face. */
@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* Tells the browser the page handles both schemes itself. Without it the
     UA renders its own widgets — scrollbars, select popups, number spinners,
     focus rings — in light regardless of the theme, and Chromium's auto-dark
     feature treats the page as one that needs force-darkening. */
  color-scheme: light dark;

  --ink:      #16212a;
  --ink-2:    #3f5163;
  --ink-3:    #6b7f92;
  --paper:    #f7f5f1;
  --card:     #ffffff;
  --rule:     #dcd8d1;
  --rule-2:   #ebe7e1;
  --accent:   #b4460f;   /* the one color you are meant to act on */
  --accent-2: #8c3609;
  --deep:     #1d2a33;   /* masthead and ticket */
  --deep-2:   #24343f;
  --good:     #1f6f4a;

  /* The ticket is paper in both themes. These do not flip. */
  --kraft:      #ddd4c0;
  --kraft-2:    #4a4436;
  --kraft-3:    #6f6857;
  --kraft-ink:  #1c1913;
  --kraft-rule: rgba(28, 25, 19, 0.24);
  --hazard:     #f5b800;   /* safety yellow — the answer, and the only shout */
  --hazard-ink: #4a3e00;

  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Archivo", var(--sans);
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1120px;
  --narrow: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed; --ink-2: #b3bfca; --ink-3: #8496a6;
    --paper: #12181d; --card: #19222a;
    --rule: #2c3944; --rule-2: #222d36;
    --accent: #ff8b4a; --accent-2: #ffa771;
    --deep: #0d1318; --deep-2: #16202a;
    --good: #58c295;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: "tnum" 1;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 22px; }
.shell-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 22px; }

/* ---------------- masthead ---------------- */
.masthead {
  background: var(--deep);
  border-bottom: 3px solid var(--accent);
  position: sticky; top: 0; z-index: 20;
}
.masthead .shell { display: flex; align-items: center; gap: 26px; min-height: 62px; flex-wrap: wrap; }
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 19px;
  color: #fff; text-decoration: none; letter-spacing: -0.02em;
}
/* No space between the words — the weight change separates them, which keeps
   the wordmark matching the domain character for character. */
.wordmark .wm-light { font-weight: 400; }
/* Same glyph as assets/icon.svg, minus its dark backing plate — the
   masthead is already dark. currentColor lets it follow the accent. */
.wordmark .mark { width: 18px; height: 18px; flex: none; color: var(--accent); }
.masthead nav { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.masthead nav a {
  color: #c8d3dd; text-decoration: none; font-size: 15px; font-weight: 600;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.masthead nav a:hover { color: #fff; border-bottom-color: var(--accent); }
.masthead nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }

/* Below the width where the nav still fits beside the wordmark, it drops to
   its own row. margin-left:auto would then shove it to the right and leave a
   gap under the wordmark, so it takes the full row and aligns left instead.

   Sticky also stops earning its keep here: with the nav on two lines the
   masthead is ~150px, which is a quarter of a phone screen held permanently.
   Better to give the page back. */
@media (max-width: 639px) {
  .masthead { position: static; }
  .masthead .shell { min-height: 0; gap: 4px 18px; padding-top: 10px; padding-bottom: 8px; }
  .masthead nav { margin-left: 0; width: 100%; gap: 4px 16px; }
  .masthead nav a { font-size: 14px; padding: 3px 0; }
}

/* ---------------- breadcrumbs + hero ---------------- */
.crumbs { padding-top: 18px; }
.crumbs ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; font-size: 13px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.hero { padding: 26px 22px 30px; }
.home-hero { padding-top: 46px; }
.eyebrow {
  font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--accent); margin: 0 0 14px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin-bottom: 14px; }
.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--ink-2); max-width: 62ch; margin: 0; }

.stat-strip {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px;
}
.stat-strip span {
  font: 500 13px/1 var(--mono);
  background: var(--card); border: 1px solid var(--rule);
  padding: 9px 12px; border-radius: 3px; color: var(--ink-2);
}
.stat-strip b { font-weight: 500; }

/* ---------------- ads ---------------- */
.ad { margin: 30px 0; display: flex; justify-content: center; }
.ad-label { display: block; font: 400 10px/1 var(--mono); letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 4px; }

/* ---------------- calculator layout ---------------- */
.calc { display: grid; grid-template-columns: 1fr 400px; gap: 26px; align-items: start; }
@media (max-width: 940px) { .calc { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 5px; padding: 22px;
}
.panel-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-size: 20px; }
.hint { font-size: 13px; color: var(--ink-3); }

.section-card {
  border: 1px solid var(--rule-2); border-radius: 4px;
  padding: 15px; margin-bottom: 14px; background: var(--paper);
}
.section-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-card h3 { font-size: 14px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font: 600 13px var(--sans);
}
.link-btn:hover { text-decoration: underline; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: 600 13px var(--sans); padding: 7px 12px; cursor: pointer;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 3px;
}
.seg button:hover { border-color: var(--ink-3); }
.seg button[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: #fff; }

.dims { display: flex; flex-wrap: wrap; gap: 12px; }
.dims > div { flex: 1 1 130px; min-width: 0; }
.dim-unit { flex: 0 0 92px; }

.field { margin-top: 16px; }
.field-label {
  display: block; font: 600 12px/1 var(--mono); text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 6px;
}
.pair { display: flex; gap: 8px; }
.pair input { flex: 1 1 auto; min-width: 0; }
.pair select { flex: 0 0 92px; }

input[type="number"], select {
  width: 100%; padding: 9px 10px;
  font: 400 16px var(--mono);
  color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 3px;
}
select { font-family: var(--sans); font-size: 14px; }
input[type="number"]:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button {
  font: 500 12px var(--mono); padding: 5px 9px; cursor: pointer;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 999px;
}
.chips button:hover { border-color: var(--ink-3); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.subtle { font-size: 12.5px; color: var(--ink-3); margin: 7px 0 0; line-height: 1.5; }

.add-section {
  width: 100%; padding: 10px; cursor: pointer; margin-bottom: 4px;
  font: 600 14px var(--sans); color: var(--ink-2);
  background: none; border: 1px dashed var(--rule); border-radius: 4px;
}
.add-section:hover { border-color: var(--accent); color: var(--accent); }

.prices { margin-top: 20px; border-top: 1px solid var(--rule-2); padding-top: 14px; }
.prices summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.prices .grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.prices .grid > div { flex: 1 1 150px; }

.form-reset { margin: 16px 0 0; }

/* ---------------- the order ticket ---------------- */
.ticket-wrap { position: sticky; top: 84px; }
@media (max-width: 940px) { .ticket-wrap { position: static; } }

.ticket {
  /* Kraft paper with punched notches. The ticket is the whole point of the
     brand, so it should read as a physical thing you hand across a trade
     counter rather than a UI panel. The mask cuts half-circles out of the
     top and bottom edges. */
  --notch: 9px;
  background: var(--kraft);
  color: var(--kraft-ink);
  padding: 26px 20px 22px;
  position: relative;
  filter: drop-shadow(0 10px 26px rgba(22, 33, 42, 0.18));
  -webkit-mask:
    radial-gradient(var(--notch) at 50% 0, #0000 98%, #000) 50% 0 / calc(2 * var(--notch)) var(--notch) repeat-x,
    radial-gradient(var(--notch) at 50% 100%, #0000 98%, #000) 50% 100% / calc(2 * var(--notch)) var(--notch) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--notch)) no-repeat;
  mask:
    radial-gradient(var(--notch) at 50% 0, #0000 98%, #000) 50% 0 / calc(2 * var(--notch)) var(--notch) repeat-x,
    radial-gradient(var(--notch) at 50% 100%, #0000 98%, #000) 50% 100% / calc(2 * var(--notch)) var(--notch) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * var(--notch)) no-repeat;
}
.ticket-top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px dashed var(--kraft-rule);
}
.t-title { font: 800 15px/1 var(--display); letter-spacing: 0.04em; }
.t-no { font: 400 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.11em; color: var(--kraft-3); }

.ticket-empty { font-size: 14px; color: var(--kraft-3); margin: 8px 0; line-height: 1.6; }

.row { display: flex; align-items: baseline; gap: 6px; font-size: 14px; margin: 7px 0; }
.r-label { color: var(--kraft-2); flex: 0 1 auto; }
.leader { flex: 1 1 auto; border-bottom: 1px dotted var(--kraft-rule); transform: translateY(-3px); min-width: 12px; }
.r-val { font: 500 14px var(--mono); color: var(--kraft-ink); flex: 0 0 auto; }
.row-note { font-size: 12px; color: var(--kraft-3); margin: 1px 0 9px; line-height: 1.5; }

.row-group { margin: 16px 0 6px; }
.row-group-title {
  font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--kraft-3); padding-bottom: 5px; border-bottom: 1px solid var(--kraft-rule);
}

/* The buy line is the answer, so it is the one thing on the page allowed to
   shout. Full-bleed to the ticket's edges with a rule above and below, the
   way a total is banded off on a printed docket. */
.buy-line {
  background: var(--hazard);
  margin: 18px -20px 0;
  padding: 16px 20px;
  border-top: 2px solid var(--kraft-ink);
  border-bottom: 2px solid var(--kraft-ink);
}
.bl-label {
  font: 400 11px/1 var(--mono); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--hazard-ink);
}
.bl-val {
  font-family: var(--display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(24px, 4.4vw, 32px); line-height: 1.1;
  text-transform: uppercase; color: var(--kraft-ink); margin-top: 3px;
}
.bl-sub { font: 400 12px var(--mono); color: var(--hazard-ink); margin-top: 5px; }

.verdict {
  margin-top: 15px; font-size: 13.5px; line-height: 1.6; color: var(--kraft-2);
  border-left: 2px solid var(--kraft-rule); padding-left: 12px;
}
.verdict b { color: var(--kraft-ink); }

.stamp {
  margin-top: 16px; padding-top: 11px; border-top: 1px dashed var(--kraft-rule);
  font: 400 10.5px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--kraft-3);
}

.ticket-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.print-btn {
  font: 600 13px var(--sans); cursor: pointer;
  padding: 8px 14px; border-radius: 3px;
  color: var(--ink-2); background: var(--card);
  border: 1px solid var(--rule);
}
.print-btn:hover { border-color: var(--accent); color: var(--accent); }
.print-btn[hidden] { display: none; }

/* Only ever seen on paper: which calculator this came off, and where to
   find it again. */
.print-only { display: none; }
.print-source {
  margin: 14px 0 0; padding-top: 10px;
  border-top: 1px dashed var(--kraft-rule);
  font: 400 10px/1.4 var(--mono); color: var(--kraft-3);
  word-break: break-all;
}

/* ---------------- prose, tables, faq ---------------- */
.shell-narrow h2 { font-size: clamp(21px, 3vw, 26px); margin: 40px 0 14px; }
.prose p { margin: 0 0 15px; color: var(--ink-2); }
.prose ul { color: var(--ink-2); padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose b { color: var(--ink); }

.wrap-scroll { overflow-x: auto; margin: 6px 0 20px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 420px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule-2); }
table.data th {
  font: 600 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); border-bottom: 1px solid var(--rule);
}
table.data td { color: var(--ink-2); }
table.data td:not(:first-child) { font-family: var(--mono); font-size: 13.5px; }

.faq details {
  border-bottom: 1px solid var(--rule-2); padding: 4px 0;
}
.faq summary {
  cursor: pointer; padding: 13px 0; font-weight: 600; font-size: 16px; color: var(--ink);
}
.faq summary:hover { color: var(--accent); }
.faq .answer p { margin: 0 0 15px; color: var(--ink-2); font-size: 15.5px; }

/* ---------------- home grid ---------------- */
.bin-head { font-size: 15px; margin: 34px 0 14px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.09em; font-family: var(--mono); font-weight: 600; }
.bin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.bin {
  display: block; text-decoration: none; padding: 18px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 5px;
  transition: border-color 0.12s, transform 0.12s;
}
.bin:hover { border-color: var(--accent); transform: translateY(-2px); }
.bin h3 { font-size: 19px; color: var(--ink); margin-bottom: 7px; }
.bin p { font-size: 14px; color: var(--ink-2); margin: 0 0 12px; line-height: 1.5; }
.bin-unit { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); }

/* ---------------- footer ---------------- */
.foot { background: var(--deep); color: #b9c7d3; margin-top: 60px; padding: 40px 0 30px; }
.foot .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 26px; }
.foot h4 { font-size: 12px; font-family: var(--mono); font-weight: 600; text-transform: uppercase; letter-spacing: 0.11em; color: #7f95a6; margin-bottom: 11px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 7px; }
/* Scoped to the link columns. Left unscoped it also hit the one link in the
   fine print, setting 14.5px inside 12.5px text. */
.foot .cols a { color: #d3dde5; text-decoration: none; font-size: 14.5px; }
.foot .cols a:hover { color: var(--accent); }
/* A link inside a sentence inherits the sentence's size, and takes an
   underline — at this size a color shift alone is too weak to read as one. */
.foot .fine a, .foot .copyright a {
  color: #b9c7d3; text-decoration: underline; text-underline-offset: 2px;
}
.foot .fine a:hover, .foot .copyright a:hover { color: var(--accent); }
.foot .sister {
  margin: 30px 0 0; padding: 14px 16px; font-size: 14px; line-height: 1.6;
  background: rgba(255, 255, 255, 0.045); border-radius: 4px; border-left: 2px solid var(--accent);
}
.foot .sister b { color: #fff; }
.foot .fine {
  margin: 22px 0 0; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px; line-height: 1.65; color: #8fa2b1;
}
/* Set off from the disclaimer above it — they are two separate statements,
   and a <br> ran them together. */
.foot .copyright {
  margin: 12px 0 0;
  font-size: 12.5px; line-height: 1.65; color: #8fa2b1;
}

@media print {
  /* Everything except the ticket and the heading that names it. The prose,
     the tables and the FAQ are for reading on screen; nobody wants six pages
     of them behind the one thing they meant to take to the counter. */
  .masthead, .foot, .ad, .crumbs, .shell-narrow,
  .eyebrow, .lede, .stat-strip,
  .panel, .add-section, .ticket-actions { display: none !important; }

  @page { margin: 14mm; }

  body { background: #fff; color: #000; }
  .hero { padding: 0 0 12px; }
  .hero h1 { font-size: 21px; }
  .shell, .calc { max-width: none; padding: 0; display: block; }
  .ticket-wrap { position: static; }

  .ticket {
    max-width: 92mm;
    /* The notch mask and the drop shadow are screen effects — some engines
       rasterise or drop them entirely, so print a plain bordered docket. */
    -webkit-mask: none; mask: none;
    filter: none;
    border: 1.5pt solid var(--kraft-ink);
    padding: 12pt;
  }

  /* Browsers strip backgrounds by default, which would print the buy line as
     white on white and lose the one row that matters. */
  .ticket, .buy-line {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .buy-line { margin-left: -12pt; margin-right: -12pt; padding: 10pt 12pt; }

  .print-only { display: block !important; }
  .row, .row-note, .verdict, .stamp { page-break-inside: avoid; }
}
