/* Kleos design tokens ("Calm Command Center": dark graphite, one restrained gold).
   Dark only. The palette is written twice on purpose, once in :root and once in the explicit
   dark selector below with identical values, so a stale theme attribute and the static
   dark attribute in the HTML resolve to the same thing. Both blocks come from one
   source: change a value in both. services/theme-boot.js always resolves to dark.
   Legacy token NAMES (--violet, --peach, --canvas, --hero-*) stay so every stylesheet keeps
   working: --violet is the gold primary, --canvas is the card surface, --app-bg the page.
   Tests read colours as 6-digit hex, so every colour that a test reads is a literal, never a
   var() alias. Keep this file flat: no nested rules. Source: docs/kleos/design-spec.md. */

:root {
  --mobilenav-h: 64px;  /* the phone bar without its safe-area inset */
  /* Kleos palette: the 17 design tokens, as literal hex */
  --primary:                #D9B26A;
  --primary-container:      #262015;
  --secondary:              #A1A6B3;
  --secondary-container:    #1E2128;
  --accent:                 #D9B26A;
  --surface:                #0B0C0E;
  --surface-container:      #15171C;
  --surface-container-high: #1C1F26;
  --surface-container-low:  #111317;
  --outline:                #3A3E48;
  --outline-variant:        #252830;
  --success-container:      #14241B;
  --warning-container:      #271E12;
  --error:                  #E06C65;
  --error-container:        #291716;

  /* surfaces (legacy names, Kleos values) */
  --app-bg:        #0B0C0E;
  --canvas:        #15171C;
  --surface-soft:  #1C1F26;
  --surface-raised: #1C1F26;
  --surface-low:   #111317;
  --divider:       #252830;
  --line:          #252830;
  --line-strong:   #3A3E48;
  --drop-line:     #3A3E48;
  /* the border of anything you type or choose in (inputs, search, pills): 3:1 on the card and page grounds, which
     the decorative --line hairline is not */
  --field-border:  #666D80;

  /* ink */
  --ink:           #E8E9ED;
  --ink-2:         #A1A6B3;
  --ink-3:         #8A8F9E;

  /* brand: gold sits in the --violet role; --peach is the lighter gold of the ramp */
  --violet:        #D9B26A;
  --violet-deep:   #262015;
  --violet-soft:   #262015;
  --peach:         #E6CB94;
  --peach-soft:    #262015;
  --amber:         #D9A05B;

  /* semantic */
  --success:       #63B387;
  --success-soft:  #14241B;
  --warning:       #D9A05B;
  --warning-soft:  #271E12;
  --danger:        #E06C65;
  --danger-soft:   #291716;

  /* text and icons on accent fills: dark ink on gold */
  --on-accent:     #17130A;
  --on-peach:      #17130A;
  --on-deep:       #E8E9ED;
  --on-tint:       #E8E9ED;
  --danger-fill:   #E06C65;
  --on-danger:     #1E0907;

  /* status text on a card or a soft fill */
  --success-ink:   #63B387;
  --warning-ink:   #D9A05B;
  --danger-ink:    #E06C65;
  --peach-ink:     #E6CB94;
  --success-ring:  rgba(99, 179, 135, .32);
  --warning-ring:  rgba(217, 160, 91, .32);
  --danger-ring:   rgba(224, 108, 101, .34);

  /* overlays and translucent fills */
  --scrim:         rgba(4, 5, 7, .64);
  --scrim-strong:  rgba(4, 5, 7, .76);
  --shadow-up:     0 -1px 0 rgba(255, 255, 255, .05), 0 -8px 24px rgba(0, 0, 0, .5);
  --glass:         rgba(255, 255, 255, .04);
  --accent-veil:   rgba(23, 19, 10, .18);
  --scrollbar-thumb: rgba(232, 233, 237, .18);
  --swatch-ring:   rgb(255 255 255 / 18%);
  --hover-dim:     brightness(1.15);
  --logo-backing:  #E8E9ED;
  --media-veil:    rgba(4, 5, 7, .78);
  --selection:     rgba(217, 178, 106, .30);
  --primary-dim:   rgba(217, 178, 106, .35);
  --primary-dim-ink: rgba(232, 233, 237, .62);
  --primary-hover: #E3C07C;
  --app-glow:      radial-gradient(60% 38% at 50% 0%, rgba(217, 178, 106, .045), rgba(217, 178, 106, 0));
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, .04);

  /* overview hero and its illustration (kept for heroArt until Home is rebuilt) */
  --hero-from:     #262015;
  --hero-mid:      #1C1F26;
  --hero-to:       #15171C;
  --hero-ink:      #E8E9ED;
  --hero-ink-2:    #A1A6B3;
  --hero-chip-bg:  rgba(255, 255, 255, .06);
  --hero-art-ink:  #D9B26A;
  --hero-art-hi:   #262015;
  --hero-art-glow: #E6CB94;
  --hero-art-notch: #15171C;
  --hero-art-shadow: #000000;

  /* terminal log */
  --terminal-bg:   #111317;
  --terminal-ink:  #E8E9ED;
  --terminal-muted: #A1A6B3;
  --terminal-err:  #E06C65;

  /* charts: a gold ramp plus slate */
  --chart-1:       #D9B26A;
  --chart-2:       #8C94A8;
  --chart-3:       #63B387;
  --chart-4:       #A98B52;
  --chart-5:       #7F8BAA;
  --chart-area-opacity: .16;
  --chart-grid:    #252830;

  /* printed-page previews of the customer's own site: the same in every theme */
  --paper:         #FFFFFF;
  --paper-ink:     #16181D;
  --paper-muted:   #5B6270;
  --paper-line:    #ECEEF2;

  color-scheme: dark;

  /* shape: sm 6, DEFAULT 12, md 16, lg 20, xl 24, full */
  --r-sm:     6px;
  --r-md:     16px;
  --r-lg:     20px;
  --r-xl:     24px;
  --r-full:   9999px;
  --r-input:  8px;
  --r-card:   24px;
  --r-ctrl:   12px;
  --r-pill:   999px;
  --pad-card: 22px;
  --gap:      24px;

  /* spacing scale */
  --space-xs:      4px;
  --space-sm:      8px;
  --space-md:      16px;
  --space-lg:      24px;
  --space-xl:      32px;
  --page-margin:   32px;
  --space-section: 40px;

  /* shell dimensions. --sidebar is the nav rail column. --rail is NOT the nav rail: it is the
     right-hand column of .split pages, so it keeps its width. */
  --sidebar:   76px;
  --rail-w:    76px;
  --topbar-h:  60px;
  --content-max: 1100px;
  --rail:      348px;

  /* type: Inter only. Each style is a font shorthand plus its tracking. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text-display-lg:  300 48px/56px var(--font);
  --track-display-lg: -1.2px;
  --text-display-md:  300 36px/42px var(--font);
  --track-display-md: -0.8px;
  --text-headline-lg: 400 30px/38px var(--font);
  --track-headline-lg: -0.6px;
  --text-headline-md: 500 20px/28px var(--font);
  --track-headline-md: -0.2px;
  --text-title-md:    500 15px/22px var(--font);
  --track-title-md:   -0.1px;
  --text-title-sm:    500 13px/18px var(--font);
  --track-title-sm:   0;
  --text-body-md:     400 14px/20px var(--font);
  --track-body-md:    0;
  --text-body-sm:     400 13px/18px var(--font);
  --track-body-sm:    0;
  --text-label-lg:    500 13px/18px var(--font);
  --track-label-lg:   0.1px;
  --text-label-md:    500 12px/16px var(--font);
  --track-label-md:   0.2px;
  --text-label-sm:    500 12px/16px var(--font);
  --track-label-sm:   0.2px;

  /* elevation: hairline ring first, depth second */
  --shadow-1: 0 0 0 1px #252830, inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow-2: 0 0 0 1px #3A3E48, 0 4px 12px rgba(0, 0, 0, .5), 0 20px 48px rgba(0, 0, 0, .5);
  --shadow-hover: 0 0 0 1px #3A3E48, inset 0 1px 0 rgba(255, 255, 255, .05);

  /* focus: gold ring */
  --focus: 0 0 0 3px rgba(217, 178, 106, .55);

  /* Motion. Opacity and transform only, 150 to 300ms. ease-in is deliberately absent. */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press:  120ms;
  --t-hover:  160ms;
  --t-enter:  220ms;
  --t-drawer: 300ms;
}

