/* ==========================================================================
   MIKOTO ACADEMY — tokens.css
   Design tokens, reset, typography scale and the 3 THEME VARIATIONS.
   Load order: tokens.css -> layout.css -> components.css
   ==========================================================================

   THEME VARIATIONS (Tweaks panel, persisted in localStorage)
   -------------------------------------------------------------------------
   <html data-theme="a">  A / HINOMARU BOLD  — deep navy stage, red accent,
                                             centered hero, kanji watermark
   <html data-theme="b">  B / IVORY EDITORIAL — warm ivory stage, editorial
                                             split hero, thin rules, serif
   <html data-theme="c">  C / KANJI MODERN  — dark charcoal+n navy gradient,
                                             geometric grid hero, big type
   <html data-heading="serif|sans">  headline family switch (extra tweak)
   ========================================================================== */

/* ---------- 1. RAW PALETTE (do not use directly in components) ---------- */
:root {
  --c-ivory-50:  #FDFBF7;
  --c-ivory-100: #F7F2E8;
  --c-ivory-200: #EFE7D8;
  --c-ivory-300: #E2D6C2;
  --c-navy-900:  #0A1730;
  --c-navy-800:  #0F2144;
  --c-navy-700:  #16305F;
  --c-navy-600:  #1E3E7A;
  --c-navy-100:  #E4EAF5;
  --c-red-600:   #C8102E;   /* hinomaru red */
  --c-red-500:   #E01E38;
  --c-red-700:   #9E0B22;
  --c-ink:       #14161C;
  --c-gray-500:  #6B7280;
  --c-gray-300:  #C9CDD6;
  --c-white:     #FFFFFF;

  /* ---------- 2. TYPE ---------- */
  --font-serif: "Shippori Mincho", "Noto Serif JP", "Times New Roman", serif;
  --font-sans:  "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont,
                "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-hero:  clamp(2.6rem, 6.2vw, 5.2rem);
  --fs-h2:    clamp(1.9rem, 3.4vw, 3.1rem);
  --fs-h3:    clamp(1.25rem, 1.8vw, 1.6rem);
  --fs-h4:    clamp(1.05rem, 1.3vw, 1.2rem);
  --fs-body:  clamp(0.98rem, 1.05vw, 1.08rem);
  --fs-small: 0.85rem;
  --fs-eyebrow: 0.74rem;

  --lh-tight: 1.14;
  --lh-snug:  1.35;
  --lh-body:  1.75;
  --ls-wide:  0.16em;
  --ls-kanji: 0.22em;

  /* ---------- 3. SPACE / SHAPE / MOTION ---------- */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
  --space-5: 3.5rem;
  --space-6: 5rem;
  --space-7: 7.5rem;

  --container: 1180px;
  --container-narrow: 820px;
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(10, 23, 48, 0.06);
  --shadow-md: 0 12px 30px rgba(10, 23, 48, 0.10);
  --shadow-lg: 0 26px 60px rgba(10, 23, 48, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.45s;

  --header-h: 78px;
  --rule: 1px solid var(--border);
}

/* ---------- 4. SEMANTIC TOKENS — THEME A: HINOMARU BOLD (default) ------- */
:root,
html[data-theme="a"] {
  color-scheme: light;

  --bg:            var(--c-ivory-100);
  --bg-alt:        var(--c-ivory-50);
  --bg-deep:       var(--c-navy-900);   /* dark stages: hero, CTA band     */
  --bg-deep-alt:   var(--c-navy-800);
  --bg-card:       var(--c-white);
  --bg-tint:       var(--c-ivory-200);

  --text:          var(--c-ink);
  --text-muted:    var(--c-gray-500);
  --text-on-deep:  var(--c-ivory-50);
  --text-on-deep-muted: rgba(247, 242, 232, 0.72);

  --brand:         var(--c-navy-800);
  --brand-strong:  var(--c-navy-900);
  --accent:        var(--c-red-600);
  --accent-strong: var(--c-red-700);
  --accent-soft:   rgba(200, 16, 46, 0.10);

  --border:        rgba(10, 23, 48, 0.13);
  --border-on-deep: rgba(247, 242, 232, 0.22);

  --hero-text:     var(--c-ivory-50);
  --hero-panel:    rgba(10, 23, 48, 0.55);

  --font-display:  var(--font-serif);
  --display-weight: 600;
  --hero-align:    center;
  --section-align: left;
  --kanji-opacity: 0.07;

  --gutter: clamp(1.15rem, 4vw, 3rem);
  --section-y: clamp(3.75rem, 8vw, 6.5rem);
}

/* ---------- 5. THEME B: IVORY EDITORIAL ---------- */
html[data-theme="b"] {
  --bg:            var(--c-ivory-50);
  --bg-alt:        var(--c-ivory-100);
  --bg-deep:       var(--c-navy-800);
  --bg-deep-alt:   var(--c-navy-700);
  --bg-card:       #FFFDF9;
  --bg-tint:       var(--c-ivory-200);

  --text:          #1B2233;
  --text-muted:    #6D7385;
  --text-on-deep:  var(--c-ivory-50);
  --text-on-deep-muted: rgba(247, 242, 232, 0.78);

  --brand:         var(--c-navy-700);
  --brand-strong:  var(--c-navy-900);
  --accent:        var(--c-red-600);
  --accent-strong: var(--c-red-700);
  --accent-soft:   rgba(200, 16, 46, 0.08);

  --border:        rgba(27, 34, 51, 0.14);
  --border-on-deep: rgba(247, 242, 232, 0.26);

  --hero-text:     var(--c-ivory-50);
  --hero-panel:    rgba(253, 251, 247, 0.94);

  --font-display:  var(--font-serif);
  --display-weight: 500;
  --hero-align:    left;
  --section-align: left;
  --kanji-opacity: 0.05;

  --shadow-sm: 0 1px 2px rgba(27, 34, 51, 0.05);
  --shadow-md: 0 10px 26px rgba(27, 34, 51, 0.07);
  --shadow-lg: 0 24px 54px rgba(27, 34, 51, 0.12);
  --radius-md: 2px;
  --radius-lg: 3px;
}

/* ---------- 6. THEME C: KANJI MODERN ---------- */
html[data-theme="c"] {
  --bg:            #0C1220;
  --bg-alt:        #0F1728;
  --bg-deep:       #070B14;
  --bg-deep-alt:   #101B33;
  --bg-card:       rgba(255, 255, 255, 0.045);
  --bg-tint:       rgba(255, 255, 255, 0.06);

  --text:          #EDF1F8;
  --text-muted:    #9AA6BE;
  --text-on-deep:  #FFFFFF;
  --text-on-deep-muted: rgba(237, 241, 248, 0.7);

  --brand:         #7FA6FF;
  --brand-strong:  #A8C2FF;
  --accent:        var(--c-red-500);
  --accent-strong: #FF4356;
  --accent-soft:   rgba(224, 30, 56, 0.16);

  --border:        rgba(255, 255, 255, 0.14);
  --border-on-deep: rgba(255, 255, 255, 0.2);

  --hero-text:     #FFFFFF;
  --hero-panel:    rgba(12, 18, 32, 0.68);

  --font-display:  var(--font-sans);
  --display-weight: 800;
  --hero-align:    center;
  --section-align: left;
  --kanji-opacity: 0.13;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
}

/* Extra Tweaks dimension: headline family (independent of theme) */
html[data-heading="sans"] {
  --font-display: var(--font-sans);
  --display-weight: 800;
}

/* ---------- 7. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

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

button, input, select, textarea { font: inherit; color: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

::selection { background: var(--accent); color: #fff; }

/* ---------- 8. UTILITIES ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--alt  { background: var(--bg-alt); }
.section--tint { background: var(--bg-tint); }

.section--deep {
  background:
    radial-gradient(1000px 520px at 12% 0%, var(--bg-deep-alt), transparent 70%),
    var(--bg-deep);
  color: var(--text-on-deep);
}

.section--deep .section-title,
.section--deep h2,
.section--deep h3 { color: var(--text-on-deep); }

.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: -9999px; top: 0; z-index: 999;
  background: var(--accent); color: #fff;
  padding: 0.7rem 1.1rem; border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
