/* ============================================================
   SITE SHELL — core tokens, resets, layout primitives,
   typography. Shared by every page that opts in via .site-shell
   (home, products, cart, checkout, profile-management). Keeps
   the design system in one place instead of re-declaring tokens
   and `.wrap`/`.section`/headings on every page.
   ============================================================ */

.site-shell {
  --white: #ffffff;
  --paper: #f1edea;
  --mist: #ebe6e1;
  --ink: #3d7d82;
  --ink-2: #346b6f;
  --ink-line: #67acb1;
  --text: #1c1a17;
  --text-2: #6e6258;
  --on-ink: #ffffff;
  --on-ink-2: #ffffff;
  --line: #ddd3cb;
  --taupe: #baaa9e;
  --taupe-2: #a8998e;
  --ink-text: #326b6f;
  --heading: #837466;
  --field: #3d7d82;
  --field-2: #346b6f;
  --on-field: #ffffff;
  --on-field-2: #ffffff;
  --field-line: #67acb1;
  --error: #a3172b;

  --font-sans: "Figtree", "Manrope", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Inconsolata", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --grid-gap: clamp(24px, 4vw, 72px);
  --section: clamp(64px, 9vw, 128px);
  --section-tight: calc(clamp(64px, 9vw, 128px) * 0.6);

  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5625;
}

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

.site-shell img {
  display: block;
  max-width: 100%;
}

/* Guard against components that set their own `display` (e.g. .pill,
   .btn) silently overriding the native `hidden` attribute — author
   rules otherwise beat the user-agent's `[hidden] { display: none }`
   regardless of specificity. */
.site-shell [hidden] {
  display: none !important;
}

.site-shell h1,
.site-shell h2,
.site-shell h3,
.site-shell p {
  margin: 0;
}

.site-shell :where(a:not(.btn)) {
  color: inherit;
}

/* The skip link sits before .site-shell in every view, so it is styled unscoped. */
.skip {
  position: fixed;
  left: -999px;
  top: 0;
  z-index: 999;
  background: var(--ink, #3d7d82);
  color: var(--on-ink, #ffffff);
  padding: 12px 18px;
  border-radius: 0;
  font: 500 0.875rem/1.2 "Figtree", "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
}

.skip:focus {
  left: 0;
  outline: 2px solid #baaa9e;
  outline-offset: -4px;
}

/* Keyboard focus and in-page jumps stop clear of the fixed header above and the sticky buy bar below. */
html:has(.site-shell) {
  scroll-padding-bottom: 96px;
}

/* In-page targets land below the fixed header. */
.site-shell [id] {
  scroll-margin-top: 92px;
}

.site-shell :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--taupe);
}

.site-shell .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;
}

/* ---------- Layout primitives ---------- */

.site-shell .wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-shell .section {
  padding-block: var(--section);
}

.site-shell .section--tight {
  padding-block: var(--section-tight);
}

/* The header is `position: fixed` (see css/shared/header.css)
   so every page except the home hero needs to clear its height itself —
   apply this to whichever top-level section/main sits directly under it. */
.site-shell .section.page-top,
.site-shell .section--tight.page-top {
  padding-top: 96px;
}

@media (max-width: 820px) {
  .site-shell .section.page-top,
  .site-shell .section--tight.page-top {
    padding-top: 84px;
  }
}

/* ---------- Typography ---------- */

/* Large headings take the taupe heading colour (3.9:1, large text only). The hero
   sets its own white over footage. */
.site-shell .h-display {
  color: var(--heading);
  font: 600 clamp(2.25rem, 4.6vw, 3.75rem)/1.04 var(--font-sans);
  letter-spacing: -0.025em;
  max-width: 14ch;
}

.site-shell .h-2 {
  color: var(--heading);
  font: 600 clamp(1.875rem, 3.1vw, 2.75rem)/1.08 var(--font-sans);
  letter-spacing: -0.02em;
}

.site-shell .h-3 {
  font: 600 clamp(1.25rem, 1.6vw, 1.5rem)/1.2 var(--font-sans);
  letter-spacing: -0.015em;
}

.site-shell .lede {
  font: 400 clamp(1.0625rem, 1.25vw, 1.1875rem)/1.55 var(--font-sans);
  color: var(--text-2);
  max-width: 58ch;
}

/* A lede that sits straight under its heading (no flex gap from the parent) needs its own breathing room. */
.site-shell .wrap > .h-2 + .lede,
.site-shell .reviews-head .h-2 + .lede {
  margin-top: 12px;
}

.site-shell .note {
  font: 400 0.8125rem/1.45 var(--font-sans);
  color: var(--text-2);
}

/* The highlighted phrase is coloured text, never a filled box. On light grounds it is
   deep spruce (5.2:1 on paper). Taupe text only works over dark footage (the hero); on spruce
   (2.1:1) and paper (1.9:1) it fails, so on spruce fields it turns white with a taupe underline. */
.site-shell .hl {
  color: var(--ink-text);
}

.site-shell .hero .hl {
  color: var(--taupe);
  white-space: nowrap;
}

.site-shell .err-title .hl,
.site-shell .auth-visual__heading .hl {
  color: var(--on-field);
  text-decoration: underline;
  text-decoration-color: var(--taupe);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.site-shell .crumb {
  margin: 0 0 clamp(16px, 2vw, 28px);
  font: 400 0.8125rem/1.3 var(--font-sans);
  color: var(--text-2);
}

.site-shell .crumb a {
  text-decoration: none;
}

.site-shell .crumb a:hover {
  text-decoration: underline;
}

.site-shell .crumb span {
  margin: 0 6px;
}

.site-shell .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--taupe);
  color: var(--text);
  font: 600 0.6875rem/1.2 var(--font-sans);
  text-transform: uppercase;
  border-radius: 0;
  padding: 5px 9px;
  z-index: 1;
}

/* "Most popular": spruce with white text, the one filled tag on a selection grid. */
.site-shell .badge.badge--sky,
.site-shell .pill.pill--sky {
  background: var(--ink);
  color: var(--on-ink);
}
