/* ============================================================
   Solarithm — shared design tokens + global shell
   Source of truth for palette/type: learn.html defines the same
   :root block. Do not fork these values — edit here AND there
   stay in sync, or better, treat this file as canonical going
   forward and let learn.html's own block be redundant.
   ============================================================ */

:root {
  /* Dark theme (Nov 2026). Names kept from the original light theme so
     every page re-colours from here; see --accent for button fills. */
  --sky:      #101C30;   /* raised band / hover */
  --paper:    #0A1322;   /* page background */
  --surface:  #13213A;   /* cards, panels, tables */
  --ink:      #F3F6FA;   /* main text */
  --ink-soft: #A8B6C9;   /* secondary text */
  --rule:     #26344D;   /* hairlines, borders */
  --cell:     #FFC35C;   /* links + text accents */
  --accent:   #F5A524;   /* button fill */
  --accent-hover: #FFD58A;
  --on-accent:#1A1204;   /* text on --accent */
  --photon:   #F5A524;
  --electron: #3FD08B;   /* positive values */
  --hole:     #FF7A93;   /* errors */
  color-scheme: dark;

  --display: "Archivo", system-ui, sans-serif;
  --body:    "Source Serif 4", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  --header-h: 72px;
}

/* ---------------- header ---------------- */
.shell-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.shell-header-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 100%;
}

.shell-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: 0 0 auto;
}
.shell-logo svg { width: 36px; height: 36px; display: block; }
.shell-logo span {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 700;
  font-size: 21px;
  letter-spacing: -.01em;
  color: var(--ink);
}

.shell-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 44px;
}
@media (max-width: 899px) { .shell-nav { display: none; } }

.shell-nav-item { position: relative; }
.shell-nav-link, .shell-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 14.5px;
  color: var(--ink-soft);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.shell-nav-link:hover, .shell-nav-trigger:hover,
.shell-nav-link[aria-current="page"] { color: var(--cell); }
.shell-nav-trigger svg { width: 9px; height: 9px; transition: transform .18s; }
.shell-nav-item.open .shell-nav-trigger svg,
.shell-nav-item:focus-within .shell-nav-trigger svg { transform: rotate(180deg); }

.shell-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: 228px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  padding: 7px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.shell-nav-item:hover > .shell-dropdown,
.shell-nav-item:focus-within > .shell-dropdown,
.shell-nav-item.open > .shell-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.shell-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.shell-dropdown a:hover, .shell-dropdown a:focus-visible { background: var(--sky); }
.shell-dropdown a[aria-current="page"] { color: var(--cell); }
.shell-dropdown .desc { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

.shell-spacer { flex: 1 1 auto; }

.shell-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 14px;
  color: var(--on-accent);
  background: var(--accent);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 4px;
  transition: background .15s, transform .15s;
}
.shell-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ---------------- mobile menu button + drawer ---------------- */
.shell-menu-btn {
  display: none;
  flex: 0 0 auto;
  margin-left: auto;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}
@media (max-width: 899px) { .shell-menu-btn { display: inline-flex; } }
.shell-menu-btn svg { width: 18px; height: 18px; }
.shell-menu-btn .icon-close { display: none; }
.shell-menu-btn[aria-expanded="true"] .icon-open { display: none; }
.shell-menu-btn[aria-expanded="true"] .icon-close { display: block; }

