/* ============================================================
   Base styles - New Energy Products Site
   Reset · typography · layout primitives · components
   ============================================================ */

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm, 8px);
  background: var(--accent, #e8871e);
  color: #fff;
  font: 600 0.9rem/1 var(--font-ui, inherit);
  text-decoration: none;
}
.skip-link:focus {
  left: 8px;
}

/* ---- Form placeholders keep readable contrast ---- */
.field ::placeholder,
.contact-form ::placeholder {
  color: var(--ink-mute);
  opacity: 1;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--ink); }

/* ---- Typography ---- */
h1, h2, h3 { line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); text-wrap: balance; }
.display { font-size: var(--text-display); font-weight: 700; }
.h1 { font-size: var(--text-h1); font-weight: 700; }
.h2 { font-size: var(--text-h2); font-weight: 700; }
.h3 { font-size: var(--text-h3); font-weight: 650; }
p { max-width: 65ch; }
.lead { font-size: var(--text-body-lg); color: var(--ink-dim); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Mono micro-label (eyebrow) - rationed: max 1 per 3 sections */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.label::before { content: ""; width: 3px; height: 3px; background: var(--accent); }

/* ---- Layout ---- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: var(--section-pad); }
.section-head { max-width: 46rem; margin-bottom: var(--space-8); }
.section-head .h2 { margin-top: var(--space-3); }
.section-head .lead { margin-top: var(--space-4); }

/* Split layout: sticky heading left, stacked rows right */
.split { display: grid; gap: var(--space-8); }
@media (min-width: 900px) {
  .split { grid-template-columns: 5fr 7fr; gap: var(--space-9); }
  .split-sticky { position: sticky; top: calc(var(--nav-h) + var(--space-6)); align-self: start; }
}

/* ---- Header / Nav (single line, <=72px) ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(250, 250, 249, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 700; letter-spacing: var(--tracking-tight); }
.brand-mark { width: 28px; height: 28px; border: 1.5px solid var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; }
.nav-links { display: none; align-items: center; gap: var(--space-6); font-size: var(--text-sm); font-weight: 500; }
.nav-links a { position: relative; color: var(--ink-dim); transition: color var(--dur); padding-block: 4px; white-space: nowrap; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }

/* ---- Dropdown submenu (hover / click / focus-within; mobile uses <details>) ---- */
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.chev { width: 11px; height: 11px; transition: transform var(--dur); flex-shrink: 0; opacity: 0.75; }
.has-dropdown:hover .chev, .has-dropdown:focus-within .chev, .has-dropdown.open .chev { transform: rotate(180deg); }
.dropdown { position: absolute; top: calc(100% + 2px); left: 0; padding-top: 10px; display: none; z-index: 60; }
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown, .has-dropdown.open .dropdown { display: block; }
.dropdown-panel {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 250px;
  padding: 6px;
  display: grid;
  gap: 2px;
  box-shadow: 0 18px 44px -20px rgba(28, 28, 31, 0.22);
}
.dropdown a { display: block; padding: 10px 12px; border-radius: 6px; transition: background var(--dur); }
.dropdown a::after { display: none; } /* dropdown items don't take the nav underline */
.dropdown a:hover { background: rgba(28, 28, 31, 0.06); }
.dropdown a .t { display: block; font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.dropdown a .d { display: block; font-size: var(--text-caption); color: var(--ink-mute); margin-top: 2px; }

/* ---- Grouped dropdown sections (3-level menu) ---- */
.dropdown-section { padding: 6px 4px; }
.dropdown-section + .dropdown-section { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.dropdown-section .dropdown-label { padding: 4px 12px; font-size: var(--text-caption); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); }
.dropdown-section a { padding: 8px 12px; }

/* ---- Mobile sub-nav (native <details>) ---- */
.mobile-sub summary { list-style: none; cursor: pointer; font-size: var(--text-h3); font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.mobile-sub summary::-webkit-details-marker { display: none; }
.mobile-sub summary .chev { transform: rotate(90deg); transition: transform var(--dur); }
.mobile-sub[open] summary .chev { transform: rotate(270deg); }
.mobile-sub .sub-links { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0 var(--space-3); padding-left: var(--space-4); border-left: 2px solid var(--line); }
.mobile-sub .sub-links a { font-size: var(--text-body); font-weight: 500; color: var(--ink-dim); }
.mobile-sub-sub summary { font-size: var(--text-sm); font-weight: 600; color: var(--ink-mute); padding: var(--space-2) 0; text-transform: uppercase; letter-spacing: 0.04em; }
.mobile-sub-sub summary::after { content: '+'; margin-left: auto; color: var(--ink-mute); }
.mobile-sub-sub[open] summary::after { content: '−'; }
.mobile-sub-sub .sub-links { padding-left: var(--space-3); border-left-width: 1px; }

/* ---- Breadcrumbs (3-level navigation trail) ---- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-caption); color: var(--ink-mute); margin-bottom: var(--space-5); }
.breadcrumbs a { color: var(--ink-mute); text-decoration: none; transition: color var(--dur); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--ink-mute); opacity: 0.55; }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav-cta { display: none; }
.nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .ic-close { display: none; }
body.nav-open .nav-toggle .ic-menu { display: none; }
body.nav-open .nav-toggle .ic-close { display: block; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* Mobile nav overlay */
.mobile-nav {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 49;
  background: var(--bg);
  padding: var(--space-7) clamp(1rem, 4vw, 2rem);
  display: none;
  flex-direction: column; gap: var(--space-5);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-size: var(--text-h3); font-weight: 650; color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-control);
  font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.01em;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform var(--dur);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #E8860A; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-dark-ghost { border: 1px solid var(--line-dark); color: var(--ink-dark); }
.btn-dark-ghost:hover { background: var(--surface-2-dark); }

/* ---- Cards (radius 0, hairline border, no shadow) ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color var(--dur), transform var(--dur);
}
.card:hover { border-color: var(--accent); }
.card-pad { padding: var(--space-6); }
@media (min-width: 900px) { .card-pad-lg { padding: var(--space-8); } }

/* ---- Spec / data rows (mono numbers, hairline dividers) ---- */
.spec-list { display: grid; }
.spec-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.spec-row:first-child { border-top: 1px solid var(--line); }
.spec-row dt { font-size: var(--text-sm); color: var(--ink-dim); }
.spec-row dd { font-family: var(--font-mono); font-size: var(--text-h3); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Stat band (light) */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat .num { font-family: var(--font-mono); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: var(--text-sm); color: var(--ink-mute); margin-top: var(--space-1); }

/* Light bands (competitor-aligned: light-first, dark footer only) */
.band { background: var(--band-soft); padding-block: var(--space-9); }
.band-tint { background: var(--band-tint); padding-block: var(--section-pad); }
.band .lead, .band-tint .lead { color: var(--ink-dim); }

/* ---- Dark sections ---- */
.dark { background: var(--bg-dark); color: var(--ink-dark); }
.dark .lead { color: var(--ink-dim-dark); }
.dark .label { color: var(--ink-dim-dark); }
.dark .label::before { background: var(--accent-dark); }

/* ---- Full-screen video hero (index only) ----
   taste-skill: full-viewport (100dvh, viewport-stable), video full-bleed,
   asymmetric overlay (not centered), scrim for text contrast. */
.hero-full { position: relative; min-height: 100dvh; display: flex; align-items: flex-start; overflow: hidden; background: #0B0B0D; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,5,7,0.72) 0%, rgba(5,5,7,0.55) 38%, rgba(5,5,7,0.34) 58%, rgba(5,5,7,0.14) 78%, rgba(250,250,249,0.08) 100%);
}
.hero-content { position: relative; width: 100%; padding-top: clamp(4.5rem, 10vh, 7rem); padding-bottom: clamp(3rem, 8vh, 6rem); display: grid; gap: var(--space-8); align-items: start; }
@media (min-width: 900px) { .hero-content { grid-template-columns: 7fr 5fr; gap: var(--space-9); } }
.hero-title { color: var(--ink-dark); max-width: 13ch; line-height: 1.09; text-shadow: 0 2px 30px rgba(0,0,0,0.45); }
.hero-lead { color: rgba(247,247,245,0.92); text-shadow: 0 1px 14px rgba(0,0,0,0.45); }
.hero-label { color: rgba(247,247,245,0.9); }
.hero-label::before { background: var(--accent-dark); }
.btn-glass { border: 1.5px solid rgba(255,255,255,0.55); color: var(--ink-dark); background: rgba(255,255,255,0.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-shadow: 0 1px 8px rgba(0,0,0,0.4); }
.btn-glass:hover { background: rgba(255,255,255,0.24); }
.hero-panel {
  background: rgba(13,13,15,0.5);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 10px;
  padding: var(--space-6);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.5);
}
.hero-panel .spec-row { border-color: rgba(255,255,255,0.12); }
.hero-panel dt { color: rgba(247,247,245,0.78); }
.hero-panel dd { color: var(--accent-dark); font-size: var(--text-h3); }
.hero-panel .small { color: rgba(247,247,245,0.55); }
@media (prefers-reduced-motion: reduce) {
  .hero-video { animation: none; }
}

/* ---- Hero (light, competitor-aligned) ---- */
.hero { padding-block: clamp(4.5rem, 9vw, 7.5rem) var(--section-pad); overflow: hidden; position: relative; }
.hero .container > h1 { max-width: 18ch; }
.hero .container > .lead { max-width: 48ch; }
.hero::before {  /* soft amber ambient glow, not neon */
  content: ""; position: absolute; top: -30%; right: -12%; width: 55%; height: 90%;
  background: radial-gradient(closest-side, var(--hero-glow), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; gap: var(--space-9); position: relative; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 7fr 5fr; align-items: center; } }
.hero .display { max-width: 14ch; }
.hero .lead { margin-top: var(--space-5); max-width: 42ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }

/* ---- Cert / trust bar (logo-only, under hero) ---- */
.cert-bar { border-block: 1px solid var(--line); background: var(--surface); }
.cert-bar .container { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); padding-block: var(--space-5); }
.cert-mark { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.08em; color: var(--ink-mute); }
/* TODO: replace text marks with real certification SVG logos */

/* ---- Product category cards ---- */
.product-grid { display: grid; gap: var(--space-6); }
@media (min-width: 900px) { .product-grid { grid-template-columns: 1fr 1fr; } }
.product-card { position: relative; display: flex; flex-direction: column; }
.product-card .card-pad { flex: 1; display: flex; flex-direction: column; }
.product-card .h3 { margin-top: var(--space-4); }
.product-card .lead { margin-top: var(--space-3); font-size: var(--text-sm); }
.product-card .spec-mini { margin-top: auto; padding-top: var(--space-6); }
.spec-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-5); }
.spec-mini div { font-size: var(--text-sm); }
.spec-mini .k { font-family: var(--font-mono); font-size: var(--text-caption); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); }
.spec-mini .v { margin-top: 2px; font-weight: 600; }
.product-card .btn { align-self: flex-start; margin-top: var(--space-6); }

