/* Battery Health Checker — design tokens (single source of truth) */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('inter-var.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.64%;
}

:root {
  color-scheme: light;

  /* Surfaces — soft mint-tinted neutrals */
  --bg-primary: #F3F7F4;
  --bg-secondary: #E6EFE8;
  --bg-footer: #D8E3DB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F7FBF8;
  --border: #D2DFD6;
  --border-strong: #B5C9BB;

  /* Brand — emerald / battery green */
  --accent-primary: #059669;
  --accent-primary-dark: #047857;
  --accent-secondary: #0D9488;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --text-primary: #14201A;
  --text-secondary: #4A5C52;
  --text-muted: #6B7F74;
  --on-accent: #FFFFFF;

  --gradient-accent: linear-gradient(135deg, #059669 0%, #0D9488 100%);
  --gradient-glow: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(5, 150, 105, 0.14), transparent 70%);
  --header-bg: rgba(243, 247, 244, 0.82);

  /* Status palette used by the battery tool + UI accents */
  --s0: #D97706;  /* amber / warn */
  --s1: #16A34A;  /* green / healthy */
  --s2: #0D9488;  /* teal */
  --s3: #DC2626;  /* red / critical */
  --s4: #0891B2;  /* cyan */
  --s5: #059669;  /* emerald */
  --s6: #EA580C;  /* orange */
  --s7: #65A30D;  /* lime */

  --font-sans: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-base: 1rem; --fs-lg: 1.125rem;
  --fs-xl: 1.5rem; --fs-2xl: 1.875rem; --fs-3xl: 2.375rem; --fs-4xl: 3.25rem;
  --lh-tight: 1.15; --lh-normal: 1.6; --lh-relaxed: 1.7;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  --radius-button: 12px; --radius-card: 18px; --radius-input: 12px; --radius-panel: 20px; --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 32, 26, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 32, 26, 0.12);
  --shadow-glow: 0 0 0 1px rgba(5, 150, 105, 0.28), 0 10px 32px rgba(5, 150, 105, 0.22);
  --shadow-glow-blue: var(--shadow-glow);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms; --duration-base: 220ms; --duration-slow: 400ms;

  --max-width: 1400px;
  --header-height: 72px;

  /* Tool widgets bridge to the same tokens */
  --tool-primary: var(--accent-primary);
  --tool-primary-text: var(--on-accent);
  --tool-bg: var(--bg-card);
  --tool-surface: var(--bg-secondary);
  --tool-text: var(--text-primary);
  --tool-muted: var(--text-muted);
  --tool-border: var(--border);
  --tool-success: var(--success);
  --tool-warning: var(--warning);
  --tool-danger: var(--danger);
  --tool-font: var(--font-sans);
  --tool-radius: 8px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0B1210;
  --bg-secondary: #121A16;
  --bg-footer: #060A08;
  --bg-card: #162019;
  --bg-card-hover: #1C2820;
  --border: #2A3A30;
  --border-strong: #3D5244;

  --accent-primary: #34D399;
  --accent-primary-dark: #10B981;
  --accent-secondary: #2DD4BF;
  --success: #22C55E;
  --warning: #FBBF24;
  --danger: #F87171;

  --text-primary: #EDF5F0;
  --text-secondary: #A3B8AB;
  --text-muted: #7A9184;
  --on-accent: #062016;

  --gradient-accent: linear-gradient(135deg, #34D399 0%, #2DD4BF 100%);
  --gradient-glow: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(52, 211, 153, 0.12), transparent 70%);
  --header-bg: rgba(11, 18, 16, 0.78);

  --s0: #FBBF24;
  --s1: #22C55E;
  --s2: #2DD4BF;
  --s3: #F87171;
  --s4: #22D3EE;
  --s5: #34D399;
  --s6: #FB923C;
  --s7: #A3E635;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(52, 211, 153, 0.4), 0 10px 36px rgba(52, 211, 153, 0.28);
  --shadow-glow-blue: var(--shadow-glow);

  --tool-primary: var(--accent-primary);
  --tool-primary-text: var(--on-accent);
  --tool-bg: var(--bg-card);
  --tool-surface: var(--bg-secondary);
  --tool-text: var(--text-primary);
  --tool-muted: var(--text-muted);
  --tool-border: var(--border);
  --tool-success: var(--success);
  --tool-warning: var(--warning);
  --tool-danger: var(--danger);
  --tool-font: var(--font-sans);
}

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; border-radius: var(--radius-input); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-tight); color: var(--text-primary); }
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); line-height: 1.2; }
h3 { font-size: var(--fs-2xl); line-height: 1.3; }
h4 { font-size: var(--fs-xl); }
p { color: var(--text-secondary); line-height: var(--lh-relaxed); }

.text-gradient { background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-primary); }

.container { max-width: var(--max-width); margin-inline: auto; padding-inline: var(--space-6); }
.doc-h1 { font-size: var(--fs-3xl); }
@media (max-width: 640px) {
  .doc-h1 { font-size: 1.75rem; }
  .container { padding-inline: var(--space-4); }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
}
section { padding-block: var(--space-9); }
@media (max-width: 640px) { section { padding-block: var(--space-7); } }
