/* ============================================================
   KSHN Pouch Co. — Design System: tokens, reset, type, layout
   ============================================================ */

/* Brand typefaces (Guidelines V0.3): BLT-Heirloom Bold (display) + Calder Dark
   (body). Self-hosted WOFF2, preloaded in the public layout <head>. Single
   weight each — bold body emphasis is synthesized by the browser. */
@font-face {
  font-family: 'BLT-Heirloom';
  src: url('/fonts/BLT-Heirloom-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Calder Dark';
  src: url('/fonts/Calder-Dark.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  /* colours (palette, neutrals, sky/sunset/flavor gradients, elevation
     shadows) live in tokens.css, the CMS-editable set; see lib/cms/colors.json */

  /* --- Type (brand: BLT-Heirloom Bold headers · Calder Dark body) --- */
  --display: 'BLT-Heirloom', system-ui, sans-serif;
  --body: 'Calder Dark', system-ui, sans-serif;

  /* --- Radius --- */
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-shelf: 44px;     /* rounded section "shelf" tops */
  --r-pill: 999px;
  --r-btn: 14px;       /* buttons/controls: rounded-rect, not pill */

  /* --- Spacing rhythm --- */
  --pad-x: clamp(20px, 5vw, 80px);
  --sect-y: clamp(64px, 9vw, 140px);

  --maxw: 1240px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--page-bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Type scale ---------- */
h1, h2, h3, h4, .h1, .h2, .h3, .display {
  /* Title Case, per the brand direction that every word in a header starts
     capitalised. `capitalize` only touches the first letter of each word, so
     copy already stored in caps is left alone. Note it capitalises small words
     too ("A", "Of", "The") — that is the literal rule we were given. */
  text-transform: capitalize;
}
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 6.2rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.h1 { font-size: clamp(2.1rem, 5.6vw, 4rem); }
.h2 { font-size: clamp(1.8rem, 4.4vw, 3rem); }
.h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); }
.lead {
  font-size: clamp(1.08rem, 1.7vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 500;
  text-wrap: pretty;
}
p { text-wrap: pretty; }

.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  color: var(--burnt);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--flavor, var(--sunset-warm));
  border-radius: 2px;
}
/* Client: remove the little dash/pill kicker labels ("eyebrows") throughout —
   they read as generic/AI. Hidden globally; markup kept so it's easily reversible. */
.eyebrow { display: none !important; }
.tm { font-size: 0.6em; vertical-align: super; font-weight: 600; opacity: .8; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--sect-y); }
.stack { display: flex; flex-direction: column; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }

/* Rounded "shelf" — a section that overlaps the previous with a soft top */
.shelf {
  border-top-left-radius: var(--r-shelf);
  border-top-right-radius: var(--r-shelf);
  margin-top: calc(var(--r-shelf) * -1);
  position: relative;
  z-index: 2;
}

/* Gradient text */
.grad-text {
  background: var(--sunset-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.flavor-text {
  background: var(--flavor);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Reveal-on-scroll (RISE) ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-l { opacity: 0; transform: translateX(-24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-r { opacity: 0; transform: translateX(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in, .reveal-l.in, .reveal-r.in { opacity: 1; transform: none; }
.reveal.d1, .reveal-l.d1, .reveal-r.d1 { transition-delay: .08s; }
.reveal.d2, .reveal-l.d2, .reveal-r.d2 { transition-delay: .16s; }
.reveal.d3, .reveal-l.d3, .reveal-r.d3 { transition-delay: .24s; }
.reveal.d4, .reveal-l.d4, .reveal-r.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-l, .reveal-r { opacity: 1 !important; transform: none !important; transition: none; }
}

/* Sharp editorial block — the "Swiss rule" half of the shape grammar
   (sharp blocks vs pill controls) */
.edge { border-radius: 0; border: 1px solid var(--line); }

/* below-the-fold sections skip layout/paint until approached
   (NOT for pinned/sticky sections — it breaks the pin) */
.cv-auto { content-visibility: auto; contain-intrinsic-size: auto 640px; }

/* ---------- Image placeholders (aspect-correct) ---------- */
.ph {
  position: relative;
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(135deg, rgb(var(--shadow-color-rgb) / .035) 0 12px, transparent 12px 24px),
    var(--flavor-soft, var(--paper-2));
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.ph[data-dark] {
  background:
    repeating-linear-gradient(135deg, rgb(var(--glass-color-rgb) / .05) 0 12px, transparent 12px 24px),
    rgb(var(--glass-color-rgb) / .04);
  border-color: var(--line-dark);
}
.ph .ph-label {
  font-family: var(--body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--glass-color) 72%, transparent);
  padding: .35em .7em;
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
}
.ph[data-dark] .ph-label { color: color-mix(in srgb, var(--glass-color) 82%, transparent); background: color-mix(in srgb, var(--glass-color) 8%, transparent); }
.r-1x1 { aspect-ratio: 1 / 1; }
.r-2x3 { aspect-ratio: 2 / 3; }
.r-3x2 { aspect-ratio: 3 / 2; }
.r-4x3 { aspect-ratio: 4 / 3; }
.r-16x9 { aspect-ratio: 16 / 9; }

/* Swatch row (flavor gradient stops) */
.swatches { display: flex; gap: 5px; }
.swatches i { width: 16px; height: 16px; border-radius: 5px; display: block; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shadow-color) 6%, transparent); }

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

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }

/* remove the mobile double-tap-zoom delay on every interactive element */
a, button, input, select, textarea, [role="button"] { touch-action: manipulation; }
