/* =========================================================================
   Renewable Innovations — site v3
   "The page powers on." Night hero → salt-flat daylight.
   ========================================================================= */

:root {
  /* Palette */
  --night: #0c1712;        /* deep spruce — hero, film, footer */
  --night-2: #13221a;
  --salt: #eceee8;         /* Bonneville salt flat — default page */
  --salt-2: #e1e5dc;       /* recessed panels */
  --paper: #f7f8f4;        /* raised surfaces */
  --ink: #13241b;          /* text on salt */
  --ink-2: #4a5a50;        /* secondary text */
  --ink-3: #7d8a81;        /* tertiary / captions */
  --rule: rgba(19, 36, 27, 0.14);
  --rule-strong: rgba(19, 36, 27, 0.32);
  --lime: #8dc63f;         /* current flowing — energy only */
  --lime-hi: #c4ec7e;
  --forest: #2f7d32;       /* actions on light */
  --forest-deep: #1f5c23;
  --sky: #a9c4cf;          /* desert sky — hydrogen, secondary data */
  --on-night: #e8eee6;
  --on-night-2: rgba(232, 238, 230, 0.62);
  --on-night-rule: rgba(232, 238, 230, 0.14);

  /* Type */
  --f-display: "Archivo", "Montserrat", system-ui, sans-serif;
  --f-body: "Montserrat", system-ui, sans-serif;
  --f-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Scale (perfect fourth-ish, fluid at the top) */
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --t-2xl: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  --t-3xl: clamp(2.75rem, 1.6rem + 4.4vw, 5.5rem);
  --t-mega: clamp(3.5rem, 1rem + 10vw, 11rem);

  /* Layout */
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --section: clamp(96px, 12vw, 200px);
  --header-h: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--salt);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--lime); color: var(--night); }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 2px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--lime); color: var(--night); padding: 10px 16px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Surfaces ---------- */
.night { background: var(--night); color: var(--on-night); }
.night ::selection { background: var(--lime); color: var(--night); }
.paper { background: var(--paper); }
.salt-2 { background: var(--salt-2); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(64px, 8vw, 120px); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 32px); }
.stack > * + * { margin-top: var(--stack, 1.25rem); }

/* Hairline engineering grid — visible column guides behind a section */
.guides { position: relative; isolation: isolate; }
.guides::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc((min(100vw, var(--max)) - 2 * var(--gutter)) / 6) 100%;
  background-position: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 0;
  opacity: 0.55;
}
.night.guides::before { background-image: linear-gradient(to right, var(--on-night-rule) 1px, transparent 1px); }

/* ---------- Type ---------- */
.display, h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
  line-height: 0.94;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--t-3xl); }
