/* Sweeplight design tokens. Single source of truth: design/STYLE_GUIDE.md §2–§6. */

:root,
:root[data-theme="dawn"],
[data-theme="dawn"] {
  color-scheme: light;
  --bg: #F4EEE3;
  --bg-2: #EDE4D4;
  --surface: #FFFCF6;
  --surface-2: #F6EFE2;
  --line: #E4D9C6;
  --ink: #231E2A;
  --ink-2: #675F70;
  --ink-3: #9A92A2;
  --lantern: #E39535;
  --lantern-press: #D2862A;
  --lantern-ink: #231E2A;
  --lantern-text: #9A5410;
  --glow: #FFD58A;
  --sage: #2F6E50;
  --ember: #B3402A;
  --star: #D9A230;
  --star-off: #E2D7C4;
  --star-edge: #9A6A12;

  --tile-up: #D6C8AF;
  --tile-up-hi: #EAE0CD;
  --tile-up-lo: #B8A88B;
  --tile-open: #FBF7EF;
  --tile-open-line: #E9E0D0;
  --tile-open-glow: rgba(255, 213, 138, 0);

  --n1: #2350C8; --n2: #1F7A45; --n3: #C8372A; --n4: #3B2F99;
  --n5: #8A2C1C; --n6: #0E6F78; --n7: #24202B; --n8: #5F5A66;

  --sky-1: #F9EBD6;
  --sky-2: #F4D2A8;
  --hill-1: #E6D3B2;
  --hill-2: #D6BD94;
  --hill-3: #C3A57B;

  --shadow-1: 0 1px 0 rgba(120, 90, 50, .06), 0 6px 18px -8px rgba(120, 90, 50, .22);
  --shadow-2: 0 2px 0 rgba(120, 90, 50, .06), 0 18px 40px -16px rgba(110, 80, 40, .35);
  --scrim: rgba(244, 238, 227, .72);
}

:root[data-theme="dusk"], [data-theme="dusk"] {
  color-scheme: dark;
  --bg: #121019;
  --bg-2: #191522;
  --surface: #1C1926;
  --surface-2: #25212F;
  --line: #2F2A3B;
  --ink: #F2EBDF;
  --ink-2: #A69DB4;
  --ink-3: #6F6880;
  --lantern: #F4A93C;
  --lantern-press: #E39831;
  --lantern-ink: #1A1420;
  --lantern-text: #F4A93C;
  --glow: #FFCF7A;
  --sage: #7FC4A0;
  --ember: #FF8466;
  --star: #F6C453;
  --star-off: #3A3448;
  --star-edge: none;

  --tile-up: #3D3550;
  --tile-up-hi: #4D4466;
  --tile-up-lo: #241F30;
  --tile-open: #221C25;
  --tile-open-line: #2E2631;
  --tile-open-glow: rgba(255, 196, 110, .13);

  --n1: #7FA4FF; --n2: #63C98C; --n3: #FF7F6E; --n4: #B9A8FF;
  --n5: #F2A47E; --n6: #55CFD6; --n7: #EDE6DA; --n8: #A8A1B3;

  --sky-1: #1F1832;
  --sky-2: #3B2A4B;
  --hill-1: #2C2340;
  --hill-2: #211A30;
  --hill-3: #17121F;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -10px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 0 rgba(0, 0, 0, .25), 0 22px 48px -18px rgba(0, 0, 0, .75);
  --scrim: rgba(18, 16, 25, .74);
}

:root {
  --font-display: "Fraunces Variable", "Fraunces", Georgia, "Times New Roman", serif;
  /* Other scripts (Devanagari, Bengali, Japanese, Korean, Cyrillic gaps) fall back to the phone's Noto fonts (D-70). */
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans JP", "Noto Sans KR", sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-tile: 6px; --r-btn: 16px; --r-card: 20px; --r-pill: 999px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms; --t-mid: 240ms;

  /* Android (Capacitor 8 SystemBars, insetsHandling "css") injects --safe-area-inset-*; newer WebViews also fill env(). */
  --safe-top: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
}

/* ---- Unlockable themes (Phase 4, D-52). Same token set; contrast checked by design/tools/theme-contrast.py. ---- */

