/* ==========================================================================
   PAVILEON — Design Tokens (Phase 02 draft)
   Source of truth: docs/PHASE01_PLAN.md §III (Concept C "Nocturne / Paper")
   These values will later move into the Shopify theme settings / CSS.
   ========================================================================== */

:root {
  /* ---- Colour: brand palette (Brand Report v1.2) ----------------------- */
  --pav-ink:      #121212; /* Night surface · text on Paper   (16.5:1 on bone) */
  --pav-bone:     #F3F0EA; /* Paper surface · text on Night                     */
  --pav-charcoal: #31302F; /* secondary surface on Night                        */
  --pav-stone:    #D5CFC5; /* hairlines on Paper · secondary text on Night      */
  --pav-oxblood:  #4C2228; /* accent, Paper only, ≤2% of a screen               */

  /* ---- Colour: functional additions (plan §III.1) ---------------------- */
  --pav-ash:   #6B6762; /* muted text on Paper  (4.9:1)  */
  --pav-fog:   #8C8781; /* muted text on Night  (5.3:1)  */
  --pav-alert: #8F2620; /* form errors only     (7.5:1 on bone) */

  /* ---- Typography ------------------------------------------------------ */
  /* Neue Haas Grotesk is the recommended licensed face (not yet purchased).
     Until then the stack falls back to Helvetica (macOS/iOS) / Arial (Windows). */
  --pav-font-text:    "Neue Haas Grotesk Text", "Helvetica Neue", Helvetica, Arial, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --pav-font-display: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --pav-weight-regular: 400;
  --pav-weight-medium:  500;

  --pav-size-display: clamp(2.5rem, 1.6rem + 4.5vw, 6rem);    /* 40 → 96 */
  --pav-size-h1:      clamp(2rem, 1.6rem + 2vw, 3rem);        /* 32 → 48 */
  --pav-size-h2:      clamp(1.5rem, 1.3rem + 1vw, 2rem);      /* 24 → 32 */
  --pav-size-h3:      clamp(1.125rem, 1.08rem + 0.25vw, 1.25rem); /* 18 → 20 */
  --pav-size-body:    clamp(0.9375rem, 0.92rem + 0.1vw, 1rem); /* 15 → 16 */
  --pav-size-small:   clamp(0.8125rem, 0.8rem + 0.1vw, 0.875rem); /* 13 → 14 */
  --pav-size-label:   clamp(0.6875rem, 0.67rem + 0.1vw, 0.75rem); /* 11 → 12 */
  --pav-size-input:   1rem; /* never below 16px — prevents iOS zoom on focus */

  --pav-leading-display: 1.0;
  --pav-leading-heading: 1.2;
  --pav-leading-body:    1.55;
  --pav-tracking-display: -0.02em;
  --pav-tracking-label:    0.08em;

  /* ---- Spacing (4px base) --------------------------------------------- */
  --pav-space-1: 4px;   --pav-space-2: 8px;   --pav-space-3: 12px;
  --pav-space-4: 16px;  --pav-space-5: 24px;  --pav-space-6: 32px;
  --pav-space-7: 48px;  --pav-space-8: 64px;  --pav-space-9: 96px;
  --pav-space-10: 128px; --pav-space-11: 192px;

  /* ---- Grid ------------------------------------------------------------ */
  --pav-columns: 4;  --pav-margin: 16px; --pav-gutter: 12px;
  --pav-measure: 72ch;
  --pav-touch-target: 44px;

  /* ---- Motion ---------------------------------------------------------- */
  --pav-ease:      cubic-bezier(0.2, 0, 0, 1);
  --pav-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --pav-dur-fast:  120ms;
  --pav-dur-base:  200ms;
  --pav-dur-slow:  320ms;
  --pav-dur-image: 600ms;

  /* ---- Header ---------------------------------------------------------- */
  --pav-header-h: 56px;
  --pav-header-enter: 200ms;   /* S0 → S1 (prototype compares 160 / 200 / 240) */
  --pav-header-leave: 240ms;   /* S1 → S0 */
  --pav-header-intent: 150ms;  /* grace period before returning to transparent */
  --pav-header-hide: 240ms;    /* sticky hide / reveal */
}

@media (min-width: 750px) {
  :root { --pav-columns: 8; --pav-margin: 24px; --pav-gutter: 16px; }
}
@media (min-width: 990px) {
  :root { --pav-header-h: 64px; }
}
@media (min-width: 1200px) {
  :root { --pav-columns: 12; --pav-margin: 40px; --pav-gutter: 20px; }
}
@media (min-width: 1600px) {
  :root { --pav-margin: 64px; --pav-gutter: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --pav-dur-fast: 0ms; --pav-dur-base: 0ms; --pav-dur-slow: 0ms; --pav-dur-image: 0ms;
    --pav-header-enter: 0ms; --pav-header-leave: 0ms; --pav-header-intent: 0ms; --pav-header-hide: 0ms;
  }
}

/* ---- Colour schemes: every section picks exactly one ------------------ */
.scheme-night {
  --bg: var(--pav-ink);   --fg: var(--pav-bone);  --muted: var(--pav-fog);
  --line: var(--pav-charcoal); --accent: var(--pav-stone);
  background-color: var(--bg); color: var(--fg);
}
.scheme-paper {
  --bg: var(--pav-bone);  --fg: var(--pav-ink);   --muted: var(--pav-ash);
  --line: var(--pav-stone);    --accent: var(--pav-oxblood);
  background-color: var(--bg); color: var(--fg);
}