.shell-drawer {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--paper);
  overflow-y: auto;
  padding: 8px 20px 40px;
}
.shell-drawer.open { display: block; }
.shell-drawer-group { border-bottom: 1px solid var(--rule); }
.shell-drawer-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 15.5px;
  color: var(--ink);
  cursor: pointer;
}
.shell-drawer-group summary::-webkit-details-marker { display: none; }
.shell-drawer-group summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--ink-soft);
  font-size: 18px;
}
.shell-drawer-group[open] summary::after { content: "\2212"; }
.shell-drawer-group ul { list-style: none; margin: 0; padding: 0 4px 14px; }
.shell-drawer-group li + li { margin-top: 2px; }
.shell-drawer-group a {
  display: block;
  padding: 9px 8px;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 4px;
}
.shell-drawer-group a:hover, .shell-drawer-group a:focus-visible { color: var(--cell); background: var(--sky); }
.shell-drawer-flat {
  display: block;
  padding: 16px 4px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 15.5px;
  color: var(--ink);
  text-decoration: none;
}
.shell-drawer .shell-cta { display: flex; justify-content: center; margin-top: 20px; padding: 13px; font-size: 15px; }

@media (min-width: 900px) { .shell-drawer { display: none !important; } }

a.shell-nav-link:focus-visible, .shell-nav-trigger:focus-visible,
.shell-cta:focus-visible, .shell-menu-btn:focus-visible,
.shell-dropdown a:focus-visible, .shell-drawer-group summary:focus-visible,
.shell-drawer-flat:focus-visible {
  outline: 2px solid var(--photon);
  outline-offset: 2px;
}

/* ---------------- page template ---------------- */
body.shell-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.shell-hero {
  padding: 64px 24px 44px;
  background: linear-gradient(180deg, var(--sky) 0%, var(--paper) 100%);
  text-align: left;
}
.shell-hero-inner { max-width: 860px; margin: 0 auto; }
.shell-hero .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.shell-hero h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 700;
  font-size: clamp(30px, 5.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  max-width: 18ch;
}
.shell-hero h1 em { font-style: normal; color: var(--cell); }
.shell-hero .lede { color: var(--ink-soft); max-width: 62ch; margin: 0; font-size: 16.5px; }

.shell-main {
  max-width: 72ch;
  margin: 0 auto;
  padding: 48px 24px 90px;
}
.shell-main p { font-size: 16px; }

.shell-stub-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  margin-top: 8px;
}

/* ---------------- footer ---------------- */
.shell-footer {
  background: var(--sky);
  border-top: 1px solid var(--rule);
}
.shell-footer-inner { max-width: 1160px; margin: 0 auto; padding: 52px 24px 30px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 720px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-weight: 400;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li + li { margin-top: 10px; }
.footer-col a {
  font-family: var(--body);
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--cell); text-decoration: underline; }
.shell-footer-bottom a { color: var(--cell); }

