/*
 * Korea 2026 — Trip Theme tokens (compiled from the Art Direction Contract proposal)
 * Trip Companion Studio v2 — tokens.css shape contract.
 * ONLY place theme values live. Components (editorial.css) consume these exclusively.
 */
:root {
  /* ── Palette: ink navy from the night cityscape; warm paper; hanbok rose accent ── */
  --ink: #16233f;
  --ink-soft: #4a5a7d;      /* 5.6:1 on paper */
  --ink-faint: #5d6c8e;     /* captions — AA on paper */
  --paper: #f7f5f0;
  --paper-deep: #ece9e1;
  --accent: #c65f6e;        /* hanbok rose — display accents, rules, bars (non-text or ≥18px) */
  --accent-text: #a84d5c;   /* rose for small text (eyebrows) — 4.97:1 AA */
  --accent-ink: #a84d5c;
  --line: rgba(22, 35, 63, .14);
  --line-strong: rgba(22, 35, 63, .30);
  --scrim: 13, 18, 28;      /* navy-tinted scrim triplet */

  /* ── Type roles: display serif (Nanum Myeongjo class) / quiet sans / tracked meta ── */
  --font-display: "Nanum Myeongjo", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  --font-meta: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cjk-fallback: "Noto Sans KR", "Apple SD Gothic Neo", "Hiragino Sans", sans-serif;

  /* ── Editorial type scale (v2 system defaults) ── */
  --text-hero: clamp(2.75rem, 9vw, 5.5rem);
  --text-h1: clamp(2.25rem, 7vw, 4rem);
  --text-h2: clamp(1.5rem, 4.5vw, 2.5rem);
  --text-h3: clamp(1.15rem, 3vw, 1.5rem);
  --text-lede: clamp(1.1rem, 3.5vw, 1.35rem);
  --text-body: 1rem;
  --text-caption: 0.8125rem;
  --text-eyebrow: 0.6875rem;
  --track-eyebrow: 0.14em;
  --leading-display: 1.06;
  --leading-lede: 1.4;
  --leading-body: 1.58;
  --leading-caption: 1.4;

  /* ── Spacing: generous editorial; dense only in practical sections ── */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --section-gap: var(--space-7);
  --section-gap-immersive: var(--space-8);
  --caption-gap: var(--space-2);

  /* ── Layout ── */
  --gutter: var(--space-4);
  --gutter-wide: var(--space-5);
  --max-text-width: 38em;
  --max-page-width: 720px;
  --max-page-wide: 1080px;

  /* ── Imagery ── */
  --ratio-wide: 16 / 9;
  --ratio-portrait: 4 / 5;
  --ratio-thumb: 1 / 1;
  --thumb-size: 64px;
  --hero-min-height: 74svh;

  /* ── Containers: near-square editorial blocks; cards only where genuine ── */
  --radius-card: 4px;
  --radius-sheet: 14px;
  --card-padding: var(--space-4);
  --card-border: 1px solid var(--line);
  --card-bg: var(--paper);

  /* ── Lines ── */
  --divider: 1px solid var(--line);
  --divider-strong: 2px solid var(--ink);

  /* ── Overlays: navy scrim gradient (validated .46/.68/.93 recipe, theme-tinted) ── */
  --scrim-gradient: linear-gradient(
    to bottom,
    rgba(var(--scrim), 0) 0%,
    rgba(var(--scrim), .46) 46%,
    rgba(var(--scrim), .68) 68%,
    rgba(var(--scrim), .93) 93%
  );
  --shadow-sheet: 0 18px 55px rgba(var(--scrim), .20);

  /* ── Motion: subtle, editorial, reduced-motion aware ── */
  --dur-fast: 150ms; --dur-base: 250ms; --dur-slow: 400ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-editorial: cubic-bezier(.45, .05, .35, .95);

  /* ── Safe areas ── */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --nav-height: 60px;
}

/* Busan chapter variation: coastal sea-slate (scoped custom-property override) */
.chapter-busan { --accent: #3d6b6e; --accent-text: #3d6b6e; --scrim: 10, 24, 30; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 1ms; --dur-base: 1ms; --dur-slow: 1ms; }
}
@media (min-width: 600px) {
  :root { --gutter: var(--gutter-wide); --max-page-width: 760px; }
}