/* ==========================================================================
   JuiceMyEV — Reset + base elements
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5.5vw, var(--fs-4xl)); }
h2 { font-size: clamp(1.75rem, 3.6vw, var(--fs-2xl)); letter-spacing: -0.018em; }
h3 { font-size: var(--fs-lg); letter-spacing: -0.012em; }
h4 { font-size: var(--fs-md); letter-spacing: -0.008em; }

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease),
              text-decoration-color var(--dur) var(--ease);
}

a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--line-hairline);
  margin: var(--sp-6) 0;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

table { border-collapse: collapse; width: 100%; }

::selection {
  background: var(--brand-lime);
  color: var(--brand-ink);
}

/* ---- Utility ------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.wrap--narrow { max-width: var(--wrap-narrow); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0; left: var(--sp-4);
  transform: translateY(-120%);
  z-index: 200;
  background: var(--brand-ink);
  color: var(--text-on-dark);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 0 var(--r-md) var(--r-md);
  text-decoration: none;
  font-weight: var(--fw-semi);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.section { padding-block: clamp(var(--sp-7), 8vw, var(--sp-9)); }
.section--tight { padding-block: var(--sp-7); }
.section--dark {
  background: var(--surface-inverse);
  color: var(--text-on-dark);
}
.section--dark p { color: var(--text-on-dark-2); }
.section--alt { background: var(--surface-2); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.tabular { font-variant-numeric: tabular-nums; }
