@import url("/styles/tokens.css");

/* =========================================================================
   Sublime Pantry — base stylesheet.

   One accent colour (--brand), one display face (Bodoni Moda Variable), one body
   face (Source Sans 3). No gradients, no custom scrollbars, no ::selection
   styling, no lift/spring transitions. Every colour in the codebase is
   defined here as a token; nothing outside this file may use a hex literal.
   ========================================================================= */

/* --- Fonts ------------------------------------------------------------- */
@font-face{font-family:"Bodoni Moda Variable";font-style:normal;font-weight:400 900;font-display:swap;src:url("/fonts/bodoni-moda-variable-latin.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:"Bodoni Moda Variable";font-style:normal;font-weight:400 900;font-display:swap;src:url("/fonts/bodoni-moda-variable-latin-ext.woff2") format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:400 700;font-display:swap;src:url("/fonts/source-sans-3-latin-normal.woff2") format("woff2");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:"Source Sans 3";font-style:normal;font-weight:400 700;font-display:swap;src:url("/fonts/source-sans-3-latin-ext-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Sans 3";font-style:italic;font-weight:400 700;font-display:swap;src:url("/fonts/source-sans-3-latin-italic.woff2") format("woff2");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:"Source Sans 3";font-style:italic;font-weight:400 700;font-display:swap;src:url("/fonts/source-sans-3-latin-ext-italic.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

/* --- Tokens ------------------------------------------------------------ */
:root {
  /* color */
  --paper: var(--color-semantic-surface);
  --surface: var(--color-semantic-raised);
  --mist: var(--color-semantic-border);
  --ink: var(--color-semantic-text);
  --ink-soft: var(--color-semantic-muted);
  --brand: var(--color-semantic-action);
  --brand-hover: var(--color-semantic-actionHover);
  --brand-tint: var(--color-semantic-rustSoft);
  --ok: var(--color-semantic-success);
  --info-bg: var(--color-brand-ice);
  --info-line: var(--color-semantic-info);
  /* The logo's pale blue. LOGO ONLY — the mark's own ground. Permitted: the
     SP offset edge, and the header brand block, where the plate IS the
     artwork's background rather than a surface we chose. Never text, never a
     border, never a section background: ~1.4:1 on --paper. If you are reaching
     for this to tint a surface, use --brand-tint, or --info-bg for a cool one.
     (The previous version of this note pointed at "--ice" and an "Ice
     section". Neither has ever existed in this file.) */
  --logo-frost: var(--color-brand-ice);

  /* type */
  --font-display: var(--font-family-display);
  --font-body: var(--font-family-body);
  --font-mono: ui-monospace, Menlo, monospace;

  /* scale */
  --text-body: 1.0625rem;
  --lh-body: 1.6;
  --h1: clamp(2.4rem, 5vw, 3.6rem);
  --h2: clamp(1.6rem, 3vw, 2.2rem);
  --h3: 1.3rem;
  --kicker: 0.78rem;
  --price: 1.35rem;

  /* layout */
  --measure: var(--size-measure);
  --wrap: var(--size-content);
  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2rem; --s5: 3rem; --s6: 4rem; --s7: 5rem;
  --radius: var(--radius-panel);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  font-optical-sizing: auto;
}

img, svg, video { max-width: 100%; }

/* `hidden` must win over any display rule we set on the same element. */
[hidden] { display: none !important; }

/* Until the Storefront runtime upgrades <shopify-cart>, it is an unknown
   element and its slot content would render as loose text at the end of the
   page. Keep it out of the document until it is a real dialog. */
shopify-cart:not(:defined) { display: none; }
img, video { height: auto; }

/* --- Accessibility utilities ------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s2); top: -3rem; z-index: 100;
  padding: .6rem 1rem; border-radius: var(--radius);
  background: var(--brand); color: var(--surface);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Body scroll lock, set while an overlay (nav drawer, search) is open. */
.sp-locked, .sp-locked body { overflow: hidden; }

/* --- Layout ------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s3); }
.prose { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--s3); }
.stack > * + * { margin-top: var(--s3); }

section.module { padding-block: var(--s5); }
@media (min-width: 900px) { section.module { padding-block: var(--s6); } }

.section-head {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  align-items: baseline; justify-content: space-between;
  margin-bottom: var(--s3);
}
.section-head h2 { margin: 0; }

/* --- Typography -------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 550; font-optical-sizing: auto; }
h1 { font-size: clamp(2.75rem, 7vw, 5.75rem); line-height: .96; letter-spacing: -.025em; margin: 0 0 var(--s3); text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.05; }
h2 { font-size: var(--h2); line-height: 1.15; margin: var(--s5) 0 var(--s2); }
h3 { font-size: var(--h3); line-height: 1.25; margin: var(--s4) 0 var(--s1); }
h4 { font-size: 1.1rem; line-height: 1.3; margin: var(--s3) 0 var(--s1); }

p { margin: 0 0 var(--s2); }

.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink-soft); max-width: 60ch; }

.kicker {
  display: block;
  font-family: var(--font-body);
  font-size: var(--kicker);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand);
  margin-bottom: var(--s1);
}

.meta { font-size: .88rem; color: var(--ink-soft); margin: 0; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

strong { font-weight: 700; }
em { font-style: italic; }

ul, ol { margin: 0 0 var(--s2); padding-left: 1.3rem; }
li { margin: var(--s1) 0; }

blockquote {
  margin: var(--s3) 0; padding-left: var(--s3);
  border-left: 3px solid var(--mist); color: var(--ink-soft);
}

code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }

hr { border: 0; border-top: 1px solid var(--mist); margin: var(--s5) 0; }

/* Padding rather than a min-height + flex box: `display: flex` on a <summary>
   drops the disclosure marker in Chromium. */
summary { padding-block: .6rem; }

figure { margin: var(--s4) 0; }
figcaption { font-size: .88rem; color: var(--ink-soft); margin-top: var(--s1); }

/* --- Tables ------------------------------------------------------------ */
.table-scroll {
  overflow-x: auto;
  margin: var(--s3) 0;
  box-shadow: inset -12px 0 12px -12px rgba(34, 29, 25, .28);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  font-variant-numeric: tabular-nums;
  text-align: left;
  padding: .65rem .8rem;
  border: 1px solid var(--mist);
  vertical-align: top;
}
thead th, th[scope="col"] {
  background: var(--brand-tint);
  color: var(--ink);
  font-weight: 600;
}
caption { caption-side: bottom; font-size: .88rem; color: var(--ink-soft); padding-top: var(--s1); text-align: left; }

/* The row label is the only thing that says which criterion a value belongs to.
   In a table wider than the screen it is the first thing to scroll away, which
   leaves the reader looking at "$2,395 [1]" with nothing to attach it to. */
.table-scroll th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  box-shadow: inset -1px 0 0 var(--mist);
}

/* The inset edge shadow was the only signal that a table continued off-screen.
   Say it. Hidden with the table wherever cards replace it. */
.table-cue {
  margin: calc(-1 * var(--s2)) 0 var(--s3);
  font-size: .88rem;
  color: var(--ink-soft);
}

/* The same comparison as one card per model. Generated from the table in
   `polishTables`, so the figures cannot drift; exactly one of the two is in the
   document at any width, which keeps them out of the accessibility tree in
   pairs. Shown below 44rem — a phone, and a 1280px desktop at 200% zoom. */
.table-cards { display: none; }
.table-card-list { list-style: none; margin: var(--s3) 0 var(--s1); padding: 0; display: grid; gap: var(--s2); }
.table-card {
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s2);
}
.table-card-name { margin: 0 0 var(--s1); font-weight: 600; font-size: 1.05rem; }
.table-card-specs { margin: 0; }
.table-card-specs dt {
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: var(--s1);
}
.table-card-specs dd { margin: .15rem 0 0; font-variant-numeric: tabular-nums; }
.table-cards-caption { font-size: .88rem; color: var(--ink-soft); margin: var(--s1) 0 var(--s3); }

