/* Single palette for the application and cached offline page.
 * Change --brand-hue to recolor actions, links, focus, and brand decoration.
 * Change --surface-hue to retint neutral surfaces in both modes.
 * Status hues remain independent so business states keep their meaning.
 * HSL tokens contain channels only; consume with hsl(var(--token) / alpha).
 */
:root {
  /* Shared geometry and interaction settings for every route and role. */
  --app-panel-radius: 1.35rem;
  --app-card-radius: 1rem;
  --app-section-gap: clamp(2.5rem, 5vw, 5rem);
  --app-motion-duration: 600ms;
  --app-hover-duration: 180ms;
  --app-pointer-radius: 240px;
  --app-pointer-strength: .16;
  --app-tilt-range: 2.5;
  --app-parallax-range: 6;
  --app-orbit-duration: 40s;
  --app-float-duration: 7s;
  --brand-hue: 174;
  --surface-hue: 222;
  --secondary-hue: 238;
  --success-hue: 153;
  --warning-hue: 38;
  --destructive-hue: 0;
  --info-hue: 215;
  --white: 0 0% 100%;
  --black: 0 0% 0%;
  --shadow-ink: var(--surface-hue) 35% 8%;

  /* Legacy utility shade ramps also belong to this palette, not JS config. */
  --palette-50: 97%;
  --palette-100: 94%;
  --palette-200: 89%;
  --palette-300: 81%;
  --palette-400: 68%;
  --palette-500: 51%;
  --palette-600: 42%;
  --palette-700: 34%;
  --palette-800: 28%;
  --palette-900: 22%;
  --palette-950: 14%;
  --solid-palette-600: 31%;
  --solid-palette-700: 27%;
  --solid-palette-800: 22%;
  --solid-palette-900: 17%;
  --solid-palette-950: 12%;

  --brand-saturation: 78%;
  --brand-lightness: 27%;
  --secondary-saturation: 59%;
  --success-saturation: 70%;
  --warning-saturation: 90%;
  --destructive-saturation: 72%;
  --info-saturation: 78%;

  --background: var(--surface-hue) 45% 97%;
  --foreground: var(--surface-hue) 47% 15%;
  --card: var(--surface-hue) 0% 100%;
  --card-foreground: var(--foreground);
  --popover: var(--card);
  --popover-foreground: var(--foreground);
  --primary: var(--brand-hue) var(--brand-saturation) var(--brand-lightness);
  --primary-foreground: 0 0% 100%;
  --secondary: var(--secondary-hue) var(--secondary-saturation) 48%;
  --secondary-foreground: 0 0% 100%;
  --muted: var(--surface-hue) 32% 94%;
  --muted-foreground: var(--surface-hue) 20% 39%;
  --accent: var(--primary);
  --accent-foreground: var(--primary-foreground);
  --destructive: var(--destructive-hue) var(--destructive-saturation) 45%;
  --destructive-foreground: 0 0% 100%;
  --success: var(--success-hue) var(--success-saturation) 27%;
  --success-foreground: 0 0% 100%;
  --warning: var(--warning-hue) var(--warning-saturation) 30%;
  --warning-foreground: 0 0% 100%;
  --info: var(--info-hue) var(--info-saturation) 43%;
  --info-foreground: 0 0% 100%;
  --border: var(--surface-hue) 28% 85%;
  --input: var(--surface-hue) 28% 80%;
  --ring: var(--primary);
  --gray-light: var(--background);
  --gray-dark: var(--muted);
  --radius: 0.75rem;

  --neutral-50: var(--surface-hue) 40% 98%;
  --neutral-100: var(--surface-hue) 40% 96%;
  --neutral-200: var(--surface-hue) 32% 91%;
  --neutral-300: var(--surface-hue) 27% 84%;
  --neutral-400: var(--surface-hue) 20% 65%;
  --neutral-500: var(--surface-hue) 16% 47%;
  --neutral-600: var(--surface-hue) 19% 35%;
  --neutral-700: var(--surface-hue) 25% 27%;
  --neutral-800: var(--surface-hue) 33% 18%;
  --neutral-900: var(--surface-hue) 47% 11%;
  --neutral-950: var(--surface-hue) 84% 5%;

  --glass-edge: var(--border);
  --glass-highlight: var(--card);
  --glass-shadow: var(--surface-hue) 42% 20%;
  --overlay: var(--surface-hue) 45% 8%;
  --browser-theme-color: hsl(var(--card));
  --brand-gradient: linear-gradient(115deg, hsl(var(--brand-hue) 78% 27%), hsl(var(--info-hue) 70% 32%), hsl(var(--secondary-hue) 59% 38%));
  --brand-on-solid: 0 0% 100%;
  --brand-solid: var(--brand-hue) 78% 27%;
  --brand-decoration: radial-gradient(circle at top right, hsl(var(--primary) / .16), transparent 35%), radial-gradient(circle at bottom left, hsl(var(--primary) / .1), transparent 28%);

  /* Media stages retain contrast over video in either application theme. */
  --media-background: var(--surface-hue) 47% 11%;
  --media-surface: var(--surface-hue) 33% 18%;
  --media-raised: var(--surface-hue) 25% 27%;
  --media-border: var(--surface-hue) 19% 35%;
  --media-foreground: var(--surface-hue) 40% 98%;
  --media-muted: var(--surface-hue) 20% 70%;
  --media-backdrop: var(--surface-hue) 60% 5%;
  --media-success: var(--success-hue) 62% 68%;
  --media-selected: var(--brand-hue) 65% 65%;
  --media-destructive: var(--destructive-hue) 72% 42%;
  --media-destructive-hover: var(--destructive-hue) 72% 36%;

  --chart-temperature-1: hsl(var(--destructive));
  --chart-temperature-2: hsl(var(--warning-hue) 85% 46%);
  --chart-temperature-3: hsl(48 85% 40%);
  --chart-temperature-4: hsl(330 65% 48%);
  --chart-temperature-5: hsl(var(--secondary));
  --chart-moisture-1: hsl(var(--success));
  --chart-moisture-2: hsl(var(--primary));
  --chart-moisture-3: hsl(190 80% 38%);
  --chart-moisture-4: hsl(var(--info));
  --chart-moisture-5: hsl(var(--secondary));
  color-scheme: light;
  background-color: hsl(var(--background));
}

