/* Design tokens: the only file with colours and fonts (ThemeTests). DESIGN.md explains them.
   Theme "Crystal night": dark by default, light when the system asks for it or the visitor
   picks it (html[data-theme], set by the server from the theme cookie). */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('/fonts/inter-tight-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Dark: the default. */
:root {
  color-scheme: dark;

  /* Ground: plain black leaning to the bamboo, no glows (Aruto, 2026-10-26). */
  --bg: #070908;

  /* Surfaces, from the window down to the chips. */
  --window: rgba(12, 13, 12, 0.84);
  --window-edge: rgba(255, 255, 255, 0.08);
  --side: rgba(255, 255, 255, 0.02);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-edge: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.1);
  --raised: #101411;
  /* Roadmap cards: a step above the window so a card's inside stands apart from the page. */
  --card: #161c18;
  --field: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Text. */
  --text: #f2f3f0;
  --text-2: #b6b9b2;
  --muted: #8f938b;

  /* Accent: violet for links and active items; bamboo green for buttons and the brand
     mark; pink for small details. */
  --accent: #c4b5fd;
  --accent-solid: #8b5cf6;
  --accent-strong: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.13);
  --accent-edge: rgba(139, 92, 246, 0.4);
  --on-accent: #ffffff;
  --pink: #f9a8d4;
  /* Sky blue: the cool contrast to the violet and the jade (Aruto, 2026-11-02): work in
     progress, the roadmaps, some sidebar icons. */
  --sky: #7dd3fc;
  --sky-soft: rgba(125, 211, 252, 0.12);
  --brand: #4a9e6b;
  --brand-hover: #55ad78;
  --on-brand: #04120a;
  --brand-text: #7cc69a;
  --glow: 0 0 12px rgba(124, 198, 154, 0.26);
  --text-glow: drop-shadow(0 0 12px rgba(124, 198, 154, 0.24));
  --badge-ring: 0 0 0 3px rgba(139, 92, 246, 0.25);

  /* The home scene (_HomeScene): a bamboo grove by a pond under the moon. */
  --hero-sky-top: #0a1430;
  --hero-sky-mid: #0f2a44;
  --hero-sky-low: #174056;
  --hero-moon: #f1f7f2;
  --hero-halo: rgba(150, 210, 240, 0.3);
  --hero-halo-out: rgba(150, 210, 240, 0);
  --hero-ridge-far: #1d3d56;
  --hero-ridge-near: #17334a;
  --hero-mist: rgba(150, 205, 235, 0.1);
  --hero-b1: #245f4c;
  --hero-b2: #2c8650;
  --hero-b3: #2f9a52;
  --hero-shine: rgba(200, 255, 210, 0.22);
  --hero-water: #0f2c40;
  --hero-glint: rgba(200, 235, 255, 0.6);
  --hero-leaf: #7fdc95;
  --hero-firefly: #f9a8d4;
  --hero-firefly-glow: drop-shadow(0 0 6px rgba(249, 168, 212, 0.9));
  --hero-firefly-on: 1;
  --hero-scrim: rgba(8, 18, 30, 0.5);

  /* Status. */
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.1);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.1);
  --danger: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --danger-edge: rgba(248, 113, 113, 0.35);
  --danger-solid: #dc2626;

  /* Depth. */
  --scrim: rgba(4, 5, 4, 0.6);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --bar-dim: rgba(255, 255, 255, 0.14);
  --skeleton: rgba(255, 255, 255, 0.06);
  --skeleton-shine: rgba(255, 255, 255, 0.12);

  /* Developer roadmap areas (ADR-0034 section 2): the border of a done card, at least 3:1
     against --raised (AreaColourTests). */
  --area-architecture: #a99bff;
  --area-server: #7aa2ff;
  --area-rules: #ff7fb0;
  --area-client: #4fd1d1;
  --area-world: #6fd47f;
  --area-content: #c8e04a;
  --area-launcher: #ff9a5c;
  --area-website: #9b9dff;
  --area-art: #ff7a6b;
  --area-wiki: #d4c75a;
  --area-devops: #aab4bf;
  --area-testing: #d9a066;
  --area-modding: #e083f0;
  --area-cluster: #5cc4f0;
  --area-tools: #d8c59a;
  --area-aruto: #ffd24d;
}