h2, .h2 { font-size: var(--t-2xl); line-height: 1; }
h3, .h3 { font-size: var(--t-xl); line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.mega {
  font-family: var(--f-display); font-size: var(--t-mega); font-weight: 900;
  font-variation-settings: "wdth" 125; line-height: 0.84; letter-spacing: -0.045em;
}
.light { font-weight: 250; }          /* RI's bold + light product-name pairing */
p { margin: 0; max-width: 64ch; text-wrap: pretty; }
.lede { font-size: var(--t-lg); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.night .lede { color: var(--on-night-2); }
.muted { color: var(--ink-2); }
.night .muted { color: var(--on-night-2); }
.caption { font-size: var(--t-sm); color: var(--ink-3); line-height: 1.5; }
.night .caption { color: var(--on-night-2); }
/* Spec data only — real units and values */
.mono { font-family: var(--f-mono); font-feature-settings: "tnum" 1, "zero" 1; letter-spacing: 0; }
.kicker { font-size: var(--t-sm); font-weight: 600; color: var(--forest); margin-bottom: 1rem; display: block; }
.night .kicker { color: var(--lime); }

/* Kinetic headline lines (SplitText masks) */
.split-line { overflow: clip; padding-bottom: 0.06em; margin-bottom: -0.06em; }

/* ---------- Buttons & links ---------- */
.btn {
  --bg: var(--forest); --fg: #fff;
  position: relative; display: inline-flex; align-items: center; gap: 0.6em;
  height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--bg); color: var(--fg); font-weight: 650; font-size: var(--t-sm);
  text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: color 0.35s var(--ease-out);
}
.btn::before { /* current fills the button from the left */
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--forest-deep);
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn--lime { --bg: var(--lime); --fg: var(--night); }
.btn--lime::before { background: var(--lime-hi); }
.btn--ghost { --bg: transparent; --fg: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.btn--ghost::before { background: currentColor; opacity: 0.1; }
.btn svg { width: 16px; height: 16px; flex: none; }

.link {
  color: var(--forest); font-weight: 650; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.45s var(--ease-out); padding-bottom: 2px;
}
.link:hover, .link:focus-visible { background-size: 100% 1.5px; }
.night .link { color: var(--lime); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  color: var(--ink);
  transition: transform 0.5s var(--ease-out), background-color 0.4s, color 0.4s, box-shadow 0.4s;
  will-change: transform;
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-solid { background: rgba(236, 238, 232, 0.86); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--rule); }
.site-header.on-night { color: var(--on-night); }
.site-header.on-night.is-solid { background: rgba(12, 23, 18, 0.78); box-shadow: 0 1px 0 var(--on-night-rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; height: 40px; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.brand .logo-white { display: none; }
.on-night .brand .logo-color { display: none; }
.on-night .brand .logo-white { display: block; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav > a:not(.btn), .nav > .nav-dd > button {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  font-size: var(--t-sm); font-weight: 600; text-decoration: none; border-radius: 999px;
  background: none; border: 0; cursor: pointer; transition: background-color 0.25s;
}
.nav > a:not(.btn):hover, .nav > .nav-dd > button:hover, .nav > a[aria-current="page"] { background: rgba(127, 140, 130, 0.14); }
.nav-dd > button svg { width: 10px; transition: transform 0.3s var(--ease-out); }
.nav-dd[data-open] > button svg { transform: rotate(180deg); }
.nav .btn { margin-left: 12px; height: 42px; padding: 0 20px; }

/* Hover bridge: the dropdown's hit area spans the full header height, so the pointer never crosses a dead zone */
.nav-dd { position: static; display: flex; align-items: center; height: var(--header-h); }
.mega-menu {
  position: fixed; left: 0; right: 0; top: var(--header-h);
  background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgba(12, 23, 18, 0.18), 0 1px 0 var(--rule) inset;
  clip-path: inset(0 0 100% 0); visibility: hidden; will-change: clip-path;
  transition: clip-path 0.42s var(--ease-io), visibility 0s 0.42s;
}
.nav-dd[data-open] .mega-menu { clip-path: inset(0 0 -40px 0); visibility: visible; transition: clip-path 0.55s var(--ease-out), visibility 0s; }
.mega-menu .wrap { display: grid; grid-template-columns: repeat(4, 1fr) 1.15fr; gap: 32px; padding-block: 40px 48px; align-items: start;
  opacity: 0; transform: translateY(-10px); transition: opacity 0.2s, transform 0.2s; }
.nav-dd[data-open] .mega-menu .wrap { opacity: 1; transform: none; transition: opacity 0.45s 0.12s, transform 0.6s 0.12s var(--ease-out); }
/* While the menu is open the header joins the panel: one solid surface */
#site-header.menu-showing { background: var(--paper); backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--ink); box-shadow: none; transform: none; }
#site-header.menu-showing .brand .logo-color { display: block; }
#site-header.menu-showing .brand .logo-white { display: none; }
.menu-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(12, 23, 18, 0.42); opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0s 0.4s; }
.menu-scrim.on { opacity: 1; visibility: visible; transition: opacity 0.4s; }
.mega-col h4 { font-family: var(--f-body); font-size: var(--t-sm); font-weight: 700; margin: 0 0 4px; }
.mega-col p { font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 14px; line-height: 1.5; }
.mega-col a { display: block; padding: 7px 0; text-decoration: none; font-size: var(--t-sm); font-weight: 500; border-top: 1px solid var(--rule); transition: color 0.2s, padding-left 0.3s var(--ease-out); }
.mega-col a:hover { color: var(--forest); padding-left: 6px; }
.mega-col a .mono { display: block; font-size: 11px; color: var(--ink-3); }
.mega-feature { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3.4; background: var(--night); color: var(--on-night); text-decoration: none; display: flex; align-items: flex-end; padding: 20px; }
.mega-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: transform 1.2s var(--ease-out); }
.mega-feature:hover img { transform: scale(1.05); }
.mega-feature span { position: relative; font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; line-height: 1; font-variation-settings: "wdth" 112; }

.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: transform 0.4s var(--ease-out), opacity 0.2s; }
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 26px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--night); color: var(--on-night);
  padding: calc(var(--header-h) + 16px) var(--gutter) 40px; overflow-y: auto;
  clip-path: circle(0 at calc(100% - 40px) 36px); visibility: hidden;
  transition: clip-path 0.7s var(--ease-io), visibility 0s 0.7s;
}
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 40px) 36px); visibility: visible; transition: clip-path 0.7s var(--ease-io); }
.menu-open .site-header { color: var(--on-night); background: transparent; box-shadow: none; }
.mobile-menu a { display: block; text-decoration: none; }
.mobile-menu .mm-big { font-family: var(--f-display); font-size: 2.4rem; font-weight: 800; font-variation-settings: "wdth" 112; line-height: 1.15; padding: 4px 0; }
.mobile-menu details summary { list-style: none; cursor: pointer; }
.mobile-menu details summary::-webkit-details-marker { display: none; }
.mobile-menu .mm-group { padding: 8px 0 16px; }
.mobile-menu .mm-group h4 { font-size: var(--t-xs); color: var(--lime); margin: 14px 0 4px; font-weight: 700; }
.mobile-menu .mm-group a { padding: 6px 0; color: var(--on-night-2); }
.mobile-menu .btn { margin-top: 28px; }

