/* Basket of Goods — site styles
   Palette: cool paper, slate ink, grocer's green for controls, manila for the basket tickets.
   Chart colours follow a validated categorical order (see js/app.js SERIES). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113;
}

:root {
  color-scheme: light;
  --paper: #f3f4f0;
  --surface: #fbfbf9;
  --ink: #1b2430;
  --ink-2: #4d5662;
  --ink-3: #6f7781;
  --rule: #cdd1c9;
  --grid: #e1e3dc;
  --ticket: #ebdcb2;
  --ticket-ink: #3b3220;
  --ticket-edge: #cdb98a;
  --accent: #1e6b52;
  --accent-ink: #ffffff;
  --focus: #1e6b52;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --wage: #1b2430;
  --measure: 68ch;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #12171c;
    --surface: #1a1a19;
    --ink: #eceee9;
    --ink-2: #c3c6bf;
    --ink-3: #9aa09a;
    --rule: #39403f;
    --grid: #2c2f2d;
    --ticket: #3a3324;
    --ticket-ink: #f1e6c8;
    --ticket-edge: #5a4e33;
    --accent: #6cc3a0;
    --accent-ink: #0e1a15;
    --focus: #6cc3a0;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --wage: #eceee9;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-stretch: 100%;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* masthead */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-weight: 800; font-stretch: 125%; font-size: 1.15rem; letter-spacing: -0.01em;
  text-decoration: none; display: inline-flex; align-items: center; gap: .5rem;
}
.wordmark svg { width: 26px; height: 26px; }
.masthead nav { display: flex; gap: 1.25rem; font-size: .95rem; }
.masthead nav a { text-decoration: none; color: var(--ink-2); }
.masthead nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

/* the sentence of controls */
.ask {
  margin: clamp(1.5rem, 4vw, 2.75rem) 0 0;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 2.1;
  font-weight: 500;
  max-width: 46ch;
  font-stretch: 100%;
}
.ask label.vh, .vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.pick {
  font: inherit; font-weight: 700; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 2px solid var(--accent);
  padding: 0 1.4em 0 .1em; margin: 0 .1em;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right .55em center, right .25em center;
  background-size: .3em .3em, .3em .3em;
  background-repeat: no-repeat;
  border-radius: 0;
  cursor: pointer;
  max-width: 100%;
}
.pick option { font-size: 1rem; font-weight: 400; color: #1b2430; background: #fff; }
input.pick.year { width: 4.2ch; padding-right: .1em; background-image: none; text-align: center; -moz-appearance: textfield; }
input.pick.year::-webkit-outer-spin-button, input.pick.year::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ask .hint { display: block; font-size: .95rem; line-height: 1.5; color: var(--ink-2); font-weight: 400; margin-top: .5rem; }

/* headline */
.verdict { margin: clamp(1.75rem, 4vw, 3rem) 0 .5rem; }
.verdict p { margin: 0; max-width: 40ch; font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--ink-2); }
.verdict .pair { display: flex; flex-wrap: wrap; gap: 1.25rem clamp(1.25rem, 4vw, 3rem); margin: .75rem 0 .75rem; align-items: flex-end; }
.verdict .when { display: block; font-size: 1rem; color: var(--ink-2); font-weight: 600; margin-bottom: .35rem; }
.verdict .now { border-left: 2px solid var(--rule); padding-left: clamp(1.25rem, 4vw, 3rem); }
.verdict .big {
  display: block;
  font-weight: 800; font-stretch: 125%;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: .95; letter-spacing: -0.02em;
}
.verdict .big small { font-size: .45em; font-weight: 700; letter-spacing: 0; margin-left: .08em; }
.verdict .change { font-weight: 700; color: var(--ink); }
.verdict .caveat { font-size: .95rem; margin-top: .5rem; }

/* sections */
section.block { padding: clamp(1.75rem, 4vw, 2.75rem) 0; border-top: 1px solid var(--rule); }
section.block:first-of-type { border-top: 0; }
h2 { font-size: 1.35rem; font-weight: 750; font-stretch: 112%; margin: 0 0 .35rem; letter-spacing: -0.005em; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; }
.lede { color: var(--ink-2); max-width: var(--measure); margin: 0 0 1.25rem; }