.shell-footer-bottom {
  padding-top: 26px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.9;
}
.shell-footer-bottom strong { color: var(--ink); font-family: var(--body); font-weight: 600; }
.shell-footer-bottom .updated { margin-top: 10px; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------- WhatsApp floating button ---------------- */
.shell-wa {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #1FA855;          /* WhatsApp-recognisable green, darkened for AA contrast on white text */
  color: #fff;
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(16, 35, 58, .22);
  transition: transform .15s, box-shadow .15s;
}
.shell-wa:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 35, 58, .28); }
.shell-wa:focus-visible { outline: 2px solid var(--photon); outline-offset: 3px; }
.shell-wa svg { width: 22px; height: 22px; display: block; }
@media (max-width: 640px) {
  .shell-wa { padding: 13px; }
  .shell-wa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------------- lead / quote form (assets/lead-form.js) ---------------- */
.lead-box {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--photon);
  border-radius: 4px;
  background: var(--surface);
}
.lead-box h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 700;
  font-size: 19px;
  color: var(--ink);
  margin: 0 0 6px;
}
.lead-box > p { margin: 0 0 16px; color: var(--ink-soft); font-size: 15px; }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
@media (max-width: 560px) { .lead-grid { grid-template-columns: 1fr; } }
.lead-field { display: flex; flex-direction: column; gap: 5px; }
.lead-field.wide { grid-column: 1 / -1; }
.lead-field label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lead-field input, .lead-field select, .lead-field textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 10px 12px;
  width: 100%;
}
.lead-field textarea { min-height: 78px; resize: vertical; }
.lead-field input:focus, .lead-field select:focus, .lead-field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--cell) 35%, transparent);
  border-color: var(--cell);
}
.lead-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.lead-consent input { margin-top: 3px; flex: 0 0 auto; }
.lead-consent a { color: var(--cell); }
.lead-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.lead-btn {
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 600;
  font-size: 15px;
  border: 0;
  border-radius: 4px;
  padding: 12px 20px;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
}
.lead-btn:hover:not(:disabled) { background: var(--accent-hover); }
.lead-btn:disabled { opacity: .55; cursor: not-allowed; }
.lead-btn.alt { background: #1FA855; text-decoration: none; display: inline-flex; align-items: center; }
.lead-btn.alt:hover { background: #178a45; }
.lead-msg { font-size: 14px; margin-top: 10px; }
.lead-msg.err { color: var(--hole); }
.lead-msg.ok { color: var(--electron); }
.lead-done {
  padding: 6px 0;
  color: var(--ink);
}
.lead-done strong { color: var(--electron); }

/* ---------------- compact header ----------------
   Five nav items + CTA do not fit between 900px and ~1080px at full size. */
@media (min-width: 900px) and (max-width: 1079px) {
  .shell-nav { margin-left: 14px; gap: 0; }
  .shell-nav-link, .shell-nav-trigger { padding: 9px 8px; font-size: 14px; }
  .shell-header .shell-cta { padding-left: 14px; padding-right: 14px; font-size: 14px; }
}

/* Below ~400px the logo, CTA and menu button don't fit on one line; the CTA
   is still in the menu drawer, so drop the header copy. */
@media (max-width: 399px) { .shell-header .shell-cta { display: none; } }

/* ---------------- scroll reveal (shell.js) ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
/* richer hover on cards */
.feature-card, .comp-card, .supplier-card { transition: background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.comp-card:hover, .supplier-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .comp-card:hover, .supplier-card:hover { transform: none; }
}

/* ---------------- photo page headers (shell.js photoHero) ---------------- */
.shell-hero.has-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 120px 24px 72px;
  background: var(--paper);
}
.shell-hero-bg { position: absolute; inset: 0; z-index: -2; }
.shell-hero-bg img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transform: scale(1.06);
  transition: opacity .9s ease, transform 1.6s cubic-bezier(.2,.7,.2,1);
}
.shell-hero.photo-in .shell-hero-bg img { opacity: 1; transform: none; }
.shell-hero.has-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(10,19,34,.9) 0%, rgba(10,19,34,.68) 45%, rgba(10,19,34,.18) 100%),
    linear-gradient(0deg, var(--paper) 0%, rgba(10,19,34,0) 40%);
}
.shell-hero.has-photo .eyebrow, .shell-hero.has-photo .crumbs { color: var(--photon); }
.shell-hero.has-photo .crumbs a { color: var(--photon); }
.shell-hero.has-photo h1 { font-size: clamp(36px, 5.4vw, 64px); text-shadow: 0 2px 18px rgba(10,19,34,.55); }
.shell-hero.has-photo h1 em { color: var(--photon); }
.shell-hero.has-photo .lede { color: #C9D4E2; font-size: 18px; }
@media (max-width: 640px) {
  .shell-hero.has-photo { padding: 84px 20px 52px; }
  .shell-hero.has-photo::after { background: linear-gradient(0deg, var(--paper) 0%, rgba(10,19,34,.82) 40%, rgba(10,19,34,.6) 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .shell-hero-bg img { transition: none; transform: none; }
}
/* default (no photo) hero on the dark theme */
.shell-hero { background: linear-gradient(180deg, var(--sky) 0%, var(--paper) 100%); }
.shell-hero h1 em { color: var(--photon); }

/* ---------------- install-the-app prompt ---------------- */
.shell-install {
  position: fixed; left: 16px; bottom: 16px; z-index: 95;
  display: flex; align-items: center; gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--rule);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(16px); transition: opacity .35s ease, transform .35s ease;
}
.shell-install.in { opacity: 1; transform: none; }
.shell-install img { border-radius: 10px; flex: 0 0 auto; }
.shell-install div { flex: 1 1 auto; min-width: 0; }
.shell-install b { display: block; font-family: var(--display); font-variation-settings: "wdth" 110, "wght" 600; font-size: 14.5px; color: var(--ink); }
.shell-install span { display: block; font-size: 13px; color: var(--ink-soft); }
.shell-install-go {
  flex: 0 0 auto; border: 0; cursor: pointer; border-radius: 999px; padding: 9px 16px;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--display); font-variation-settings: "wdth" 110, "wght" 600; font-size: 14px;
}
.shell-install-go:hover { background: var(--accent-hover); }
.shell-install-x {
  flex: 0 0 auto; border: 0; background: none; cursor: pointer; color: var(--ink-soft);
  font-size: 22px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.shell-install-x:hover { color: var(--ink); }
.shell-install button:focus-visible { outline: 2px solid var(--photon); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .shell-install { transition: none; } }
/* when the WhatsApp button is present, sit above it on small screens */
@media (max-width: 640px) { .shell-wa ~ .shell-install { bottom: 84px; } }
/* inside the installed app, hide the "get the app" links */
.in-app a[href$="app/"] { display: none; }

/* ---------------- wide reference pages ----------------
   body.wide-page: components, suppliers, energy data, guide, glossary.
   Content spans the same 1160px frame as the home and solutions pages;
   an "On this page" nav (.toc) becomes a sticky sidebar on desktop. */
.wide-page .shell-hero-inner { max-width: 1112px; }
.wide-page .shell-main { max-width: 1160px; padding: 48px 24px 90px; }
.wide-page .shell-main p,
.wide-page .shell-main .sol-section > ul,
.wide-page .shell-main .sol-section > ol:not(.steps) { max-width: 76ch; }

@media (min-width: 1000px) {
  .wide-page .shell-main:has(> .toc) {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }
  .wide-page .shell-main:has(> .toc) > * { grid-column: 2; }
  .wide-page .shell-main > .toc {
    grid-column: 1;
    grid-row: 1 / span 40;
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 4px 0;
    border: 0;
    border-left: 1px solid var(--rule);
    margin-top: 38px;
  }
  .wide-page .shell-main > .toc::before {
    content: "On this page";
    font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-soft); padding: 0 0 10px 16px;
  }
  .wide-page .shell-main > .toc a {
    padding: 6px 0 6px 16px; margin-left: -1px;
    border-left: 2px solid transparent; color: var(--ink-soft);
    font-size: 13px; line-height: 1.35;
  }
  .wide-page .shell-main > .toc a:hover { color: var(--ink); text-decoration: none; }
  .wide-page .shell-main > .toc a.is-current { color: var(--photon); border-left-color: var(--photon); }
}

/* more columns for card grids when there is room */
@media (min-width: 900px) {
  .wide-page .comp-grid { grid-template-columns: repeat(3, 1fr); }
  .wide-page .supplier-grid { grid-template-columns: repeat(3, 1fr); }
  .wide-page .shell-main:has(> .toc) .supplier-grid { grid-template-columns: repeat(2, 1fr); }
  .wide-page .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .wide-page .shell-main:not(:has(> .toc)) .supplier-grid { grid-template-columns: repeat(4, 1fr); }
}

/* glossary: terms as a two-column card grid */
.wide-page .glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide-page .glossary .term {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 4px 22px 18px;
}
.wide-page .glossary .term dd { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
@media (max-width: 760px) { .wide-page .glossary { grid-template-columns: 1fr; } }

/* plain links inside page content: never the browser's default blue/purple */
.shell-page main a:not([class]) { color: var(--cell); }
.shell-page main a:not([class]):hover { color: var(--accent-hover); }
