/* ==========================================================================
   EDISON — Base Styles, Reset & Typography
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  line-height: var(--leading-base);
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  height: 100%;
  width: 100%;
  min-height: 100vh;
  background-color: var(--canvas-base);
  background-image: var(--grid-pattern);
  background-size: var(--grid-size) var(--grid-size);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  overflow-x: hidden;
  position: relative;
}

/* ---------------------------------------------------------------------------
   Accessibility: Skip Link
   --------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--canvas-pearl);
  color: var(--accent-blue);
  padding: var(--space-2) var(--space-4);
  border: var(--border-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  z-index: 99999;
  text-decoration: none;
  transition: top var(--dur-quick) var(--ease-out);
  box-shadow: var(--shadow-pop);
}

.skip-link:focus {
  top: var(--space-3);
  outline: none;
  box-shadow: var(--shadow-glow-blue);
}

/* ---------------------------------------------------------------------------
   Headings & Typography
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  margin-bottom: var(--space-2);
}

p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   Numeric Readouts & Data Typography (Mono + Tabular Nums)
   --------------------------------------------------------------------------- */
.numeric,
.data-mono,
.tabular-nums,
[data-mono] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv01" 1;
}

/* Labels and Control Room Metadata */
.eyebrow,
.panel-eyebrow,
.stat-label,
.control-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  line-height: var(--leading-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Interactive Resets & Focus States
   --------------------------------------------------------------------------- */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  transition:
    background-color var(--dur-instant) var(--ease-out),
    border-color var(--dur-instant) var(--ease-out),
    color var(--dur-instant) var(--ease-out),
    transform var(--dur-instant) var(--ease-out),
    box-shadow var(--dur-instant) var(--ease-out);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  border-color: var(--accent-blue-bright) !important;
  box-shadow: var(--focus-ring) !important;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--dur-instant) var(--ease-out);
}

a:hover {
  color: var(--accent-blue-bright);
}

/* ---------------------------------------------------------------------------
   Input, Select, Textarea
   --------------------------------------------------------------------------- */
input, select, textarea {
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background-color: var(--canvas-pearl);
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  transition: border-color var(--dur-instant) var(--ease-out), box-shadow var(--dur-instant) var(--ease-out);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

/* ---------------------------------------------------------------------------
   Custom Scrollbars
   --------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Text Selection */
::selection {
  background: var(--accent-blue-glow-strong);
  color: var(--text-primary);
}

/* SVGs */
svg {
  display: block;
  flex-shrink: 0;
}
