:root {
  color-scheme: light;

  /* Color: neutral */
  --color-bg: #f3f5f7;
  --color-bg-subtle: #e7ecf2;
  --color-surface: #fff;
  --color-text: #111820;
  --color-text-secondary: #3d4957;
  --color-text-muted: #5b6877;
  --color-border: #c8d0da;
  --color-border-strong: #788697;

  /* Color: signal */
  --color-signal: #28466d;
  --color-signal-hover: #203957;
  --color-signal-active: #182b42;
  --color-focus: #416d9f;
  --color-on-signal: #fff;
  --color-signal-subtle: #dce5ef;

  /* Color: dark */
  --color-dark-bg: #101722;
  --color-dark-text: #f2f5f8;
  --color-dark-muted: #aeb9c6;
  --color-dark-brand: #8293a8;
  --color-dark-border: #3a4a5e;
  --color-dark-surface: #172436;
  --color-dark-chapter: #203a5a;
  --color-overlay: rgb(16 23 34 / 65%);

  /* Color: publishing / paper */
  --color-paper: #f6f0e5;
  --color-paper-subtle: #ece3d4;
  --color-ink: #1c1915;
  --color-editorial-muted: #665f54;

  /* Semantic theme */
  --theme-bg: var(--color-bg);
  --theme-bg-subtle: var(--color-bg-subtle);
  --theme-surface: var(--color-surface);
  --theme-text: var(--color-text);
  --theme-text-secondary: var(--color-text-secondary);
  --theme-text-muted: var(--color-text-muted);
  --theme-border: var(--color-border);

  /* Typography */
  --font-display: "Inter Tight", Inter, Arial, sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-data: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --type-display-xl: clamp(4.5rem, 2rem + 10vw, 10rem);
  --type-display-l: clamp(3.5rem, 1.75rem + 7vw, 7.5rem);
  --type-h1: clamp(2.5rem, 1.5rem + 3.5vw, 4.5rem);
  --type-h2: clamp(2rem, 1.4rem + 2.2vw, 3.5rem);
  --type-h3: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  --type-body-l: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --type-body: 1rem;
  --type-small: 0.875rem;
  --type-caption: 0.75rem;
  --type-label: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --type-data: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --type-ja-display-max: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem);
  --tracking-en-display: 0.025em;
  --tracking-en-hero: 0.064em;
  --tracking-en-label: 0.064em;
  --tracking-en-action: 0.1em;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Layout / grid */
  --container-max: 90rem;
  --container-wide: 80rem;
  --container-content: 70rem;
  --container-reading: 45rem;
  --container-narrow: 35rem;
  --grid-columns: 4;
  --grid-gutter: var(--space-4);
  --page-padding: var(--space-6);
  --header-height: 3.5rem;

  /* Breakpoints: media queries use the matching literal values. */
  --breakpoint-compact: 30rem;
  --breakpoint-tablet: 48rem;
  --breakpoint-desktop: 64rem;
  --breakpoint-wide: 90rem;

  /* Border / radius / shadow */
  --border-none: 0;
  --border-hairline: 1px;
  --border-emphasis: 2px;
  --radius-0: 0;
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 999px;
  --shadow-none: none;
  --shadow-low: 0 1px 2px rgb(17 24 32 / 8%);
  --shadow-medium: 0 8px 24px rgb(17 24 32 / 10%);
  --shadow-float: 0 20px 56px rgb(17 24 32 / 14%);

  /* Icon */
  --icon-sm: 1rem;
  --icon-md: 1.25rem;
  --icon-lg: 1.5rem;
  --icon-stroke: 1.5px;

  /* Motion */
  --duration-fast: 120ms;
  --duration-normal: 240ms;
  --duration-slow: 600ms;
  --duration-hero: 800ms;
  --duration-page-title-fill: 1400ms;
  --easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --easing-enter: cubic-bezier(0, 0, 0.2, 1);
  --easing-exit: cubic-bezier(0.4, 0, 1, 1);

  /* z-index / layer */
  --layer-base: 0;
  --layer-rail: 10;
  --layer-sticky: 100;
  --layer-overlay: 200;
  --layer-modal: 300;
  --layer-toast: 400;
}

[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: var(--color-dark-bg);
  --theme-bg-subtle: var(--color-dark-surface);
  --theme-surface: var(--color-dark-surface);
  --theme-text: var(--color-dark-text);
  --theme-text-secondary: var(--color-dark-muted);
  --theme-text-muted: var(--color-dark-muted);
  --theme-border: var(--color-dark-border);
}

@media (min-width: 48rem) {
  :root {
    --grid-columns: 8;
    --grid-gutter: var(--space-6);
    --page-padding: var(--space-10);
    --header-height: 4rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --grid-columns: 12;
    --grid-gutter: var(--space-8);
    --page-padding: var(--space-16);
    --header-height: 4.5rem;
  }
}

@media (min-width: 90rem) {
  :root {
    --page-padding: var(--space-20);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 1ms;
    --duration-normal: 1ms;
    --duration-slow: 1ms;
    --duration-hero: 1ms;
    --duration-page-title-fill: 1ms;
  }
}