/* Frost: a cold clear morning. Slate-blue clay, snow paper, the lantern stays warm. */
:root[data-theme="frost"], [data-theme="frost"] {
  color-scheme: light;
  --bg: #ECF0F1;
  --bg-2: #E0E6E9;
  --surface: #FAFCFC;
  --surface-2: #EEF2F4;
  --line: #D5DDE2;
  --ink: #1C2430;
  --ink-2: #536070;
  --ink-3: #8D99A6;
  --lantern: #E0913A;
  --lantern-press: #CD822E;
  --lantern-ink: #1C2430;
  --lantern-text: #8F4E10;
  --glow: #FFD58A;
  --sage: #276A56;
  --ember: #B0392D;
  --star: #D0982A;
  --star-off: #D6DEE3;
  --star-edge: #8E6212;

  --tile-up: #B9C8D3;
  --tile-up-hi: #D5DFE7;
  --tile-up-lo: #95A7B5;
  --tile-open: #F8FAFB;
  --tile-open-line: #E0E7EB;
  --tile-open-glow: rgba(255, 213, 138, 0);

  --n1: #2350C8; --n2: #1D7543; --n3: #C3352A; --n4: #3B2F99;
  --n5: #8A2C1C; --n6: #0D6A73; --n7: #1C2430; --n8: #586270;

  --sky-1: #E8EFF3;
  --sky-2: #CFDDE7;
  --hill-1: #D5DFE6;
  --hill-2: #C1CFD9;
  --hill-3: #AABBC8;

  --shadow-1: 0 1px 0 rgba(50, 70, 90, .06), 0 6px 18px -8px rgba(50, 70, 90, .22);
  --shadow-2: 0 2px 0 rgba(50, 70, 90, .06), 0 18px 40px -16px rgba(40, 60, 80, .35);
  --scrim: rgba(236, 240, 241, .72);
}

/* Grove: a forest at night, lit by fireflies. Moss clay, lime-gold light. */
:root[data-theme="grove"], [data-theme="grove"] {
  color-scheme: dark;
  --bg: #0F1512;
  --bg-2: #141C18;
  --surface: #18211C;
  --surface-2: #202B25;
  --line: #2A3730;
  --ink: #EAF0E6;
  --ink-2: #9EB0A4;
  --ink-3: #64766A;
  --lantern: #D3DA5C;
  --lantern-press: #C2C94E;
  --lantern-ink: #131A0F;
  --lantern-text: #D3DA5C;
  --glow: #EEF29A;
  --sage: #86D1B0;
  --ember: #FF8A6E;
  --star: #F2CF5B;
  --star-off: #2E3A33;
  --star-edge: none;

  --tile-up: #34473B;
  --tile-up-hi: #43594B;
  --tile-up-lo: #1C2620;
  --tile-open: #1A221D;
  --tile-open-line: #26312A;
  --tile-open-glow: rgba(214, 220, 94, .10);

  --n1: #86AAFF; --n2: #6FD39A; --n3: #FF8070; --n4: #C0B0FF;
  --n5: #F2AA84; --n6: #5ED3D9; --n7: #E9EFE5; --n8: #A7B4AB;

  --sky-1: #13201A;
  --sky-2: #22372A;
  --hill-1: #1E2C24;
  --hill-2: #17221C;
  --hill-3: #111914;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -10px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 0 rgba(0, 0, 0, .25), 0 22px 48px -18px rgba(0, 0, 0, .75);
  --scrim: rgba(15, 21, 18, .74);
}

/* Kiln: a potter's yard after dark. Terracotta clay, charcoal, copper light. */
:root[data-theme="kiln"], [data-theme="kiln"] {
  color-scheme: dark;
  --bg: #16110F;
  --bg-2: #1D1613;
  --surface: #221A16;
  --surface-2: #2C221D;
  --line: #3A2D26;
  --ink: #F5E9DF;
  --ink-2: #B9A396;
  --ink-3: #7C685D;
  --lantern: #F08A4B;
  --lantern-press: #DE7B3E;
  --lantern-ink: #1E120C;
  --lantern-text: #F59A62;
  --glow: #FFC08A;
  --sage: #8CC9A0;
  --ember: #FF7C8A;
  --star: #F5C35A;
  --star-off: #3D302A;
  --star-edge: none;

  --tile-up: #5A3A2C;
  --tile-up-hi: #6E4837;
  --tile-up-lo: #2E1E17;
  --tile-open: #1F1714;
  --tile-open-line: #2E231E;
  --tile-open-glow: rgba(255, 170, 110, .12);

  --n1: #8FB0FF; --n2: #74CF93; --n3: #FF8A7A; --n4: #C3B1FF;
  --n5: #F6B08A; --n6: #63D0D4; --n7: #F2E6DA; --n8: #B2A49A;

  --sky-1: #241712;
  --sky-2: #45261B;
  --hill-1: #33221B;
  --hill-2: #271A15;
  --hill-3: #1B1310;

  --shadow-1: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 22px -10px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 0 rgba(0, 0, 0, .25), 0 22px 48px -18px rgba(0, 0, 0, .75);
  --scrim: rgba(22, 17, 15, .74);
}
