/* two-waters.co.uk — single shared stylesheet. Dark, blue/purple accent. */

:root {
  --bg: #060911;
  --bg2: #0a0f1c;
  --panel: #0f1626;
  --panel2: #141d33;
  --line: #243252;
  --text: #e9edf8;
  --muted: #9aa8c8;
  --dim: #5f6d90;
  --accent: #6c8cff;
  --accent2: #a855f7;
  --purple: #c4a5ff;
  --pv: #2dd4ee;
  --ok: #3ddc97;
  --danger: #ff6b6b;
  --radius: 14px;
  --maxw: 1080px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* subtle ambient background glow, wodniack-ish but restrained */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(760px 520px at 84% -8%, rgba(108, 140, 255, 0.16), transparent 62%),
    radial-gradient(820px 600px at -14% 32%, rgba(168, 85, 247, 0.13), transparent 62%),
    radial-gradient(640px 520px at 55% 116%, rgba(124, 92, 252, 0.11), transparent 62%);
}

::selection { background: rgba(108, 140, 255, 0.32); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; border-radius: var(--radius); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(6, 9, 17, 0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-right: auto;
  white-space: nowrap;
}
.nav .brand span { color: var(--accent); }
.nav a.nl {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav a.nl:hover { color: var(--text); text-decoration: none; }
.nav a.nl.on { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero { padding: 96px 0 64px; }
.hero .kicker {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub {
  margin-top: 22px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.1rem;
}
.hero .cta-row { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #07112b; border-color: var(--accent); }
.btn.primary:hover { background: #8aa6ff; }
.btn.pending { opacity: 0.55; cursor: default; }
.btn.pending:hover { transform: none; border-color: var(--line); }

/* ---------- sections ---------- */
section { padding: 56px 0; }
.sec-head { margin-bottom: 34px; }
.sec-head .kicker {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.sec-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.01em; margin-top: 6px; }
.sec-head p { color: var(--muted); margin-top: 10px; max-width: 62ch; }

/* ---------- stat band ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.stat .num {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat .num small { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.stat .lbl { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: block;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--accent); }
.card .tag { font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent); }
.card h3 { margin: 10px 0 8px; font-size: 1.25rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .go { display: inline-block; margin-top: 14px; color: var(--accent); font-size: 0.9rem; font-weight: 600; }

/* ---------- feature rows / prose panels ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.panel + .panel { margin-top: 16px; }
.panel h3 { font-size: 1.15rem; margin-bottom: 8px; }
.panel h3 .chip { vertical-align: 2px; }
.panel p { color: var(--muted); font-size: 0.98rem; }
.panel p + p { margin-top: 10px; }
.panel strong { color: var(--text); }

.chip {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  margin-left: 8px;
}
.chip.green { color: var(--ok); border-color: rgba(61, 220, 151, 0.35); }
.chip.amber { color: var(--accent); border-color: rgba(108, 140, 255, 0.35); }
.chip.purple { color: var(--purple); border-color: rgba(196, 165, 255, 0.35); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- spec table ---------- */
table.spec { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.spec th, table.spec td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.spec th { color: var(--dim); font-weight: 600; width: 38%; white-space: nowrap; }
table.spec td { color: var(--text); }
table.spec tr:last-child th, table.spec tr:last-child td { border-bottom: 0; }

/* ---------- timeline ---------- */
.tl { list-style: none; border-left: 2px solid var(--line); padding-left: 26px; }
.tl li { position: relative; padding-bottom: 26px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(108, 140, 255, 0.18);
}
.tl .when { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.tl h4 { margin: 3px 0 5px; font-size: 1.05rem; }
.tl p { color: var(--muted); font-size: 0.94rem; }

/* ---------- code block ---------- */
pre.code {
  background: #0a0d11;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #c9d4de;
}
pre.code .c { color: var(--dim); }
pre.code .k { color: var(--accent); }
pre.code .v { color: var(--accent2); }

/* ---------- cert list ---------- */
.cert-group { margin-bottom: 34px; }
.cert-group h3 { font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.cert {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cert .badge {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  background: rgba(108, 140, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.3);
}
.cert .badge.exp { background: rgba(196, 165, 255, 0.12); color: var(--purple); border-color: rgba(196, 165, 255, 0.3); }
.cert .badge.fun { background: rgba(61, 220, 151, 0.1); color: var(--ok); border-color: rgba(61, 220, 151, 0.28); }
.cert .body { flex: 1 1 300px; }
.cert .body h4 { font-size: 1.02rem; }
.cert .body .dates { color: var(--dim); font-size: 0.85rem; margin-top: 2px; }
.cert .status { font-size: 0.78rem; color: var(--ok); border: 1px solid rgba(61, 220, 151, 0.3); border-radius: 999px; padding: 3px 12px; white-space: nowrap; }

/* ---------- image slots ---------- */
.imgslot {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 12px, var(--panel) 12px, var(--panel) 24px);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px;
}
.imgslot.loaded { border: 0; background: none; padding: 0; min-height: 0; display: block; }
figure figcaption { color: var(--dim); font-size: 0.85rem; margin-top: 10px; }

/* ---------- wiring diagram ---------- */
.diagram-holder { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow-x: auto; }
.diagram-holder svg { display: block; min-width: 640px; width: 100%; height: auto; }

svg .box { fill: var(--panel2); stroke: var(--line); stroke-width: 1.5; rx: 10; }
svg .box.hl { stroke: var(--accent); }
svg .t { fill: var(--text); font-family: var(--font); font-size: 14px; font-weight: 600; }
svg .ts { fill: var(--muted); font-family: var(--font); font-size: 11px; font-weight: 400; }
svg .tt { fill: var(--dim); font-family: var(--font); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

svg .wire { fill: none; stroke-width: 2; }
svg .wire.sun { stroke: var(--pv); }
svg .wire.pwr { stroke: var(--accent); }
svg .wire.mon { stroke: var(--purple); stroke-dasharray: 3 5; stroke-width: 1.5; }
svg .wire.pos { stroke: var(--danger); stroke-width: 2.5; }
svg .wire.neg { stroke: var(--muted); stroke-width: 2.5; }
svg .flow { stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -14; } }
@media (prefers-reduced-motion: reduce) { svg .flow { animation: none; } }

/* ---------- scroll-animated diagram wires (JS-gated) ---------- */
html.js .diagram-holder svg .wire { stroke-dasharray: var(--len, 1600); stroke-dashoffset: var(--len, 1600); }
html.js .diagram-holder svg .wire.mon { stroke-dasharray: 3 5; stroke-dashoffset: 0; }
html.js .diagram-holder svg .wire.drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1); }
html.js .diagram-holder svg .wire.flowing { stroke-dasharray: 6 8; stroke-dashoffset: 0; transition: none; animation: flow 1.2s linear infinite; }
@keyframes flowlive { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: reduce) {
  html.js .diagram-holder svg .wire { stroke-dasharray: 0; stroke-dashoffset: 0; }
  html.js .diagram-holder svg .wire.flowing { animation: none; }
}

/* ---------- reveal on scroll (only hidden when JS is running: html.js) ---------- */
html.js .rv { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- callout ---------- */
.note {
  border-left: 3px solid var(--accent);
  background: rgba(108, 140, 255, 0.07);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 36px 0 48px;
  color: var(--dim);
  font-size: 0.9rem;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* ---------- live system panel ---------- */
.livewrap { padding: 22px 24px 20px; }
.livetop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.livetitle { font-weight: 700; letter-spacing: 0.02em; }
.livesub { color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.livepill { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ok); border: 1px solid rgba(61, 220, 151, 0.35); border-radius: 999px; padding: 5px 12px; background: rgba(61, 220, 151, 0.06); white-space: nowrap; }
.livepill.stale { color: var(--accent); border-color: rgba(108, 140, 255, 0.4); background: rgba(108, 140, 255, 0.06); }
.livepill.sample { color: var(--dim); border-color: var(--line); background: transparent; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.livepill.sample .livedot, .livepill.stale .livedot { animation: none; }
.livestats { margin: 16px 0 6px; }
.livelegend { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); margin: 2px 0 12px; }
.livelegend .sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.liveupd { margin-left: auto; color: var(--dim); }
.livechart svg { display: block; width: 100%; height: auto; }
#lv-grid line { stroke: var(--line); stroke-width: 1; }
#lv-xlabels text { fill: var(--dim); font-size: 11px; font-family: var(--font); }
.lv-genline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.lv-socline { fill: none; stroke: var(--accent2); stroke-width: 2; stroke-linejoin: round; }
#lv-nowline { stroke: var(--text); stroke-opacity: 0.25; stroke-dasharray: 3 4; }
#lv-nowdot { fill: var(--accent); }
#lv-nowlabel text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
@media (prefers-reduced-motion: reduce) { .livedot { animation: none; } }

/* ---------- eyebrow pill ---------- */
.eyebrow { display: inline-block; color: var(--accent); font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase; padding: 6px 14px; border: 1px solid rgba(108, 140, 255, 0.3); border-radius: 999px; background: rgba(108, 140, 255, 0.07); margin-bottom: 20px; }

/* ---------- section navigator (01 / 02 ...) ---------- */
.secnav { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0 8px; }
.secnav a { color: var(--dim); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; }
.secnav a:hover { color: var(--text); text-decoration: none; }
.secnav a b { color: var(--accent); font-weight: 700; margin-right: 6px; }

/* ---------- feature cards with icon ---------- */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.fcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; transition: border-color 0.18s ease, transform 0.18s ease; }
.fcard:hover { border-color: var(--accent); transform: translateY(-3px); }
.fcard .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: rgba(108, 140, 255, 0.12); border: 1px solid rgba(108, 140, 255, 0.3); color: var(--accent); }
.fcard .ic svg { width: 22px; height: 22px; display: block; }
.fcard h3 { font-size: 1.12rem; margin-bottom: 8px; }
.fcard p { color: var(--muted); font-size: 0.95rem; }

/* ---------- numbered steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.step .n { color: var(--accent); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; }
.step h4 { margin: 8px 0 6px; font-size: 1.05rem; }
.step p { color: var(--muted); font-size: 0.93rem; }

/* ---------- CTA band ---------- */
.ctaband { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; padding: 56px 40px; text-align: center; background: radial-gradient(620px 320px at 50% -25%, rgba(108, 140, 255, 0.24), transparent 60%), radial-gradient(520px 320px at 50% 125%, rgba(168, 85, 247, 0.20), transparent 60%), var(--panel); }
.ctaband h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
.ctaband p { color: var(--muted); max-width: 54ch; margin: 12px auto 26px; }

/* ---------- FAQ accordion (native details) ---------- */
.faq { border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 4px; font-weight: 600; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.5rem; font-weight: 400; line-height: 1; transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > p { color: var(--muted); padding: 0 4px 22px; font-size: 0.98rem; max-width: 74ch; }

/* ---------- big footer ---------- */
.footgrid { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.3fr; gap: 32px; }
.footbrand { font-weight: 700; font-size: 1.15rem; margin-bottom: 12px; color: var(--text); }
.footbrand span { color: var(--accent); }
.footcol h4 { color: var(--text); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.footcol a { display: block; color: var(--muted); margin-bottom: 9px; font-size: 0.92rem; }
.footcol a:hover { color: var(--accent); text-decoration: none; }
.footcol p { color: var(--dim); font-size: 0.9rem; margin-bottom: 9px; max-width: 34ch; }
.footbar { max-width: var(--maxw); margin: 30px auto 0; padding: 20px 24px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-size: 0.85rem; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .footgrid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .nav-inner { flex-wrap: wrap; gap: 10px 18px; }
  .nav-toggle { display: block; order: 2; }
  .nav .links { display: none; width: 100%; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
  .nav .links.open { display: flex; }
  .nav .links { order: 3; }
  .hero { padding: 64px 0 40px; }
  .grid2 { grid-template-columns: 1fr; }
  section { padding: 40px 0; }
}
@media (min-width: 761px) {
  .nav .links { display: flex; gap: 24px; }
}
