/**
 * EnergyCheck Design System — Foundation Tokens
 * Version 1.0 · Shared by EnergyCheck and EC House
 *
 * Token values are extracted verbatim from the EnergyCheck design-system bundle.
 * Do not edit the :root blocks locally — they are the contract with EnergyCheck.
 * EC House-specific component classes live at the bottom of this file.
 *
 * Fonts are self-hosted (assets/fonts/) rather than pulled from Google Fonts:
 * removes a render-blocking third-party request on every page load.
 * Figtree and JetBrains Mono are variable fonts — one file covers weights 300–900.
 */

/* ── Fonts ─────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-latin-ext.woff2') format('woff2');
  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: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree-latin.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  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: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  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;
}

/* ── Brand constants (theme-independent) ───────────────────────────────────── */
:root {
  --ec-lime:      #8FDB43;
  --ec-green:     #3EDC81;
  --ec-yellow:    #DEDC00;
  --ec-navy:      #29235C;
  --ec-gradient:  linear-gradient(90deg, #DEDC00 0%, #8FDB43 50%, #3EDC81 100%);
  --ec-gradient-short: linear-gradient(90deg, #8FDB43, #3EDC81);
  --ec-ink:         #0E0A2E;
  --ec-indigo-mist: #5C557E;
  --ec-forest-lime: #5BA82E;
  --ec-pale-lime:   #D8F0B0;
  --ec-spec-blue:   #4F8FC4;
  --ec-goldenrod:   #E8A93D;
  --ec-terracotta:  #D86E4E;
  --ec-limestone:   #E8E2C8;
}

/* ── Semantic — dark (default) ─────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg:           #080716;
  --bg-2:         #120F28;
  --bg-3:         #1C1838;
  --bg-4:         #29235C;
  --border:       rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-1:       #F0EFF8;
  --text-2:       #9E9BBE;
  --text-3:       #5C587F;
  --accent:       #8FDB43;
  --accent-hover: #A3E85E;
  --accent-muted: rgba(143, 219, 67, 0.15);
  --accent-glow:  0 0 28px rgba(143, 219, 67, 0.22), 0 0 8px rgba(143, 219, 67, 0.12);
  --destructive:  #D86E4E;
  --warning:      #E8A93D;
  --success:      #3EDC81;
  --info:         #4F8FC4;
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 16px 48px rgba(0, 0, 0, 0.6);
  --glow-sm:      0 0 12px rgba(143, 219, 67, 0.18);
  --glow-md:      0 0 28px rgba(143, 219, 67, 0.24), 0 0 8px rgba(143, 219, 67, 0.12);
  --glow-lg:      0 0 56px rgba(143, 219, 67, 0.30), 0 0 20px rgba(143, 219, 67, 0.18);
}

/* ── Semantic — light ──────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #FFFFFF;
  --bg-2:         #F5F7FA;
  --bg-3:         #EDF0F5;
  --bg-4:         #E2E8F0;
  --border:       rgba(41, 35, 92, 0.08);
  --border-strong: rgba(41, 35, 92, 0.16);
  --text-1:       #29235C;
  --text-2:       #4A5568;
  --text-3:       #9CA3AF;
  --accent:       #6DC030;
  --accent-hover: #5EAA28;
  --accent-muted: rgba(109, 192, 48, 0.10);
  --destructive:  #B85433;
  --warning:      #B8801A;
  --success:      #1FB368;
  --info:         #2D6DB5;
  --shadow-sm:    0 1px 3px rgba(41, 35, 92, 0.08), 0 1px 2px rgba(41, 35, 92, 0.04);
  --shadow-md:    0 4px 12px rgba(41, 35, 92, 0.10), 0 2px 4px rgba(41, 35, 92, 0.05);
  --shadow-lg:    0 16px 40px rgba(41, 35, 92, 0.12), 0 4px 8px rgba(41, 35, 92, 0.06);
  --glow-sm:      none;
  --glow-md:      none;
  --glow-lg:      none;
}

/* ── Typography scale ──────────────────────────────────────────────────────── */
:root {
  --font:         'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --w-light:      300;
  --w-regular:    400;
  --w-medium:     500;
  --w-semibold:   600;
  --w-bold:       700;
  --w-extrabold:  800;
  --w-black:      900;
  --text-display:  72px;
  --text-h1:       48px;
  --text-h2:       36px;
  --text-h3:       24px;
  --text-h4:       20px;
  --text-body-lg:  18px;
  --text-body:     16px;
  --text-body-sm:  14px;
  --text-label:    11px;
  --text-caption:  12px;
  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --tracking-tight:    -0.02em;
  --tracking-normal:   0;
  --tracking-wide:     0.06em;
  --tracking-wider:    0.12em;
  --tracking-editorial: 0.18em;
}

/* ── Spacing + radii ───────────────────────────────────────────────────────── */
:root {
  --space-1:   4px;   --space-2:   8px;   --space-3:  12px;  --space-4:  16px;
  --space-5:  20px;   --space-6:  24px;   --space-8:  32px;  --space-10: 40px;
  --space-12: 48px;   --space-16: 64px;   --space-20: 80px;  --space-24: 96px;
  --space-32: 128px;
  --radius-xs:   2px;  --radius-sm:   4px;  --radius-md:   8px;
  --radius-lg:  16px;  --radius-xl:  24px;  --radius-2xl: 32px;
  --radius-pill: 9999px;
}

/* ── Typographic utilities ─────────────────────────────────────────────────── */
.ec-base {
  font-family: var(--font); color: var(--text-1); background: var(--bg);
  font-size: var(--text-body); line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.ec-display { font-size: var(--text-display); font-weight: var(--w-black); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
.ec-h1 { font-size: var(--text-h1); font-weight: var(--w-black); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
.ec-h2 { font-size: var(--text-h2); font-weight: var(--w-bold); line-height: var(--leading-snug); letter-spacing: -0.01em; }
.ec-h3 { font-size: var(--text-h3); font-weight: var(--w-semibold); line-height: var(--leading-snug); }
.ec-h4 { font-size: var(--text-h4); font-weight: var(--w-semibold); line-height: var(--leading-normal); }
.ec-body-lg { font-size: var(--text-body-lg); font-weight: var(--w-regular); line-height: var(--leading-relaxed); color: var(--text-2); }
.ec-body { font-size: var(--text-body); font-weight: var(--w-regular); line-height: var(--leading-normal); color: var(--text-2); }
.ec-label { font-size: var(--text-label); font-weight: var(--w-semibold); letter-spacing: var(--tracking-editorial); text-transform: uppercase; color: var(--text-3); }
.ec-label-accent { font-size: var(--text-label); font-weight: var(--w-semibold); letter-spacing: var(--tracking-editorial); text-transform: uppercase; color: var(--accent); }
.ec-caption { font-size: var(--text-caption); font-weight: var(--w-light); line-height: var(--leading-normal); color: var(--text-3); }
.ec-mono { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.ec-accent { color: var(--accent); }
.ec-gradient-text {
  background: var(--ec-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ec-gradient-bar { height: 3px; background: var(--ec-gradient); border-radius: var(--radius-pill); }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTS
   Hand-resolved from the EnergyCheck DS React components (Button, Card, Label,
   Tag, Icon) so the pages need no React, no Lucide and no canvas runtime.
   Values match the originals exactly.
   ═════════════════════════════════════════════════════════════════════════ */

/* ── Button ────────────────────────────────────────────────────────────────── */
.ec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  border: none; border-radius: 6px; padding: 10px 22px; font-size: 14px;
}
.ec-btn--sm { padding: 7px 14px;  font-size: 12px; border-radius: 5px; }
.ec-btn--md { padding: 10px 22px; font-size: 14px; border-radius: 6px; }
.ec-btn--lg { padding: 13px 28px; font-size: 16px; border-radius: 7px; }

/* light-surface variants (canonical) */
.ec-btn--primary   { background: #6DC030; color: #FFFFFF; border: none; font-weight: 700; }
.ec-btn--secondary { background: transparent; color: #29235C; border: 1.5px solid rgba(41,35,92,0.18); font-weight: 600; }
.ec-btn--accent    { background: rgba(109,192,48,0.1); color: #6DC030; border: 1.5px solid rgba(109,192,48,0.3); font-weight: 600; }
.ec-btn--ghost     { background: transparent; color: #4A5568; border: none; font-weight: 500; }
.ec-btn--danger    { background: rgba(216,110,78,0.08); color: #D86E4E; border: 1.5px solid rgba(216,110,78,0.2); font-weight: 600; }

.ec-btn--primary:hover   { background: #5EAA28; }
.ec-btn--secondary:hover { border-color: rgba(41,35,92,0.34); }
.ec-btn--accent:hover    { background: rgba(109,192,48,0.18); }
.ec-btn--ghost:hover     { color: #29235C; }

/* dark-surface variants */
[data-theme="dark"] .ec-btn--primary,   .ec-btn--dark.ec-btn--primary   { background: #8FDB43; color: #080716; border: none; font-weight: 700; }
[data-theme="dark"] .ec-btn--secondary, .ec-btn--dark.ec-btn--secondary { background: transparent; color: #F0EFF8; border: 1.5px solid rgba(255,255,255,0.2); font-weight: 600; }
[data-theme="dark"] .ec-btn--accent,    .ec-btn--dark.ec-btn--accent    { background: rgba(143,219,67,0.1); color: #8FDB43; border: 1.5px solid rgba(143,219,67,0.3); font-weight: 600; }
[data-theme="dark"] .ec-btn--primary:hover,   .ec-btn--dark.ec-btn--primary:hover   { background: #A3E85E; }
[data-theme="dark"] .ec-btn--secondary:hover, .ec-btn--dark.ec-btn--secondary:hover { border-color: rgba(255,255,255,0.38); }
[data-theme="dark"] .ec-btn--accent:hover,    .ec-btn--dark.ec-btn--accent:hover    { background: rgba(143,219,67,0.18); }

.ec-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ec-btn svg { flex: none; }

/* ── Card ──────────────────────────────────────────────────────────────────── */
.ec-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 26px;
}
[data-theme="light"] .ec-card { background: #FFFFFF; box-shadow: var(--shadow-sm); }
.ec-card--flush { padding: 0; overflow: hidden; }
.ec-card--hoverable { transition: transform .18s, box-shadow .18s, border-color .18s; }
.ec-card--hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ── Tag ───────────────────────────────────────────────────────────────────── */
.ec-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--accent-muted); color: var(--accent);
}
.ec-tag--outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }

/* ── Shared layout ─────────────────────────────────────────────────────────── */
.ec-wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .ec-wrap { padding: 0 20px; } }
