/* Harmony Home design tokens.
   Day (default): the original 2.9.0 prototype — light frosted glass on mint/ivory, emerald accents.
   Night (prefers-color-scheme: dark): Harmony Guide's navy palette with the mint → violet glow.
   Components in app.css only read the semantic tokens below, so both themes share one stylesheet. */

@font-face {
  font-family: 'Manrope';
  src: url('../shared/assets/fonts/manrope-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../shared/assets/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* ---- Original 2.9.0 palette (app/dist/styles.css :root) ---- */
  --ink: #103d32;
  --ink-strong: #062f27;
  --muted: #52685f;            /* 5.3:1 on the page base */
  --faint: #5f7268;            /* 4.6:1, non-essential meta only */
  --emerald: #007455;          /* 5.2:1 as text on the page base */
  --emerald-dark: #00523e;
  --mint: #e8f5ef;
  --mint-deep: #cfe7df;
  --ivory: #fbfcf8;
  --sage: #dcebe3;
  --line: rgba(28, 76, 63, 0.12);
  --amber: #784315;
  --amber-bg: #f7eddb;
  --blue: #284b58;
  --blue-bg: #e7eff1;
  --rose: #a5483e;
  --rose-bg: #f8e6e2;
  --glass: linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(239, 249, 245, 0.38));
  --shadow: 0 12px 36px rgba(29, 73, 61, 0.065), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --shadow-soft: 0 4px 14px rgba(29, 73, 61, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --shadow-lift: 0 16px 38px rgba(29, 73, 61, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --radius: 28px;
  --radius-sm: 17px;
  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);

  /* ---- Semantic roles (what app.css reads) ---- */
  --bg: #eaf4ef;
  --page-bg:
    radial-gradient(ellipse at 4% 8%, #fbfcf8 0, transparent 43%),
    radial-gradient(ellipse at 92% 12%, #c5e4dd 0, transparent 45%),
    radial-gradient(ellipse at 55% 80%, #e0eee9 0, transparent 52%),
    linear-gradient(140deg, #f0f6f1, #deeee8 66%, #f5f8f4);
  --bg-elevated: #fbfcf8;
  --text: var(--ink);
  --heading: var(--ink-strong);
  --glass-strong: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(239, 249, 244, 0.62));
  --glass-bar: linear-gradient(130deg, rgba(255, 255, 255, 0.72), rgba(237, 249, 243, 0.5));
  --glass-edge: rgba(255, 255, 255, 0.82);
  --glass-blur: blur(28px) saturate(125%);
  --surface: rgba(255, 255, 250, 0.55);
  --surface-2: rgba(255, 255, 250, 0.8);
  --track: rgba(43, 84, 47, 0.1);
  --border-strong: rgba(28, 76, 63, 0.2);
  --input-bg: rgba(255, 255, 250, 0.85);
  --input-shadow: inset 2px 3px 5px rgba(50, 77, 41, 0.06), 0 1px 0 #fff;

  --accent: var(--emerald);
  --accent-strong: var(--emerald-dark);
  --accent-soft: rgba(0, 116, 85, 0.09);
  --accent-edge: #7aa88b;
  --accent-2: #476c59;         /* sage-green eyebrows, chapters, plans */
  --on-accent: #ffffff;
  --btn-primary: linear-gradient(145deg, #067c62, #006b52);
  --btn-primary-hover: linear-gradient(145deg, #07876d, #007458);
  --btn-primary-shadow: 0 7px 18px rgba(0, 91, 66, 0.16), inset 0 1px 0 rgba(223, 255, 244, 0.32);
  --btn-edge: rgba(214, 247, 234, 0.56);
  --glow: 0 0 0 1px rgba(122, 168, 139, 0.5), inset 1px 2px 5px rgba(40, 85, 41, 0.08);
  --grad-text: linear-gradient(120deg, #00523e, #007455);
  --progress: linear-gradient(90deg, #5a9a6d, #007555);
  --hero-name: var(--ink-strong);

  --ok: #195d3f;
  --ok-bg: #deeddb;
  --talk: var(--amber);
  --talk-bg: var(--amber-bg);
  --unknown: var(--blue);
  --unknown-bg: var(--blue-bg);
  --danger: var(--rose);
  --danger-bg: var(--rose-bg);
  --on-danger: #ffffff;
  --focus: #0b8060;

  /* Questionnaire chat in the original glass language */
  --bubble-harmony: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(220, 240, 231, 0.6));
  --bubble-you: linear-gradient(145deg, #067c62, #006b52);
  --bubble-you-text: #ffffff;
  --option-bg: linear-gradient(140deg, rgba(255, 255, 250, 0.85), rgba(230, 239, 223, 0.7));
  --option-hover: #f6fbf0;
  --option-on: linear-gradient(140deg, #eff7e5, #daebd7);
  --option-edge: rgba(255, 255, 255, 0.96);

  --tabbar-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(231, 246, 239, 0.55));
  --tab-active-bg: rgba(204, 234, 220, 0.72);
  --toast-bg: #0c503d;
  --toast-text: #fffdf5;
  --toast-accent: #b7f0d6;
  --backdrop: rgba(16, 61, 50, 0.28);

  /* Harmony's mark, the crew orbit and ambient light */
  --mark-a: #79d8b3;
  --mark-b: #13926f;
  --mark-face: #0a2a22;
  --orbit-a: #4fb88f;
  --orbit-b: #007455;
  --blob-1: #c0e8d8;
  --blob-2: #f7eaca;
  --blob-3: #fffbe7;
  --blob-opacity: 0.7;
  --grain-opacity: 0.035;
  --house-glow: radial-gradient(ellipse at center, rgba(255, 250, 231, 0.78), transparent 68%);
  --ribbon-edge: rgba(255, 255, 255, 0.85);
  --ribbon-top: rgba(72, 162, 127, 0.35);    /* original hero ribbon edges, glow and sheen */
  --ribbon-bottom: rgba(227, 210, 164, 0.6);
  --ribbon-glow: rgba(255, 255, 255, 0.6);
  --ribbon-glow-outer: rgba(255, 255, 255, 0.5);
  --ribbon-sheen: rgba(255, 255, 235, 0.22);
  --inset-highlight: rgba(255, 255, 255, 0.6);        /* glass top-edge highlight (active dock tab) */
  --inset-highlight-strong: rgba(255, 255, 255, 0.7); /* selected segmented tab */
  --segment-shadow: rgba(48, 73, 40, 0.12);

  /* Type */
  --font-display: 'Manrope', 'DM Sans', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.15rem;
  --fs-xl: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  --fs-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);

  /* Space & shape */
  --gutter: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-btn: 19px;
  --radius-pill: 999px;
  --tap: 44px;
  --tabbar-h: 84px;
  --rail-w: 240px;
  --content-w: 1080px;
  --page-width: 1260px;

  /* Motion: the original ease for entrances, Harmony's spring for pops */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 520ms;
}

/* ---- Night: Harmony Guide's palette (v2-chat-guide/styles/tokens.css) ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2ff;
    --ink-strong: #ffffff;
    --muted: #aab4d4;          /* 8.9:1 on --bg */
    --faint: #8590b3;          /* 5.6:1 */
    --emerald: #6ef3c5;
    --emerald-dark: #3fd9a6;
    --mint: rgba(110, 243, 197, 0.12);
    --mint-deep: rgba(110, 243, 197, 0.22);
    --ivory: #121a38;
    --sage: rgba(255, 255, 255, 0.09);
    --line: rgba(255, 255, 255, 0.12);
    --amber: #ffd27a;
    --amber-bg: rgba(255, 210, 122, 0.12);
    --blue: #7cc8ff;
    --blue-bg: rgba(124, 200, 255, 0.12);
    --rose: #ff8a8a;
    --rose-bg: rgba(255, 138, 138, 0.14);
    --glass: rgba(255, 255, 255, 0.055);
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
    --shadow-soft: 0 8px 24px -14px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 22px 56px -20px rgba(0, 0, 0, 0.8);

    --bg: #070b1a;
    --page-bg: linear-gradient(180deg, #070b1a, #0c1229 60%, #070b1a);
    --bg-elevated: #121a38;
    --glass-strong: rgba(16, 23, 52, 0.92);
    --glass-bar: rgba(13, 19, 44, 0.82);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(18px) saturate(140%);
    --surface: rgba(255, 255, 255, 0.055);
    --surface-2: rgba(255, 255, 255, 0.09);
    --track: rgba(255, 255, 255, 0.14);
    --border-strong: rgba(255, 255, 255, 0.22);
    --input-bg: rgba(0, 0, 0, 0.25);
    --input-shadow: none;

    --accent: #6ef3c5;
    --accent-strong: #3fd9a6;
    --accent-soft: rgba(110, 243, 197, 0.1);
    --accent-edge: #6ef3c5;
    --accent-2: #a98bff;
    --on-accent: #06101c;
    --btn-primary: linear-gradient(120deg, #6ef3c5 0%, #8fd8ee 45%, #a98bff 100%);
    --btn-primary-hover: linear-gradient(120deg, #7ff5cc 0%, #9fdff2 45%, #b59bff 100%);
    --btn-primary-shadow: 0 8px 26px -10px rgba(110, 243, 197, 0.7);
    --btn-edge: transparent;
    --glow: 0 0 0 1px rgba(110, 243, 197, 0.35), 0 8px 32px -8px rgba(110, 243, 197, 0.45);
    --grad-text: linear-gradient(120deg, #6ef3c5 0%, #8fd8ee 45%, #a98bff 100%);
    --progress: linear-gradient(120deg, #6ef3c5, #a98bff);
    --hero-name: #6ef3c5;

    --ok: #6ef3c5;
    --ok-bg: rgba(110, 243, 197, 0.14);
    --on-danger: #06101c;
    --focus: #ffe38a;

    --bubble-harmony: rgba(255, 255, 255, 0.09);
    --bubble-you: linear-gradient(120deg, #6ef3c5 0%, #8fd8ee 45%, #a98bff 100%);
    --bubble-you-text: #06101c;
    --option-bg: rgba(255, 255, 255, 0.04);
    --option-hover: rgba(110, 243, 197, 0.06);
    --option-on: linear-gradient(120deg, rgba(110, 243, 197, 0.16), rgba(169, 139, 255, 0.16));
    --option-edge: rgba(255, 255, 255, 0.22);

    --tabbar-bg: rgba(9, 13, 32, 0.86);
    --tab-active-bg: rgba(255, 255, 255, 0.09);
    --toast-bg: rgba(20, 28, 60, 0.96);
    --toast-text: #eef2ff;
    --toast-accent: #6ef3c5;
    --backdrop: rgba(3, 5, 14, 0.7);

    --mark-a: #6ef3c5;
    --mark-b: #a98bff;
    --mark-face: #0a0f24;
    --orbit-a: #6ef3c5;
    --orbit-b: #a98bff;
    --blob-1: rgba(110, 243, 197, 0.55);
    --blob-2: rgba(169, 139, 255, 0.6);
    --blob-3: rgba(124, 200, 255, 0.4);
    --blob-opacity: 0.45;
    --grain-opacity: 0.07;
    --house-glow: radial-gradient(ellipse at center, rgba(110, 243, 197, 0.16), rgba(169, 139, 255, 0.08) 45%, transparent 70%);
    --ribbon-edge: rgba(169, 139, 255, 0.4);
    --ribbon-top: rgba(110, 243, 197, 0.3);
    --ribbon-bottom: rgba(169, 139, 255, 0.35);
    --ribbon-glow: rgba(169, 139, 255, 0.12);
    --ribbon-glow-outer: transparent;
    --ribbon-sheen: rgba(110, 243, 197, 0.06);
    --inset-highlight: rgba(255, 255, 255, 0.08);
    --inset-highlight-strong: rgba(255, 255, 255, 0.1);
    --segment-shadow: rgba(0, 0, 0, 0.35);
  }
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 40px; }
}
