/* Shared design tokens and document defaults for every page. */
:root {
  color-scheme: light;
  --color-paper: #f8f9f9;
  --color-paper-soft: #f6f9fc;
  --color-surface: #fff;
  --color-section-mist: #f8fafc;
  --color-tint: #edf3f8;
  --color-ink: #364246;
  --color-muted: #5f6c72;
  --color-accent: #1994d6;
  --color-accent-text: #0874ac;
  --color-line: #dbe4ea;
  --background-section-white:
    radial-gradient(ellipse 95% 115% at 88% 25%, rgb(214 232 245 / 38%), transparent 72%),
    linear-gradient(180deg, #fff, #fbfdff);
  --background-section-blue:
    radial-gradient(ellipse 100% 120% at 12% 70%, rgb(214 232 245 / 35%), transparent 72%),
    linear-gradient(180deg, #f1f7fc, #f6faff);
  --background-section-paper:
    radial-gradient(ellipse 110% 125% at 75% 80%, rgb(214 228 240 / 32%), transparent 72%),
    linear-gradient(180deg, #f9fafb, #f4f7fa);
  --font-body: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-display: "Urbanist", var(--font-body);
  --font-mono: "JetBrains Mono", var(--font-body), ui-monospace, monospace;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --text-caption: 0.625rem;
  --text-label: 0.75rem;
  --text-card-title: 1.5rem;
  --text-evidence-title: 0.9375rem;
  --text-intro: 0.9375rem;
  --text-detail: 0.875rem;
  --text-page-title: clamp(1.75rem, 3.5vw, 3rem);
  --text-page-title-large: clamp(1.875rem, 4vw, 3.5rem);
  --text-hero-title: clamp(2.125rem, 4.2vw, 3.75rem);
  --text-stat: 2rem;
  --text-stat-light: 2.25rem;
  --text-stat-large: clamp(1.75rem, 3vw, 2.5rem);
  --leading-title: 1.3;
  --leading-title-large: 1.28;
  --leading-compact: 1.6;
  --leading-section: 1.35;
  --leading-body: 1.8;
  --leading-detail: 1.9;
  --tracking-body: 0.04em;
  --tracking-title: 0.06em;
  --tracking-label: 0.1em;
  --tracking-eyebrow: 0.22em;
  --tracking-stat: -0.02em;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --text-small: 0.8125rem;
  --text-body: 1rem;
  --text-title: clamp(1.75rem, 3vw, 2.75rem);
  --radius-small: 0.5rem;
  --radius: 1rem;
  --shadow: 0 1.5rem 3.5rem rgb(54 66 70 / 8%);
  --content-width: 87.5rem;
  --gutter: clamp(1.25rem, 4vw, 3.75rem);
  --header-height: 5.5rem;
  --sticky-header-offset: var(--header-height);
  --section-nav-height: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
}

html:has(.section-nav) {
  scroll-padding-top: calc(var(--sticky-header-offset) + var(--section-nav-height) + 1.5rem);
}

@media (max-width: 79.999rem) {
  :root {
    --header-height: 4.5rem;
  }
}

@media (max-width: 74.999rem) {
  :root {
    --sticky-header-offset: 0rem;
  }
}

@media (max-width: 64rem) {
  :root {
    --section-nav-height: 5.25rem;
  }
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* The head script sets this only while applying initial Japanese text. */
html[data-language-pending] body {
  visibility: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  line-height: var(--leading-title);
  text-wrap: pretty;
}

h2 {
  font-size: var(--text-title);
  line-height: var(--leading-section);
  letter-spacing: var(--tracking-title);
}

h3 {
  font-size: 1.25rem;
}

strong,
b {
  font-weight: var(--weight-bold);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-weight: var(--weight-regular);
}

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

a:hover {
  color: var(--color-accent-text);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
summary {
  font: inherit;
}

summary {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--color-accent-text);
  outline-offset: 5px;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