/* Light: parchment. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f2e8d5;
    --window: rgba(252, 247, 237, 0.7);
    --window-edge: rgba(255, 252, 245, 0.9);
    --side: rgba(247, 239, 224, 0.75);
    --surface: #fcf7ed;
    --surface-edge: rgba(84, 60, 26, 0.1);
    --surface-2: #efe4cd;
    --surface-3: #e6d7ba;
    --raised: #fdf9f1;
    --card: #fffdf8;
    --field: #fffbf3;
    --line: rgba(84, 60, 26, 0.12);
    --line-strong: rgba(84, 60, 26, 0.22);
    --text: #241b10;
    --text-2: #4d3f2d;
    --muted: #6a5a44;
    --accent: #6d28d9;
    --accent-solid: #6d28d9;
    --accent-strong: #5b21b6;
    --accent-soft: rgba(109, 40, 217, 0.09);
    --accent-edge: rgba(109, 40, 217, 0.3);
    --pink: #be185d;
    --sky: #0369a1;
    --sky-soft: rgba(3, 105, 161, 0.09);
    --brand: #4d9a6a;
    --brand-hover: #448c5f;
    --on-brand: #06140b;
    --brand-text: #2e7550;
    --glow: 0 0 10px rgba(77, 154, 106, 0.22);
    --text-glow: drop-shadow(0 0 8px rgba(77, 154, 106, 0.18));
    --badge-ring: 0 0 0 3px rgba(109, 40, 217, 0.15);
    --ok: #15803d;
    --ok-soft: #e3f6ea;
    --warn: #a16207;
    --warn-soft: #fdf3d7;
    --danger: #b91c1c;
    --danger-soft: #fde6e6;
    --danger-edge: rgba(220, 38, 38, 0.3);
    --scrim: rgba(36, 27, 16, 0.35);
    --shadow-lg: 0 30px 80px rgba(84, 60, 26, 0.2);
    --shadow-md: 0 12px 32px rgba(84, 60, 26, 0.14);
    --shadow-sm: 0 1px 2px rgba(84, 60, 26, 0.07), 0 4px 14px rgba(84, 60, 26, 0.06);
    --bar-dim: rgba(84, 60, 26, 0.16);
    --skeleton: rgba(84, 60, 26, 0.07);
    --skeleton-shine: rgba(84, 60, 26, 0.12);
    --hero-sky-top: #d3e6ee;
    --hero-sky-mid: #e9e6d6;
    --hero-sky-low: #f2e8d5;
    --hero-moon: #fbf4e2;
    --hero-halo: rgba(255, 244, 220, 0.85);
    --hero-halo-out: rgba(255, 244, 220, 0);
    --hero-ridge-far: rgba(70, 120, 150, 0.2);
    --hero-ridge-near: rgba(60, 112, 110, 0.22);
    --hero-mist: rgba(252, 247, 236, 0.7);
    --hero-b1: rgba(80, 150, 100, 0.38);
    --hero-b2: rgba(58, 150, 78, 0.7);
    --hero-b3: #3c9a4f;
    --hero-shine: rgba(255, 255, 225, 0.32);
    --hero-water: rgba(80, 150, 190, 0.16);
    --hero-glint: rgba(255, 255, 255, 0.85);
    --hero-leaf: #3c9a4f;
    --hero-firefly: transparent;
    --hero-firefly-glow: none;
    --hero-firefly-on: 0;
    --hero-scrim: rgba(242, 232, 213, 0.55);

    --area-architecture: #6b5bd2;
    --area-server: #1f55c8;
    --area-rules: #b8326b;
    --area-client: #0f8a8a;
    --area-world: #2e8b3e;
    --area-content: #7a8a00;
    --area-launcher: #c2571a;
    --area-website: #3c3fa8;
    --area-art: #c0392b;
    --area-wiki: #5f6b14;
    --area-devops: #5d6670;
    --area-testing: #7a4a1f;
    --area-modding: #9b2fae;
    --area-cluster: #0b6e99;
    --area-tools: #74603a;
    --area-aruto: #9a6b00;
  }
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2e8d5;
  --window: rgba(252, 247, 237, 0.7);
  --window-edge: rgba(255, 252, 245, 0.9);
  --side: rgba(247, 239, 224, 0.75);
  --surface: #fcf7ed;
  --surface-edge: rgba(84, 60, 26, 0.1);
  --surface-2: #efe4cd;
  --surface-3: #e6d7ba;
  --raised: #fdf9f1;
  --card: #fffdf8;
  --field: #fffbf3;
  --line: rgba(84, 60, 26, 0.12);
  --line-strong: rgba(84, 60, 26, 0.22);
  --text: #241b10;
  --text-2: #4d3f2d;
  --muted: #6a5a44;
  --accent: #6d28d9;
  --accent-solid: #6d28d9;
  --accent-strong: #5b21b6;
  --accent-soft: rgba(109, 40, 217, 0.09);
  --accent-edge: rgba(109, 40, 217, 0.3);
  --pink: #be185d;
  --sky: #0369a1;
  --sky-soft: rgba(3, 105, 161, 0.09);
  --brand: #4d9a6a;
  --brand-hover: #448c5f;
  --on-brand: #06140b;
  --brand-text: #2e7550;
  --glow: 0 0 10px rgba(77, 154, 106, 0.22);
  --text-glow: drop-shadow(0 0 8px rgba(77, 154, 106, 0.18));
  --badge-ring: 0 0 0 3px rgba(109, 40, 217, 0.15);
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --warn: #a16207;
  --warn-soft: #fdf3d7;
  --danger: #b91c1c;
  --danger-soft: #fde6e6;
  --danger-edge: rgba(220, 38, 38, 0.3);
  --scrim: rgba(36, 27, 16, 0.35);
  --shadow-lg: 0 30px 80px rgba(84, 60, 26, 0.2);
  --shadow-md: 0 12px 32px rgba(84, 60, 26, 0.14);
  --shadow-sm: 0 1px 2px rgba(84, 60, 26, 0.07), 0 4px 14px rgba(84, 60, 26, 0.06);
  --bar-dim: rgba(84, 60, 26, 0.16);
  --skeleton: rgba(84, 60, 26, 0.07);
  --skeleton-shine: rgba(84, 60, 26, 0.12);
  --hero-sky-top: #d3e6ee;
  --hero-sky-mid: #e9e6d6;
  --hero-sky-low: #f2e8d5;
  --hero-moon: #fbf4e2;
  --hero-halo: rgba(255, 244, 220, 0.85);
  --hero-halo-out: rgba(255, 244, 220, 0);
  --hero-ridge-far: rgba(70, 120, 150, 0.2);
  --hero-ridge-near: rgba(60, 112, 110, 0.22);
  --hero-mist: rgba(252, 247, 236, 0.7);
  --hero-b1: rgba(80, 150, 100, 0.38);
  --hero-b2: rgba(58, 150, 78, 0.7);
  --hero-b3: #3c9a4f;
  --hero-shine: rgba(255, 255, 225, 0.32);
  --hero-water: rgba(80, 150, 190, 0.16);
  --hero-glint: rgba(255, 255, 255, 0.85);
  --hero-leaf: #3c9a4f;
  --hero-firefly: transparent;
  --hero-firefly-glow: none;
  --hero-firefly-on: 0;
  --hero-scrim: rgba(242, 232, 213, 0.55);

  --area-architecture: #6b5bd2;
  --area-server: #1f55c8;
  --area-rules: #b8326b;
  --area-client: #0f8a8a;
  --area-world: #2e8b3e;
  --area-content: #7a8a00;
  --area-launcher: #c2571a;
  --area-website: #3c3fa8;
  --area-art: #c0392b;
  --area-wiki: #5f6b14;
  --area-devops: #5d6670;
  --area-testing: #7a4a1f;
  --area-modding: #9b2fae;
  --area-cluster: #0b6e99;
  --area-tools: #74603a;
  --area-aruto: #9a6b00;
}

:root {
  /* The drawn world scenes (_WorldArt): earth for the voxel island, the keep's blood moon. Art only,
     the same in both themes. */
  --soil: #4b3b29;
  --bark: #6b4f35;
  --sand: #cdbf8e;
  --stone: #8a9890;
  --blood: #b8503a;
  --scene-night: #06110c;
  --scene-deep: #0a2418;
  --scene-leaf: #9ad97c;
  --scene-water: #7fd9e8;
  --scene-water-deep: #2a8ba0;
  --scene-dew: #eef7ee;
  --scene-gold: #f0d79b;
  --scene-ember: #f2a283;
  --scene-shade: #0d2a1a;
  --scene-shade-far: #0b2416;

  /* Fonts. Display: Inter Tight, tight and heavy. Body: Inter. Labels and numbers: Geist Mono. */
  --font-display: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', monospace;

  /* Motion. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.16s;
  --dur: 0.32s;
  --dur-slow: 0.7s;

  /* Shape. */
  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --pill: 999px;

  /* Space and layout. */
  --gutter: clamp(1rem, 3vw, 2rem);
  --max: 78rem;
  --section: clamp(4rem, 8vw, 7rem);
  --sidebar-w: 16.5rem;
  --sidebar-w-collapsed: 4.25rem;
  --header-h: 0rem;

  /* Type scale. Do not introduce sizes outside it. */
  --step--2: 0.6875rem;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.8rem + 3vw, 4rem);
  --step-5: clamp(3.2rem, 2rem + 5.5vw, 6.5rem);
}

/* The drawn world scenes (_WorldArt) are night in both themes: inside them the palette
   stays dark. */
.game__art {
  color-scheme: dark;
  --bg: #070908;
  --raised: #101411;
  --field: rgba(255, 255, 255, 0.04);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f5;
  --text-2: #b3b3bf;
  --muted: #8e8e9b;
  --accent: #c4b5fd;
  --accent-solid: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.13);
  --accent-edge: rgba(139, 92, 246, 0.4);
  --pink: #f9a8d4;
  --brand: #4a9e6b;
  --brand-hover: #55ad78;
  --on-brand: #04120a;
  --brand-text: #7cc69a;
  --glow: 0 0 12px rgba(124, 198, 154, 0.26);
  --text-glow: drop-shadow(0 0 12px rgba(124, 198, 154, 0.24));
  --warn: #fbbf24;
  --danger: #fca5a5;
  color: var(--text);
  background-color: var(--bg);
}

/* Japanese pages: the self-hosted fonts are Latin subsets, so kana and kanji fall back to
   the system's Gothic faces. */
:root:lang(ja) {
  --font-display: 'Inter Tight', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', system-ui, sans-serif;
  --font-body: 'Inter', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', system-ui, sans-serif;
}
