/* Design tokens (DESIGN.md with the spec's section 6 deviations). Components use these names only. */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* EB Garamond's weight axis is 400-800: the 300 display token renders as 400 (spec 6.2, deviation 3). */
@font-face {
  font-family: 'EB Garamond Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url(/fonts/eb-garamond-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'EB Garamond Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url(/fonts/eb-garamond-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  color-scheme: light;

  /* surfaces and text */
  --canvas: #f5f5f5;
  --surface-card: #ffffff;
  --surface-strong: #f0efed;
  --ink: #0c0a09;
  --body: #4e4e4e;
  --muted: #777169;
  --muted-on-canvas: #6b655e;
  --muted-soft: #a8a29e;
  --hairline: #e7e5e4;
  --hairline-strong: #d6d3d1;
  --control-border: #777169;
  --primary: #292524;
  --primary-active: #0c0a09;
  --on-primary: #ffffff;

  /* status: always with an icon and words; colour is only the icon and the dot */
  --status-ok: #15803d;
  --status-warn: #b45309;
  --status-alarm: #dc2626;

  /* atmosphere only: behind the status headline, on login, in empty states */
  --orb-mint: #a7e5d3;
  --orb-peach: #f4c5a8;
  --orb-lavender: #c8b8e0;
  --orb-sky: #a8c8e8;
  --orb-rose: #e8b8c4;

  /* chart entities (hex: ApexCharts cannot parse other notations); always drawn on a card */
  --chart-sun: #c98500;
  --chart-home: #2a78d6;
  --chart-grid: #b0409a;
  --chart-battery: #199e70;
  /* the second of a pair gets its own hue (validated per chart, docs/plans/2026-11-19-palette-validation.txt) */
  --chart-sold: #a44c1d;
  --chart-discharge: #736c01;
  --chart-fixed: #736c01;
  --chart-ac: #5952d2;
  --chart-p1: #b0409a;
  --chart-p2: #a44c1d;
  --chart-p3: #5952d2;
  --band-gap: rgba(251, 191, 36, 0.25);
  --band-cut: rgba(248, 113, 113, 0.3);
  --band-stopped: rgba(100, 116, 139, 0.2);

  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777169' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* type */
  --font-serif: 'EB Garamond Variable', 'Times New Roman', serif;
  --font-sans: 'Inter Variable', system-ui, sans-serif;
  --fw-display: 300;
  --fs-display-lg: 36px;
  --fs-display-md: 32px;
  --fs-display-sm: 24px;
  --fs-title-md: 20px;
  --fs-title-sm: 18px;
  --fs-body: 16px;
  --fs-caption: 14px;
  --fs-tile: 28px;
  --fs-hero: 48px;

  /* spacing (4 px base) */
  --sp-xxs: 4px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-base: 16px;
  --sp-md: 20px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 96px;
  --band-gap-y: 48px;
  --gutter: 24px;

  /* shape and depth */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;
  --r-pill: 9999px;
  --shadow-float: 0 4px 16px rgba(0, 0, 0, 0.04);

  /* motion */
  --dur: 150ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* layout */
  --content-max: 1200px;
  --nav-h: 64px;
  --tabbar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --canvas: #0c0a09;
    --surface-card: #1c1917;
    --surface-strong: #292524;
    --ink: #ffffff;
    --body: #d6d3d1;
    --muted: #a8a29e;
    --muted-on-canvas: #a8a29e;
    --muted-soft: #78716c;
    --hairline: #292524;
    --hairline-strong: #44403c;
    --control-border: #a8a29e;
    --primary: #fafafa;
    --primary-active: #e7e5e4;
    --on-primary: #0c0a09;
    --status-ok: #4ade80;
    --status-warn: #fbbf24;
    --status-alarm: #f87171;
    --orb-mint: rgba(167, 229, 211, 0.2);
    --orb-peach: rgba(244, 197, 168, 0.2);
    --orb-lavender: rgba(200, 184, 224, 0.2);
    --orb-sky: rgba(168, 200, 232, 0.2);
    --orb-rose: rgba(232, 184, 196, 0.2);
    --chart-sun: #c98500;
    --chart-home: #3987e5;
    --chart-grid: #c05aae;
    --chart-battery: #199e70;
    --chart-sold: #a44c1d;
    --chart-discharge: #736c01;
    --chart-fixed: #736c01;
    --chart-ac: #6d6ae0;
    --chart-p1: #c05aae;
    --chart-p2: #a44c1d;
    --chart-p3: #6d6ae0;
    --band-gap: rgba(251, 191, 36, 0.2);
    --band-cut: rgba(248, 113, 113, 0.28);
    --band-stopped: rgba(168, 162, 158, 0.18);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --shadow-float: 0 4px 16px rgba(0, 0, 0, 0.32);
  }
}

/* manual choice: the same values as the media query above */
:root[data-theme=dark] {
  color-scheme: dark;
  --canvas: #0c0a09;
  --surface-card: #1c1917;
  --surface-strong: #292524;
  --ink: #ffffff;
  --body: #d6d3d1;
  --muted: #a8a29e;
  --muted-on-canvas: #a8a29e;
  --muted-soft: #78716c;
  --hairline: #292524;
  --hairline-strong: #44403c;
  --control-border: #a8a29e;
  --primary: #fafafa;
  --primary-active: #e7e5e4;
  --on-primary: #0c0a09;
  --status-ok: #4ade80;
  --status-warn: #fbbf24;
  --status-alarm: #f87171;
  --orb-mint: rgba(167, 229, 211, 0.2);
  --orb-peach: rgba(244, 197, 168, 0.2);
  --orb-lavender: rgba(200, 184, 224, 0.2);
  --orb-sky: rgba(168, 200, 232, 0.2);
  --orb-rose: rgba(232, 184, 196, 0.2);
  --chart-sun: #c98500;
  --chart-home: #3987e5;
  --chart-grid: #c05aae;
  --chart-battery: #199e70;
  --chart-sold: #a44c1d;
  --chart-discharge: #736c01;
  --chart-fixed: #736c01;
  --chart-ac: #6d6ae0;
  --chart-p1: #c05aae;
  --chart-p2: #a44c1d;
  --chart-p3: #6d6ae0;
  --band-gap: rgba(251, 191, 36, 0.2);
  --band-cut: rgba(248, 113, 113, 0.28);
  --band-stopped: rgba(168, 162, 158, 0.18);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --shadow-float: 0 4px 16px rgba(0, 0, 0, 0.32);
}

@media (max-width: 639px) {
  :root {
    --fs-display-lg: 32px;
    --band-gap-y: 32px;
    --gutter: 16px;
    --nav-h: 56px;
  }
}