@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--on-night); padding-top: clamp(80px, 10vw, 140px); overflow: hidden; }
.footer-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: end; padding-bottom: clamp(64px, 8vw, 120px); border-bottom: 1px solid var(--on-night-rule); }
.footer-cta h2 { font-size: var(--t-3xl); }
.footer-cols { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 32px; padding-block: 64px; }
.footer-cols h4 { font-size: var(--t-xs); font-weight: 700; color: var(--lime); margin: 0 0 14px; }
.footer-cols a { display: block; text-decoration: none; color: var(--on-night-2); font-size: var(--t-sm); padding: 4px 0; transition: color 0.2s; }
.footer-cols a:hover { color: var(--on-night); }
.footer-cols address { font-style: normal; font-size: var(--t-sm); color: var(--on-night-2); line-height: 1.7; }
.footer-word {
  font-family: var(--f-display); font-weight: 900; font-variation-settings: "wdth" 125;
  font-size: 8vw; width: max-content; line-height: 0.8; letter-spacing: -0.05em; white-space: nowrap;
  background: linear-gradient(90deg, var(--lime), var(--forest)); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 0 0 -0.12em; user-select: none;
}
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 22px; font-size: var(--t-xs); color: var(--on-night-2); border-top: 1px solid var(--on-night-rule); }
.footer-legal a { color: inherit; }
@media (max-width: 900px) {
  .footer-cta { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols > :first-child { grid-column: 1 / -1; }
}

/* ---------- Shared components ---------- */

/* Page hero for interior pages */
.page-hero { position: relative; min-height: min(92vh, 900px); display: flex; align-items: flex-end; padding: calc(var(--header-h) + 64px) 0 clamp(48px, 6vw, 88px); overflow: hidden; }
.page-hero__media { position: absolute; inset: 0; z-index: 0; }
.page-hero__media img, .page-hero__media video { width: 100%; height: 100%; object-fit: cover; }
.page-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,23,18,0.55) 0%, rgba(12,23,18,0.1) 35%, rgba(12,23,18,0.82) 100%); }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { font-size: var(--t-mega); font-weight: 900; font-variation-settings: "wdth" 125; letter-spacing: -0.045em; line-height: 0.86; }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--t-xs); margin-bottom: 20px; color: var(--on-night-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--on-night); }
.crumbs span[aria-hidden] { opacity: 0.5; }

/* Datasheet spec table */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table caption { text-align: left; font-family: var(--f-display); font-weight: 700; font-size: var(--t-lg); padding-bottom: 16px; }
.spec-table th, .spec-table td { text-align: left; padding: 14px 0; border-top: 1px solid var(--rule); vertical-align: top; font-size: var(--t-sm); }
.spec-table th { font-weight: 600; color: var(--ink-2); width: 42%; padding-right: 24px; }
.spec-table td { font-family: var(--f-mono); font-feature-settings: "tnum" 1; color: var(--ink); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 1px solid var(--rule); }
.night .spec-table th { color: var(--on-night-2); }
.night .spec-table td { color: var(--on-night); }
.night .spec-table th, .night .spec-table td { border-color: var(--on-night-rule); }

/* Big stat */
.stat__value { font-family: var(--f-display); font-weight: 800; font-variation-settings: "wdth" 118; font-size: var(--t-3xl); line-height: 0.9; letter-spacing: -0.035em; }
.stat__label { font-size: var(--t-sm); color: var(--ink-2); margin-top: 12px; max-width: 26ch; }
.night .stat__label { color: var(--on-night-2); }

/* Media frame with slow inner parallax */
.frame { position: relative; overflow: hidden; border-radius: 18px; background: var(--salt-2); }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.frame[data-parallax] > img, .frame[data-parallax] > video { height: 118%; margin-top: -9%; }

/* Product card (lineup) */
.p-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.p-card .frame { aspect-ratio: 4 / 3; }
.p-card .frame img { transition: transform 1.1s var(--ease-out); }
.p-card:hover .frame img { transform: scale(1.045); }
.p-card__name { font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; font-variation-settings: "wdth" 112; line-height: 1; letter-spacing: -0.02em; }
.p-card__spec { font-family: var(--f-mono); font-size: var(--t-sm); color: var(--ink-2); }
.night .p-card__spec { color: var(--on-night-2); }

/* Marquee */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 72px; width: max-content; animation: marquee var(--marquee-dur, 60s) linear infinite; align-items: center; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--t-sm); font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-size: var(--t-base); color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule-strong); border-radius: 10px; padding: 14px 16px; transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.35); }

/* Reveal defaults: content is visible unless JS opts it into animation */
.js-motion [data-reveal] { opacity: 0; }
.js-motion [data-reveal="none"] { opacity: 1; }

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .brand img { height: 28px; }
  .grid-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@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; }
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
}