/* chart frames */
.chart { position: relative; height: clamp(280px, 42vw, 420px); }
.chart.small { height: 200px; }
.chart canvas { display: block; }
.chart-tools { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin: 0 0 .75rem; font-size: .95rem; color: var(--ink-2); }
.toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 2px; background: var(--surface); }
.toggle button {
  font: inherit; font-size: .9rem; border: 0; background: transparent; color: var(--ink-2);
  padding: .3rem .8rem; border-radius: 999px; cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.summary { font-size: .92rem; color: var(--ink-2); max-width: var(--measure); margin: .75rem 0 0; }
.marks { list-style: none; margin: .75rem 0 0; padding: 0; font-size: .9rem; color: var(--ink-2); max-width: var(--measure); }
.marks li { display: grid; grid-template-columns: 1.6rem 3.4rem 1fr; gap: .25rem; padding: .15rem 0; }
.marks .key {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  border: 1.5px solid var(--ink-2); font-size: .72rem; font-weight: 700; color: var(--ink);
}
.marks .key.basket { border-style: dashed; }
.marks .yr { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

details.table { margin-top: 1rem; font-size: .9rem; }
details.table summary { cursor: pointer; color: var(--ink-2); }
.tablewrap { overflow-x: auto; max-height: 360px; overflow-y: auto; border: 1px solid var(--rule); margin-top: .5rem; background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: .3rem .6rem; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface); font-weight: 650; }

/* basket: price tickets */
.tickets { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.ticket {
  position: relative;
  background: var(--ticket); color: var(--ticket-ink);
  padding: .8rem .9rem .75rem 1.9rem;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%);
  min-height: 132px;
  display: flex; flex-direction: column; gap: .35rem;
}
.ticket::before { /* punched hole */
  content: ""; position: absolute; left: 13px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ticket-edge);
}
.ticket .top { display: flex; align-items: center; gap: .5rem; }
.ticket svg { width: 28px; height: 28px; flex: none; }
.ticket .name { font-weight: 700; line-height: 1.2; }
.ticket .unit { font-size: .85rem; opacity: .85; }
.ticket .since { font-size: .8rem; opacity: .85; }
.qty { display: flex; align-items: center; gap: .3rem; margin-top: auto; }
.qty button {
  font: inherit; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ticket-ink);
  background: transparent; color: var(--ticket-ink); cursor: pointer; line-height: 1; font-size: 1.05rem; font-weight: 700;
}
.qty input {
  font: inherit; font-weight: 700; width: 6.5ch; text-align: center; border: 0; border-bottom: 1.5px solid var(--ticket-ink);
  background: transparent; color: var(--ticket-ink); padding: 0; font-variant-numeric: tabular-nums;
}
.qty .remove { margin-left: auto; width: auto; border: 0; border-radius: 4px; font-size: .85rem; font-weight: 500; text-decoration: underline; padding: 0 .2rem; }
.ticket.off { opacity: .55; }
.add-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.add-row select, .add-row button {
  font: inherit; font-size: .95rem; padding: .45rem .7rem; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 6px;
}
.add-row button { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; cursor: pointer; }

/* small multiples */
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.75rem 2rem; }
.multiple h3 { display: flex; align-items: center; gap: .45rem; }
.multiple h3 svg { width: 20px; height: 20px; }
.multiple .sub { font-size: .88rem; color: var(--ink-2); margin: 0 0 .4rem; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9rem; color: var(--ink-2); margin: 0 0 .75rem; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: .4rem; }
.legend .sw { width: 18px; height: 0; border-top: 2px solid; display: inline-block; }
.legend .sw.thick { border-top-width: 3px; }

.notes { font-size: .9rem; color: var(--ink-2); max-width: var(--measure); }
.notes h3 { font-size: .95rem; color: var(--ink); }
.notes ul { padding-left: 1.1rem; margin: .25rem 0 1rem; }

.empty { color: var(--ink-2); font-style: normal; padding: 1.5rem 0; }

footer.site {
  border-top: 1px solid var(--rule); margin-top: 2rem; padding: 1.5rem 0 3rem; font-size: .9rem; color: var(--ink-2);
}
footer.site p { max-width: var(--measure); margin: .25rem 0; }

/* prose pages */
.prose { max-width: var(--measure); padding: 2rem 0 1rem; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; font-stretch: 125%; line-height: 1; letter-spacing: -0.02em; margin: .5rem 0 1.25rem; }
.prose h2 { margin-top: 2.25rem; }
.prose li { margin: .3rem 0; }
.prose table { border-collapse: collapse; font-size: .92rem; margin: .75rem 0 1.25rem; width: 100%; }
.prose th, .prose td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose code { font-size: .9em; }
.badge-proto { display: inline-block; font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 4px; background: var(--ticket); color: var(--ticket-ink); }

@media (max-width: 600px) {
  .ask { line-height: 2.2; }
  .marks li { grid-template-columns: 1.6rem 3rem 1fr; }
  .multiples { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .ticket { border: 1px solid CanvasText; clip-path: none; } .ticket::before { display: none; } }