.dark {
  --brand-saturation: 65%;
  --brand-lightness: 65%;
  --secondary-saturation: 90%;
  --success-saturation: 62%;
  --warning-saturation: 92%;
  --destructive-saturation: 88%;
  --info-saturation: 92%;
  --background: var(--surface-hue) 42% 10%;
  --foreground: var(--surface-hue) 40% 96%;
  --card: var(--surface-hue) 34% 17%;
  --popover: var(--surface-hue) 32% 20%;
  --primary-foreground: var(--surface-hue) 32% 14%;
  --secondary: var(--secondary-hue) var(--secondary-saturation) 81%;
  --secondary-foreground: var(--primary-foreground);
  --muted: var(--surface-hue) 26% 22%;
  --muted-foreground: var(--surface-hue) 24% 77%;
  --destructive: var(--destructive-hue) var(--destructive-saturation) 74%;
  --destructive-foreground: var(--surface-hue) 38% 12%;
  --success: var(--success-hue) var(--success-saturation) 68%;
  --success-foreground: var(--destructive-foreground);
  --warning: var(--warning-hue) var(--warning-saturation) 70%;
  --warning-foreground: var(--destructive-foreground);
  --info: var(--info-hue) var(--info-saturation) 77%;
  --info-foreground: var(--destructive-foreground);
  --border: var(--surface-hue) 24% 31%;
  --input: var(--surface-hue) 24% 38%;
  --neutral-950: var(--surface-hue) 38% 12%;
  --neutral-900: var(--surface-hue) 30% 17%;
  --neutral-800: var(--surface-hue) 26% 22%;
  --neutral-700: var(--surface-hue) 20% 35%;
  --neutral-600: var(--surface-hue) 17% 47%;
  --neutral-500: var(--surface-hue) 23% 68%;
  --neutral-400: var(--surface-hue) 25% 77%;
  --glass-highlight: var(--foreground);
  --glass-shadow: var(--surface-hue) 50% 4%;
  --chart-temperature-2: hsl(var(--warning-hue) 85% 65%);
  --chart-temperature-3: hsl(48 85% 65%);
  --chart-temperature-4: hsl(330 65% 75%);
  --chart-moisture-3: hsl(190 80% 65%);
  color-scheme: dark;
}
