/* emma · Lantern design tokens
   Canonical grounds and type: paper #F6EFE3, dusk #15131F, cream #F7E9D2,
   cocoa ink #2A1810. Logo/character ramps remain in the source kit assets.
   The established `coral` names are compatibility aliases for functional amber;
   they do not recolor the canonical artwork. Amber controls use cocoa labels,
   a deeper amber edge, and an external focus ring contrasting with the ground.
   Color is never the only state indicator. Existing component spacing, semantic
   roles, and timing remain stable. Fraunces and Source Sans 3 are self-hosted.
*/

:root {
  color-scheme: light;

  /* ---- surfaces, lightest to deepest ------------------------------------ */
  --paper:        #F6EFE3;  /* canonical Lantern paper */
  --raised:       #FCF8F0;  /* cards, inputs, dialogs that sit on paper */
  --cream:        #EFE4D2;  /* paper raised: tinted panels */
  --parchment:    #E9DCC7;  /* wells, hover, pressed, table stripes */
  --dark:         #15131F;  /* the dark surface: Lock, Stop, footer, locked state */
  --dark-2:       #26223A;  /* hover on the dark surface */

  /* ---- ink -------------------------------------------------------------- */
  --ink:          #2A1810;  /* primary text, icons, outlines, focus ring */
  --cocoa:        #604A3C;  /* secondary text */
  --muted:        #715B4D;
  --on-dark:      #F7E9D2;  /* text on the dark surface */
  --on-dark-soft: #D0C3B6;  /* secondary text on the dark surface */

  /* ---- amber (legacy coral token aliases) ---------------------------------------- */
  --coral:        #F7B653;  /* functional amber fill; logo colors come from canonical SVG assets */
  --coral-press:  #F2A440;
  --coral-deep:   #A4521D;
  --coral-ink:    #904514;  /* coral words on paper; the edge on every coral fill */
  --coral-tint:   #F6DFC0;  /* the row that is readable right now */
  --on-coral:     #2A1810;  /* the ONLY text on coral, in both themes; never inherits */
  --focus-on-coral:#2A1810; /* focus ring around a coral button: drawn 3px outside it, on the surface, so it follows the surface ink */
  --coral-quiet:  #D3713E;  /* quiet amber fill; use canonical quiet artwork for the mark */

  /* ---- meaning (always with a word and a glyph) ------------------------- */
  --brick:        #8f2a1b;  /* error, destructive, "cannot be undone" */
  --brick-tint:   #f8e1dc;
  --on-brick:     #fbf4e4;  /* label on the one destructive button */
  --moss:         #2f5a2d;  /* nothing shared · check rows · file intact */
  --moss-tint:    #e3ecd9;
  --ochre:        #6b4600;  /* caution: expiring, shortened, cannot be shared, connected-but-unavailable */
  --ochre-tint:   #f6e7c3;

  /* ---- lines ------------------------------------------------------------ */
  --hairline:     #DCCDB9;  /* decorative rules inside cards; never a control boundary */
  --line:         #C9B59B;  /* card edges (cards also have a shadow) */
  --line-strong:  #967456;

  /* ---- focus ------------------------------------------------------------ */
  --focus:        #2A1810;  /* a real `outline`, 2px, offset 2px: survives forced-colors */
  --focus-on-dark:#F7E9D2;

  /* ---- type ------------------------------------------------------------- */
  --font-display: "Fraunces", "Iowan Old Style", "Charter", Georgia, serif;
  --font-text:    "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Fraunces axes. SOFT rounds the serifs toward the cushion. Tracking is
     neutral (never negative): "1" must never read as "l". opsz is automatic. */
  --display-soft: "SOFT" 100, "WONK" 0;
  --display-soft-word: "SOFT" 100, "WONK" 0;
  --tracking-display: 0;
  --tracking-caps: 0.1em;

  /* scale in rem; the root stays at the user's size */
  --fs-xs:  0.8125rem;  /* 13 */
  --fs-sm:  0.9375rem;  /* 15 */
  --fs-md:  1.0625rem;  /* 17 · body */
  --fs-lg:  1.25rem;    /* 20 */
  --fs-xl:  1.5rem;     /* 24 */
  --fs-2xl: 1.875rem;   /* 30 */
  --fs-3xl: clamp(2rem, 1.4rem + 2vw, 2.375rem);   /* 32–38 · page titles */
  --fs-4xl: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);  /* 36–56 · hero */
  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-text:  1.55;
  --measure:  64ch;

  /* ---- space (4px grid) ------------------------------------------------- */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.25rem; --s-6: 1.5rem;  --s-8: 2rem;    --s-10: 2.5rem;
  --s-12: 3rem;   --s-16: 4rem;   --s-20: 5rem;   --s-24: 6rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);   /* 16px at 320, 40px at 1000+ */
  --page-max: 72rem;                    /* 1152 */
  --app-max:  80rem;                    /* 1280 */

  /* ---- radii (the existing component family) --------------------------------------- */
  --r-xs: 4px;    /* inline code */
  --r-sm: 8px;    /* chips */
  --r-md: 12px;   /* inputs, buttons */
  --r-lg: 18px;   /* cards */
  --r-xl: 26px;   /* panels, dialogs, hero pool */
  --r-pill: 999px;

  /* ---- elevation: warm, cocoa-tinted, never grey ------------------------- */
  --sh-1: 0 1px 2px rgb(42 24 16 / 0.03);
  --sh-2: 0 14px 44px -28px rgb(42 24 16 / 0.25);
  --sh-3: 0 24px 64px -28px rgb(42 24 16 / 0.35);
  --scrim: rgba(43, 26, 18, 0.5);

  /* ---- motion: breath, never decoration --------------------------------- */
  --dur-1: 120ms;  /* hover, press, checkbox */
  --dur-2: 220ms;  /* chip change, reveal */
  --dur-3: 420ms;  /* dialog arrival */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --breath: 6s;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; --breath: 0s; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15131F;
    --raised: #1E1B2B;
    --cream: #26223A;
    --parchment: #2E293F;
    --dark: #15131F;
    --dark-2: #26223A;
    --ink: #F7E9D2;
    --cocoa: #D7CBD0;
    --muted: #BCB1C3;
    --on-dark: #F7E9D2;
    --on-dark-soft: #D0C3B6;
    --coral-ink: #FCC867;
    --coral-tint: #3A2B2A;
    --coral-deep: #F2A440;
    --brick: #f0a090;
    --brick-tint: #4a221c;
    --on-brick: #2b1a12;
    --moss: #a9d19e;
    --moss-tint: #263522;
    --ochre: #e8c072;
    --ochre-tint: #3f3014;
    --hairline: #3A3449;
    --line: #54475D;
    --line-strong: #9D8A9F;
    --focus: #F7E9D2;
    --focus-on-dark: #f9e8c7;
    --focus-on-coral: #F7E9D2;
    --sh-1: none;
    --sh-2: 0 14px 44px -28px rgb(9 7 16 / 0.5);
    --sh-3: 0 24px 64px -28px rgb(9 7 16 / 0.65);
    --scrim: rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15131F;
  --raised: #1E1B2B;
  --cream: #26223A;
  --parchment: #2E293F;
  --dark: #15131F;
  --dark-2: #26223A;
  --ink: #F7E9D2;
  --cocoa: #D7CBD0;
  --muted: #BCB1C3;
  --on-dark: #F7E9D2;
  --on-dark-soft: #D0C3B6;
  --coral-ink: #FCC867;
  --coral-tint: #3A2B2A;
  --coral-deep: #F2A440;
  --brick: #f0a090;
  --brick-tint: #4a221c;
  --on-brick: #2b1a12;
  --moss: #a9d19e;
  --moss-tint: #263522;
  --ochre: #e8c072;
  --ochre-tint: #3f3014;
  --hairline: #3A3449;
  --line: #54475D;
  --line-strong: #9D8A9F;
  --focus: #F7E9D2;
  --focus-on-dark: #f9e8c7;
  --focus-on-coral: #F7E9D2;
  --sh-1: none;
  --sh-2: 0 14px 44px -28px rgb(9 7 16 / 0.5);
  --sh-3: 0 24px 64px -28px rgb(9 7 16 / 0.65);
  --scrim: rgba(0, 0, 0, 0.6);
}
