/* ============================================================
   ERS ENERGY — BASE STYLES
   base.css — reset, body, typography, layout utilities
   ============================================================ */

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: var(--lh-normal);
  font-weight: var(--fw-normal);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  /* clip (not hidden): hidden makes body a scroll container and breaks
     position:sticky on the nav / sub-nav; clip trims overflow without one. */
  overflow-x: clip;
}

img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* === TYPOGRAPHY === */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(var(--type-3xl), 4vw, var(--type-5xl)); }
h2 { font-size: clamp(var(--type-2xl), 3vw, var(--type-4xl)); }
h3 { font-size: clamp(var(--type-lg), 2vw, var(--type-2xl)); }
h4 { font-size: var(--type-xl); }
h5 { font-size: var(--type-lg); }
h6 { font-size: var(--type-base); }

p {
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  max-width: 68ch;
}

/* Display headings */
.display-hero {
  font-size: clamp(var(--type-4xl), 6vw, var(--type-6xl));
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  letter-spacing: -0.04em;
}

.display-xl {
  font-size: clamp(var(--type-3xl), 4vw, var(--type-5xl));
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
}

.display-lg {
  font-size: clamp(var(--type-2xl), 3vw, var(--type-4xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
}

.section-title {
  font-size: clamp(var(--type-xl), 2.5vw, var(--type-3xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
  color: var(--text-primary);
}

.section-subtitle {
  font-size: clamp(var(--type-sm), 1.2vw, var(--type-lg));
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  max-width: 75ch;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

.section-subtitle strong,
.section-subtitle b {
  color: var(--text-primary);
  font-weight: var(--fw-semibold);
}

.section-label {
  font-size: var(--type-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: var(--sp-3);
  display: block;
}

/* Stat numbers — tabular, monospace-feel using Inter */
.stat-number {
  font-size: clamp(var(--type-3xl), 4vw, var(--type-5xl));
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-label {
  font-size: var(--type-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: var(--sp-2);
}

/* Text utilities */
.text-orange  { color: var(--accent-orange); }
.text-teal    { color: var(--accent-teal); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-white   { color: #ffffff; }
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.text-xs  { font-size: var(--type-xs); }
.text-sm  { font-size: var(--type-sm); }
.text-base { font-size: var(--type-base); }
.text-lg  { font-size: var(--type-lg); }
.text-xl  { font-size: var(--type-xl); }

.font-light    { font-weight: var(--fw-light); }
.font-normal   { font-weight: var(--fw-normal); }
.font-medium   { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold     { font-weight: var(--fw-bold); }
.font-extrabold { font-weight: var(--fw-extrabold); }

.tabular-nums  { font-variant-numeric: tabular-nums; }

/* === LAYOUT === */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: 860px;
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-py);
}

.section--sm {
  padding-block: clamp(var(--sp-10), 5vw, var(--sp-20));
}

.section--lg {
  padding-block: clamp(var(--sp-24), 10vw, 160px);
}

/* Grids */
.grid {
  display: grid;
  gap: var(--sp-6);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex utilities */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start  { justify-content: flex-start; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.flex-wrap { flex-wrap: wrap; }

/* Spacing utilities */
.mt-2  { margin-top: var(--sp-2); }
.mt-3  { margin-top: var(--sp-3); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.mt-12 { margin-top: var(--sp-12); }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-3  { margin-bottom: var(--sp-3); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }
.mx-auto { margin-inline: auto; }
.p-4   { padding: var(--sp-4); }
.p-6   { padding: var(--sp-6); }
.p-8   { padding: var(--sp-8); }
.pt-0  { padding-top: 0; }

/* Display / Visibility */
.block  { display: block; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* === MATERIAL SYMBOLS UTILS === */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
  line-height: 1;
}

.icon-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.icon-xs   { font-size: 14px; }
.icon-16   { font-size: 16px; }
.icon-sm   { font-size: 18px; }
.icon-md   { font-size: 24px; }
.icon-28   { font-size: 28px; }
.icon-lg   { font-size: 36px; }
.icon-xl   { font-size: 48px; }
.icon-2xl  { font-size: 64px; }
.icon-3xl  { font-size: 80px; }
.icon-hero { font-size: 96px; }

.icon-orange { color: var(--accent-orange); }
.icon-teal   { color: var(--accent-teal); }
.icon-inline { vertical-align: middle; }

/* === SECTION BACKGROUNDS === */
.bg-page    { background-color: var(--bg-page); }
.bg-surface { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-dark    { background-color: var(--bg-cta); }

.bg-orange-tint {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-orange) 10%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%);
}

.bg-teal-tint {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent-teal) 10%, var(--bg-surface)) 0%,
    var(--bg-surface) 100%);
}

/* Divider */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: var(--sp-12);
}