/* Same palette, selected explicitly. Keep identical to :root above. */
:root[data-theme="dark"] {
  --mobilenav-h: 64px;
  /* Kleos palette: the 17 design tokens, as literal hex */
  --primary:                #D9B26A;
  --primary-container:      #262015;
  --secondary:              #A1A6B3;
  --secondary-container:    #1E2128;
  --accent:                 #D9B26A;
  --surface:                #0B0C0E;
  --surface-container:      #15171C;
  --surface-container-high: #1C1F26;
  --surface-container-low:  #111317;
  --outline:                #3A3E48;
  --outline-variant:        #252830;
  --success-container:      #14241B;
  --warning-container:      #271E12;
  --error:                  #E06C65;
  --error-container:        #291716;

  /* surfaces (legacy names, Kleos values) */
  --app-bg:        #0B0C0E;
  --canvas:        #15171C;
  --surface-soft:  #1C1F26;
  --surface-raised: #1C1F26;
  --surface-low:   #111317;
  --divider:       #252830;
  --line:          #252830;
  --line-strong:   #3A3E48;
  --drop-line:     #3A3E48;
  /* the border of anything you type or choose in (inputs, search, pills): 3:1 on the card and page grounds, which
     the decorative --line hairline is not */
  --field-border:  #666D80;

  /* ink */
  --ink:           #E8E9ED;
  --ink-2:         #A1A6B3;
  --ink-3:         #8A8F9E;

  /* brand: gold sits in the --violet role; --peach is the lighter gold of the ramp */
  --violet:        #D9B26A;
  --violet-deep:   #262015;
  --violet-soft:   #262015;
  --peach:         #E6CB94;
  --peach-soft:    #262015;
  --amber:         #D9A05B;

  /* semantic */
  --success:       #63B387;
  --success-soft:  #14241B;
  --warning:       #D9A05B;
  --warning-soft:  #271E12;
  --danger:        #E06C65;
  --danger-soft:   #291716;

  /* text and icons on accent fills: dark ink on gold */
  --on-accent:     #17130A;
  --on-peach:      #17130A;
  --on-deep:       #E8E9ED;
  --on-tint:       #E8E9ED;
  --danger-fill:   #E06C65;
  --on-danger:     #1E0907;

  /* status text on a card or a soft fill */
  --success-ink:   #63B387;
  --warning-ink:   #D9A05B;
  --danger-ink:    #E06C65;
  --peach-ink:     #E6CB94;
  --success-ring:  rgba(99, 179, 135, .32);
  --warning-ring:  rgba(217, 160, 91, .32);
  --danger-ring:   rgba(224, 108, 101, .34);

  /* overlays and translucent fills */
  --scrim:         rgba(4, 5, 7, .64);
  --scrim-strong:  rgba(4, 5, 7, .76);
  --shadow-up:     0 -1px 0 rgba(255, 255, 255, .05), 0 -8px 24px rgba(0, 0, 0, .5);
  --glass:         rgba(255, 255, 255, .04);
  --accent-veil:   rgba(23, 19, 10, .18);
  --scrollbar-thumb: rgba(232, 233, 237, .18);
  --swatch-ring:   rgb(255 255 255 / 18%);
  --hover-dim:     brightness(1.15);
  --logo-backing:  #E8E9ED;
  --media-veil:    rgba(4, 5, 7, .78);
  --selection:     rgba(217, 178, 106, .30);
  --primary-dim:   rgba(217, 178, 106, .35);
  --primary-dim-ink: rgba(232, 233, 237, .62);
  --primary-hover: #E3C07C;
  --app-glow:      radial-gradient(60% 38% at 50% 0%, rgba(217, 178, 106, .045), rgba(217, 178, 106, 0));
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, .04);

  /* overview hero and its illustration (kept for heroArt until Home is rebuilt) */
  --hero-from:     #262015;
  --hero-mid:      #1C1F26;
  --hero-to:       #15171C;
  --hero-ink:      #E8E9ED;
  --hero-ink-2:    #A1A6B3;
  --hero-chip-bg:  rgba(255, 255, 255, .06);
  --hero-art-ink:  #D9B26A;
  --hero-art-hi:   #262015;
  --hero-art-glow: #E6CB94;
  --hero-art-notch: #15171C;
  --hero-art-shadow: #000000;

  /* terminal log */
  --terminal-bg:   #111317;
  --terminal-ink:  #E8E9ED;
  --terminal-muted: #A1A6B3;
  --terminal-err:  #E06C65;

  /* charts: a gold ramp plus slate */
  --chart-1:       #D9B26A;
  --chart-2:       #8C94A8;
  --chart-3:       #63B387;
  --chart-4:       #A98B52;
  --chart-5:       #7F8BAA;
  --chart-area-opacity: .16;
  --chart-grid:    #252830;

  /* printed-page previews of the customer's own site: the same in every theme */
  --paper:         #FFFFFF;
  --paper-ink:     #16181D;
  --paper-muted:   #5B6270;
  --paper-line:    #ECEEF2;

  color-scheme: dark;

  /* shape: sm 6, DEFAULT 12, md 16, lg 20, xl 24, full */
  --r-sm:     6px;
  --r-md:     16px;
  --r-lg:     20px;
  --r-xl:     24px;
  --r-full:   9999px;
  --r-input:  8px;
  --r-card:   24px;
  --r-ctrl:   12px;
  --r-pill:   999px;
  --pad-card: 22px;
  --gap:      24px;

  /* spacing scale */
  --space-xs:      4px;
  --space-sm:      8px;
  --space-md:      16px;
  --space-lg:      24px;
  --space-xl:      32px;
  --page-margin:   32px;
  --space-section: 40px;

  /* shell dimensions. --sidebar is the nav rail column. --rail is NOT the nav rail: it is the
     right-hand column of .split pages, so it keeps its width. */
  --sidebar:   76px;
  --rail-w:    76px;
  --topbar-h:  60px;
  --content-max: 1100px;
  --rail:      348px;

  /* type: Inter only. Each style is a font shorthand plus its tracking. */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --text-display-lg:  300 48px/56px var(--font);
  --track-display-lg: -1.2px;
  --text-display-md:  300 36px/42px var(--font);
  --track-display-md: -0.8px;
  --text-headline-lg: 400 30px/38px var(--font);
  --track-headline-lg: -0.6px;
  --text-headline-md: 500 20px/28px var(--font);
  --track-headline-md: -0.2px;
  --text-title-md:    500 15px/22px var(--font);
  --track-title-md:   -0.1px;
  --text-title-sm:    500 13px/18px var(--font);
  --track-title-sm:   0;
  --text-body-md:     400 14px/20px var(--font);
  --track-body-md:    0;
  --text-body-sm:     400 13px/18px var(--font);
  --track-body-sm:    0;
  --text-label-lg:    500 13px/18px var(--font);
  --track-label-lg:   0.1px;
  --text-label-md:    500 12px/16px var(--font);
  --track-label-md:   0.2px;
  --text-label-sm:    500 12px/16px var(--font);
  --track-label-sm:   0.2px;

  /* elevation: hairline ring first, depth second */
  --shadow-1: 0 0 0 1px #252830, inset 0 1px 0 rgba(255, 255, 255, .04);
  --shadow-2: 0 0 0 1px #3A3E48, 0 4px 12px rgba(0, 0, 0, .5), 0 20px 48px rgba(0, 0, 0, .5);
  --shadow-hover: 0 0 0 1px #3A3E48, inset 0 1px 0 rgba(255, 255, 255, .05);

  /* focus: gold ring */
  --focus: 0 0 0 3px rgba(217, 178, 106, .55);

  /* Motion. Opacity and transform only, 150 to 300ms. ease-in is deliberately absent. */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --t-press:  120ms;
  --t-hover:  160ms;
  --t-enter:  220ms;
  --t-drawer: 300ms;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