@media (max-width: 44rem) {
  .table-scroll.has-cards,
  .table-scroll.has-cards + .table-cue { display: none; }
  .table-cards { display: block; }
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px;
  padding: .8rem 1.5rem;
  border-radius: var(--radius-control);
  font: 600 1rem var(--font-body);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms linear, color 150ms linear, border-color 150ms linear;
}
.btn-primary { background: var(--brand); color: var(--surface); }
.btn-primary:hover { background: var(--brand-hover); color: var(--surface); }
.btn-secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--brand-tint); color: var(--ink); }
.btn-text {
  display: inline-flex; align-items: center;
  border: 0; padding: 0; min-height: 44px; background: none;
  color: var(--brand); text-decoration: underline; text-underline-offset: 3px;
}
/* Inside prose a .btn-text is running text, not a control — no 44px box. */
p .btn-text, li .btn-text { display: inline; min-height: 0; }
.btn-text::after { content: " \2192"; }
.btn-text:hover { color: var(--brand-hover); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* --- Cards ------------------------------------------------------------- */
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--ink);
  border-radius: 0;
  overflow: hidden;
  transition: box-shadow 150ms linear;
}
.card:hover { box-shadow: none; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--s3);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- Notices ----------------------------------------------------------- */
.notice {
  background: var(--info-bg);
  border: 1px solid var(--info-line);
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  margin: var(--s3) 0;
}
.notice > :last-child { margin-bottom: 0; }

/* A correction is not an explainer. Same frame, the one accent on the rule, so a
   reader scanning a page cannot mistake a retracted claim for methodology. */
.notice-correction {
  background: var(--brand-tint);
  border-color: var(--brand);
}

/* --- Forms ------------------------------------------------------------- */
label { font-weight: 600; }

input[type="email"], input[type="text"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%;
  min-height: 44px;
  padding: .6rem .7rem;
  font: 400 1rem var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--mist);
  border-radius: var(--radius-control);
}
input[type="checkbox"] { min-width: 22px; min-height: 22px; accent-color: var(--brand); }
/* The label is the tap target for a checkbox, so it carries the 44px. */
label:has(> input[type="checkbox"]) { display: flex; min-height: 44px; align-items: center; }

/* --- Article body ------------------------------------------------------ */
.article-body > p, .article-body > ul, .article-body > ol { max-width: var(--measure); }
.article-body h2 { scroll-margin-top: var(--s7); }
.article-body table { font-size: .95rem; }
/* Diagram labels are drawn as small as 9px inside a 920-wide viewBox, so a
   diagram scaled to fit a phone renders them at under 4px. The figure keeps its
   drawn size and the wrapper scrolls instead — `.table-scroll` already gives
   that wrapper a keyboard focus stop and a name from the SVG's own <title>.
   Every diagram also carries a <desc> and a figcaption, which is the equivalent
   text for anyone who cannot use the picture at any size. */
.article-body .diagram-figure svg { display: block; width: 100%; height: auto; min-width: 57.5rem; }

.disclosure-line {
  margin: var(--s4) 0;
  padding-top: var(--s2);
  border-top: 1px solid var(--mist);
  font-size: .9rem;
  color: var(--ink-soft);
}

/* --- Motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print ------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .newsletter, shopify-cart, .breadcrumbs { display: none !important; }
  body { background: #fff; }
  a { text-decoration: none; color: inherit; }
}