/* ---- Product card image ---- */
.card-img { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.card:hover .card-img img { transform: scale(1.04); }
/* Render images (product renders on dark backgrounds): contain + light frame */
.card-img--contain { background: linear-gradient(180deg, #FFFFFF, #F6F6F4); }
.card-img--contain img { object-fit: contain; padding: 10px; }

/* ---- Feature rows (bordered stacks, not cards) ---- */
.feature-row { display: grid; gap: var(--space-4); padding-block: var(--space-7); border-top: 1px solid var(--line); }
.feature-row:first-child { border-top: 0; }
@media (min-width: 900px) { .feature-row { grid-template-columns: 5fr 7fr; gap: var(--space-9); } }
.feature-row h3 { font-size: var(--text-h3); font-weight: 650; }
.feature-row p { color: var(--ink-dim); margin-top: var(--space-3); }

/* ---- Application splits (max 2 consecutive) ---- */
.app-row { display: grid; gap: var(--space-6); align-items: center; }
@media (min-width: 900px) { .app-row { grid-template-columns: 1fr 1fr; gap: var(--space-9); } }
.app-row:nth-child(even) .app-media { order: 2; }
@media (min-width: 900px) { .app-row:nth-child(even) .app-media { order: 1; } }
.app-media { background: var(--surface-2); border: 1px solid var(--line); aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.app-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.app-media:hover img { transform: scale(1.04); }
.app-row .lead { margin-top: var(--space-4); }
.app-row .btn { margin-top: var(--space-5); }

/* ---- CTA band (light amber tint) ---- */
.cta-band { text-align: left; }
.cta-band .display { max-width: 18ch; }
.cta-band .lead { margin-top: var(--space-4); max-width: 44ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }

/* ---- Footer (dark, 3 columns max) ---- */
.site-footer { background: var(--bg-dark); color: var(--ink-dark); padding-top: var(--space-9); }
.footer-grid { display: grid; gap: var(--space-8); padding-bottom: var(--space-8); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; } }
.footer-brand .lead { margin-top: var(--space-4); font-size: var(--text-sm); }
.footer-col h4 { font-family: var(--font-mono); font-size: var(--text-caption); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-dim-dark); margin-bottom: var(--space-4); }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.footer-col a { font-size: var(--text-sm); color: var(--ink-dim-dark); transition: color var(--dur); }
.footer-col a:hover { color: var(--ink-dark); }
.footer-bottom { border-top: 1px solid var(--line-dark); padding-block: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; font-size: var(--text-caption); color: var(--ink-dim-dark); }

/* ---- 404: full-height layout (footer pinned to bottom, no orphan strip) ---- */
.page-404 { display: flex; flex-direction: column; min-height: 100dvh; }
.page-404 main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.page-404 .hero { padding-block: clamp(4rem, 9vh, 7rem); }

/* ---- Scroll reveal (gated by reduced motion) ---- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Anchored sections clear the sticky header */
section[id], div[id] { scroll-margin-top: calc(var(--nav-h) + 20px); }
