/* ==========================================================================
   Monty: energy management for short-stay property managers
   ========================================================================== */

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Tokens --------------------------------------------------------------*/
:root {
  /* palette, lifted from the deck */
  --paper: #F4F4F2;
  --card: #FCFCFB;
  --ink: #1E1D1B;
  --ink-soft: #6C6A66;
  --clay: #D97757;
  --clay-bright: #E8734A;
  --clay-deep: #B85C3C;
  --clay-text: #8B3A22; /* AA-safe rust for small/bold text on light backgrounds */
  --clay-hover: #9C4E33;
  --blush: #F7E8E0;
  --blush-white: #FDF3EF;
  --medallion-1: #EBA98D;
  --medallion-2: #E9C6B6;
  --sand-1: #D9BFA8;
  --sand-2: #E3DACA;
  --sand-3: #EFE9DE;
  --hairline: #E4E3DF;
  --ink-on-dark: #F4F4F2;

  /* type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-h1: clamp(2.5rem, 3.2vw + 1.6rem, 5rem);
  --fs-h2: clamp(1.55rem, 1.15vw + 1.2rem, 2.35rem);
  --fs-h3: clamp(1.08rem, 0.25vw + 1rem, 1.22rem);
  --fs-lead: clamp(1rem, 0.35vw + 0.9rem, 1.16rem);
  --fs-body: 1rem;
  --fs-small: 0.9rem;
  --fs-kicker: 0.78rem;
  --fs-stat: clamp(1.55rem, 0.9vw + 1.2rem, 2.05rem);

  --lh-tight: 1.1;
  --lh-snug: 1.4;
  --lh-body: 1.65;

  /* rhythm */
  --gutter: clamp(1.5rem, 5vw, 3.5rem);
  --section-pad: clamp(3.75rem, 6.5vw, 6.25rem);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --max-w: 1180px;

  --ease-out: cubic-bezier(.2,.7,.2,1);
  --dur-reveal: 640ms;

  color-scheme: light;
}

/* ---- Base ----------------------------------------------------------------*/
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: var(--fs-h1); font-weight: 560; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }

.lead { font-size: var(--fs-lead); line-height: var(--lh-snug); color: var(--ink-soft); }

/* ---- Reveal-on-scroll ------------------------------------------------------
   Placed early so any later component rule (hover states, active states)
   naturally wins cascade ties on shared properties like `transform`. */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal].is-in { opacity: 1; transform: translateY(0); }

.section {
  padding: var(--section-pad) 0;
  position: relative;
}
.section--dark { background: var(--ink); color: var(--ink-on-dark); }
.section--dark h2, .section--dark h1 { color: var(--ink-on-dark); }

.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 3.5vw, 3.25rem); }
.section-head p { margin-top: 0.9rem; }
.section-head--center { margin-inline: auto; text-align: center; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), color 220ms var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--solid {
  background: var(--clay-deep);
  color: #FFFFFF;
}
.btn--solid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--clay-hover);
  transform: translateX(-101%);
  transition: transform 320ms var(--ease-out);
  z-index: 0;
}
.btn--solid span { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.5em; }
.btn--solid:hover::before, .btn--solid:focus-visible::before { transform: translateX(0); }
.btn--solid:hover, .btn--solid:focus-visible { box-shadow: 0 10px 24px -8px rgba(184,92,60,0.55); }

.btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--ink); color: var(--paper); }

.btn--sm { padding: 0.6em 1.2em; font-size: 0.88rem; }

.btn:focus-visible { outline: 2px solid var(--clay-deep); outline-offset: 3px; }

/* underline link */
.link-u {
  position: relative;
  font-weight: 600;
}
.link-u::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  opacity: 0.4;
  transition: transform 320ms var(--ease-out), opacity 320ms var(--ease-out);
}
.link-u:hover::after, .link-u:focus-visible::after { transform: scaleX(1); transform-origin: left; opacity: 1; }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  left: 1rem; top: -6rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75em 1.2em;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 200ms var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* ---- Nav ------------------------------------------------------------------*/
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.1rem 0;
  transition: background 320ms var(--ease-out), box-shadow 320ms var(--ease-out), padding 320ms var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(244,244,242,0.92);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 1px 0 var(--hairline);
  padding: 0.75rem 0;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex;
}
/* The full stop is part of the wordmark; it carries through to headings. */
.dot { color: var(--clay-bright); }

.site-nav { display: flex; align-items: center; gap: 2.1rem; }
.site-nav__links { display: flex; gap: 1.9rem; }
.site-nav__links a {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-soft);
  transition: color 200ms;
}
.site-nav__links a:hover, .site-nav__links a:focus-visible { color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 210;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 280ms var(--ease-out), opacity 200ms;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--blush);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms var(--ease-out), visibility 320ms;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}
.nav-overlay.is-open a { opacity: 1; transform: translateY(0); }
.nav-overlay.is-open a:nth-child(1) { transition-delay: 60ms; }
.nav-overlay.is-open a:nth-child(2) { transition-delay: 120ms; }
.nav-overlay.is-open a:nth-child(3) { transition-delay: 180ms; }
.nav-overlay.is-open a:nth-child(4) { transition-delay: 240ms; }
.nav-overlay.is-open a:nth-child(5) { transition-delay: 300ms; }
.nav-overlay .btn { opacity: 0; transform: translateY(14px); transition: opacity 420ms var(--ease-out) 360ms, transform 420ms var(--ease-out) 360ms; }
.nav-overlay.is-open .btn { opacity: 1; transform: translateY(0); }

/* Six links plus the button need ~960px on one line; below that, collapse. */
@media (max-width: 960px) {
  .site-nav__links { display: none; }
  .nav-toggle { display: flex; }
  .site-header .btn--solid.nav-cta-desktop { display: none; }
}

/* ---- Hero -------------------------------------------------------------
   A full-viewport opening statement. The sun is bottom-anchored and full
   bleed, so the horizon line doubles as the boundary with the section below.
   --sun-h drives both the graphic and the copy's bottom padding, so the two
   can never overlap at any viewport height. */
.hero {
  --sun-h: clamp(155px, 24vh, 335px);
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(6.5rem, 13vh, 10rem);
  padding-bottom: calc(var(--sun-h) + clamp(1.5rem, 3vh, 3rem));
  overflow: hidden;
  text-align: center;
}
.hero__inner { position: relative; z-index: 1; }
.hero__sun {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  height: var(--sun-h);
  width: calc(var(--sun-h) * (1200 / 500));
  min-width: 100%;
  pointer-events: none;
}
.hero__sun svg { width: 100%; height: 100%; display: block; }
/* The horizon sits outside the SVG so it always reaches both edges, however
   wide the viewport gets. */
.hero__sun::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ink);
}

.hero__title {
  font-size: clamp(2.45rem, 4.6vw + 0.8rem, 5.9rem);
  letter-spacing: -0.025em;
  line-height: 1.04;
  max-width: 19ch;
  margin-inline: auto;
  text-wrap: balance;
}
.hero__lead {
  font-size: clamp(1.15rem, 0.9vw + 0.95rem, 1.6rem);
  margin: clamp(1.75rem, 4vh, 3rem) auto 0;
  max-width: 38rem;
  text-wrap: balance;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 2rem;
  margin-top: clamp(1.75rem, 3.6vh, 3rem);
}
.hero__link { color: var(--ink); font-size: 1rem; }

/* Ongoing optimisation: the monthly fee's whole justification */
.ongoing { background: var(--card); }
.ongoing .lead { max-width: 46rem; }

/* Tariff work and capital work sit side by side, so neither reads as the
   footnote of the other. */
.ongoing__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 5vw, 4.5rem);
}
.ongoing__col { border-top: 1.5px solid var(--hairline); padding-top: clamp(1.5rem, 2.5vw, 2rem); }
.ongoing__tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
  margin-bottom: 0.9rem;
}
.ongoing__col h3 { font-size: clamp(1.18rem, 0.6vw + 1.02rem, 1.45rem); margin-bottom: 1rem; text-wrap: balance; }
.ongoing__col p:not(.ongoing__tag) { color: var(--ink-soft); }
.ongoing__list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1.5rem; }
.ongoing__list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink);
  line-height: 1.45;
}
.ongoing__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
}

@media (max-width: 820px) {
  .ongoing__split { grid-template-columns: 1fr; }
}

/* Rising sun: the disc breathes, the arcs radiate outward in sequence. */
.sun-disc { animation: throb 7s ease-in-out infinite; }
.sun-arc--1 { animation: halo 7s ease-in-out infinite; }
.sun-arc--2 { animation: halo 7s ease-in-out infinite -0.8s; }
.sun-arc--3 { animation: halo 7s ease-in-out infinite -1.6s; }

@keyframes throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes halo { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.stat-strip {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--hairline);
  padding-top: clamp(1.75rem, 3vw, 2.25rem);
}
.stat__num {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 600;
  color: var(--clay-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat__label { margin-top: 0.5rem; font-size: var(--fs-small); color: var(--ink-soft); }

/* ---- Setup band --------------------------------------------------------*/
.setup {
  text-align: center;
  overflow: hidden;
}
.setup__line {
  font-size: clamp(1.35rem, 2.4vw + 0.5rem, 2.05rem);
  max-width: 42rem;
  margin-inline: auto;
  line-height: 1.32;
}
.setup__line em { color: var(--medallion-1); font-style: normal; }
.setup-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  opacity: 0.5;
}
.setup-bg svg { position: absolute; top: 50%; left: 0; height: 140%; width: 220%; transform: translateY(-50%); animation: drift 60s linear infinite; }
@keyframes drift { from { transform: translate(0, -50%); } to { transform: translate(-33.33%, -50%); } }
.setup .wrap { position: relative; z-index: 1; }

/* ---- Steps -------------------------------------------------------------*/
.steps__rule-wrap { position: relative; margin: 0 auto clamp(2.5rem,5vw,3.5rem); max-width: 100%; }
.steps__track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); }
.steps__rail { position: absolute; top: 27px; left: 12.5%; right: 12.5%; height: 3px; background: var(--hairline); border-radius: 3px; z-index: 0; }
.steps__rail-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: var(--clay); border-radius: 3px; transition: width 60ms linear; }

.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-inline: 0.75rem; }
.step__disc {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink-soft);
  transition: background 400ms var(--ease-out), border-color 400ms var(--ease-out), color 400ms var(--ease-out), transform 400ms var(--ease-out);
  margin-bottom: 1.2rem;
}
.step.is-active .step__disc {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--blush-white);
  transform: scale(1.08);
}
.step h3 { margin-bottom: 0.6rem; }
.step p { color: var(--ink-soft); font-size: 0.96rem; max-width: 15rem; }
.step__price {
  margin-top: 1rem;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--clay-text);
  background: var(--blush);
  padding: 0.35em 0.9em;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .steps__track { grid-template-columns: 1fr; gap: 2.75rem; }
  .steps__rail { display: none; }
}

/* ---- Portfolio grid ------------------------------------------------------*/
.portfolio__grid-wrap {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 620px;
  margin-inline: auto;
}
.portfolio__houses { width: 100%; height: auto; }
.house { transform-box: fill-box; transform-origin: center bottom; opacity: 0; transform: translateY(10px) scale(0.85); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.house.is-in { opacity: 1; transform: translateY(0) scale(1); }
.house { transition-property: opacity, transform; }

/* ---- Savings / waterfall -------------------------------------------------*/
.waterfall-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}
.waterfall { width: 100%; max-width: 560px; height: auto; display: block; margin-inline: auto; }
.wf-bar { transition: height 900ms var(--ease-out), y 900ms var(--ease-out); }
.wf-label { font-size: 0.78rem; fill: var(--ink-soft); font-family: var(--font-body); }
.wf-value { font-size: 1rem; font-weight: 700; fill: var(--ink); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.wf-bracket-label { font-size: 1.15rem; font-weight: 700; fill: var(--clay-deep); font-family: var(--font-display); }

.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1.5rem; max-width: 560px; margin-inline: auto; }
.stat-card { background: var(--blush); border-radius: var(--radius-md); padding: 0.9rem 0.5rem; text-align: center; }
.stat-card__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.05rem, 1vw + 0.7rem, 1.35rem); color: var(--clay-text); }
.stat-card__label { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.3rem; }

/* ---- Where the savings come from: two explanatory figures ---------------- */
.savings-source { background: var(--card); }
.figure {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3.5vw, 3rem);
}
.figure + .figure { margin-top: clamp(1.75rem, 3.5vw, 2.75rem); }
.figure__tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
  margin-bottom: 0.8rem;
}
.figure h3 { font-size: clamp(1.22rem, 0.8vw + 1.02rem, 1.55rem); margin-bottom: 0.85rem; }
.figure__cap { color: var(--ink-soft); max-width: 52rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }

.fig-scroll { overflow-x: auto; overflow-y: hidden; }
.fig-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fig-grid line { stroke: var(--hairline); stroke-width: 1.5; }
.fig-axis { font-family: var(--font-body); font-size: 13px; fill: var(--ink-soft); text-anchor: middle; }
.fig-axis--y, .fig-axis--unit { font-size: 12px; }
.fig-note { font-family: var(--font-body); font-weight: 700; font-size: 15px; fill: var(--ink); text-anchor: middle; }
.fig-note--sm { font-weight: 600; font-size: 14px; fill: var(--ink-soft); }
.fig-note--solar { fill: var(--clay-text); }
.fig-note--peak { fill: var(--clay-text); }
.fig-note--fit { font-weight: 600; font-size: 13px; fill: var(--clay-deep); }

/* Time-of-use blocks: the ground the rate line is read against. */
.tou-band--off { fill: var(--sand-3); }
.tou-band--shoulder { fill: var(--blush); }
.tou-band--peak { fill: var(--medallion-1); opacity: 0.42; }
.tou-tick { stroke: var(--hairline); stroke-width: 1.5; }
.tou-line { fill: none; stroke: var(--ink); stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; }
.tou-fit { fill: none; stroke: var(--clay-deep); stroke-width: 2.25; stroke-dasharray: 2 7; stroke-linecap: round; }

/* A stylised day: demand, generation, and what each one covers. */
.fig-demand { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fig-solar { fill: none; stroke: var(--clay); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fig-self { fill: var(--clay); opacity: 0.28; }
/* Hatched rather than a second tan wash, so stored energy never reads as
   generation at a glance. */
.fig-batt { fill: url(#battHatch); }

.fig-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  justify-content: center;
}
.fig-legend span { display: inline-flex; align-items: center; gap: 0.5em; }
.fig-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.fig-legend .k-demand { background: var(--ink); }
.fig-legend .k-solar { background: var(--clay); }
.fig-legend .k-self { background: rgba(217, 119, 87, 0.28); }
.fig-legend .k-batt {
  background: repeating-linear-gradient(45deg, rgba(184,92,60,0.5) 0 2.5px, transparent 2.5px 6px);
  border: 1px solid var(--hairline);
}

.worked-example {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  border-left: 3px solid var(--clay);
  background: var(--card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.75rem);
}
.worked-example__tag {
.worked-example__note { margin-top: 0.9rem; font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
  margin-bottom: 0.6rem;
}
.worked-example p { color: var(--ink); font-size: 1rem; }
.worked-example strong { font-weight: 700; }

/* Below tablet the charts would scale down until the labels are unreadable.
   Hold them at a legible width and let the figure scroll instead, with the
   in-chart type stepped up to survive the reduction. */
@media (max-width: 820px) {
  .fig-svg { min-width: 560px; }
  .fig-axis { font-size: 16px; }
  .fig-axis--y, .fig-axis--unit { font-size: 15px; }
  .fig-note { font-size: 18px; }
  .fig-note--sm { font-size: 17px; }
  .fig-note--fit { font-size: 16px; }
}

.modelling-box {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  border: 1.5px solid var(--hairline);
  background: var(--blush-white);
  border-radius: var(--radius-md);
}
.modelling-box summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem clamp(1.1rem, 2.5vw, 1.6rem);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--clay-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.modelling-box summary::-webkit-details-marker { display: none; }
.modelling-box summary::before {
  content: "+";
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 400;
  transition: transform 260ms var(--ease-out);
}
.modelling-box[open] summary::before { content: "−"; }
.modelling-box summary:focus-visible { outline: 2px solid var(--clay-deep); outline-offset: 2px; border-radius: var(--radius-md); }
.modelling-box__body { padding: 0 clamp(1.1rem, 2.5vw, 1.6rem) 1.35rem; }
.modelling-box p { color: var(--ink); font-size: 0.95rem; }
.modelling-box p + p, .modelling-box p + ul, .modelling-box ul + p { margin-top: 0.7rem; }
.modelling-box__list { padding-left: 1.2rem; list-style: disc; }
.modelling-box__list li { color: var(--ink); font-size: 0.95rem; margin-bottom: 0.4rem; }
.modelling-box .callout { font-weight: 700; font-size: 1rem; font-family: var(--font-display); }

/* ---- Card linking on to the detail page ---------------------------------- */
.next-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1.5rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  padding: clamp(1.35rem, 2.5vw, 1.85rem) clamp(1.35rem, 3vw, 2rem);
  background: var(--card);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  color: var(--ink);
  transition: border-color 300ms var(--ease-out), transform 300ms var(--ease-out), background 300ms var(--ease-out);
}
.next-card:hover { border-color: var(--clay); transform: translateY(-2px); background: var(--paper); }
.next-card__tag {
  grid-column: 1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
}
.next-card__title {
  grid-column: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 0.7vw + 1rem, 1.4rem);
  margin-top: 0.35rem;
}
.next-card__desc { grid-column: 1; color: var(--ink-soft); font-size: 0.95rem; margin-top: 0.4rem; max-width: 46rem; }
.next-card__go {
  grid-column: 2;
  grid-row: 1 / 4;
  font-size: 1.5rem;
  color: var(--clay);
  transition: transform 300ms var(--ease-out);
}
.next-card:hover .next-card__go { transform: translateX(4px); }

/* ---- Who gains -----------------------------------------------------------*/
.gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
.gains__card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--hairline);
  padding: clamp(1.75rem, 3vw, 2.25rem);
  transition: transform 420ms cubic-bezier(.2,.9,.3,1.3), box-shadow 420ms var(--ease-out), border-color 420ms var(--ease-out), background 420ms var(--ease-out);
}
.gains__card:hover {
  transform: translateY(-10px) scale(1.045);
  box-shadow: 0 28px 48px -18px rgba(30,29,27,0.32);
  border-color: var(--clay);
  background: var(--blush-white);
  z-index: 2;
}
.medallion { width: 88px; height: 88px; position: relative; margin-bottom: 1.5rem; }
.medallion svg { width: 100%; height: 100%; transition: transform 420ms cubic-bezier(.2,.9,.3,1.3); }
.gains__card:hover .medallion svg { transform: scale(1.14) rotate(-6deg); }
.gains__card h3 { margin-bottom: 1rem; }
.gains__card ul { display: flex; flex-direction: column; gap: 0.85rem; }
.gains__card li { position: relative; padding-left: 1.35rem; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.45; transition: transform 320ms var(--ease-out); }
.gains__card:hover li { transform: translateX(2px); }
.gains__card li::before {
  content: '';
  position: absolute; left: 0; top: 0.6em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--clay);
  transition: transform 320ms var(--ease-out);
}
.gains__card:hover li::before { transform: scale(1.3); }

@media (max-width: 860px) { .gains { grid-template-columns: 1fr; } }

/* ---- Independence --------------------------------------------------------*/
.indep-map { max-width: 1000px; margin-inline: auto; }
.indep-diagram { width: 100%; height: auto; overflow: visible; }
.indep-node { opacity: 0; transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out); transform-box: fill-box; transform-origin: center; transform: scale(0.9); }
.indep-node.is-in { opacity: 1; transform: scale(1); }
.indep-node-label { font-family: var(--font-body); font-weight: 600; font-size: 17px; fill: var(--medallion-2); }
.indep-node-label--you { fill: var(--ink); font-size: 22px; font-weight: 700; }
.indep-node-label--monty { fill: var(--blush-white); font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.indep-caption {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--medallion-2);
}
.indep-caption--ours { fill: var(--clay); }

.lead--on-dark { color: var(--medallion-2); }

.independence__points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.point {
  display: flex; gap: 1rem; align-items: flex-start;
  opacity: 0; transform: translateY(10px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.point.is-in { opacity: 1; transform: translateY(0); }
.point__mark {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--medallion-1);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.point p { font-size: 0.97rem; }
.independence__sub {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.8vw + 1rem, 1.6rem);
  font-weight: 600;
  color: var(--ink-on-dark);
  text-align: center;
}
.independence__sub + .independence__points { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.point__mark--no { background: transparent; border: 2px solid var(--medallion-1); color: var(--medallion-1); font-size: 1rem; line-height: 1; }
.independence__note {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(244,244,242,0.18);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--medallion-2);
  text-align: center;
}

@media (max-width: 820px) {
  .independence__points { grid-template-columns: 1fr; gap: 1.25rem; }
  /* Below tablet the map would shrink until the node labels are unreadable. */
  .indep-map { overflow-x: auto; }
  .indep-diagram { min-width: 720px; }
}

/* ---- Contact section -------------------------------------------------------*/
.closing-line {
  margin-top: clamp(3rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 2.5rem);
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  max-width: 42rem;
  margin-inline: auto;
}

/* ---- Contact form -----------------------------------------------------*/
.contact-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 2.75rem);
  margin-inline: auto;
  max-width: 32rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.98rem;
  transition: border-color 200ms;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--clay-text); outline-offset: 1px; border-color: var(--clay); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 20px) center, calc(100% - 15px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field textarea { resize: vertical; min-height: 6rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-privacy { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.9rem; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.form-note { font-size: 0.82rem; color: var(--ink-soft); }
.form-status { font-size: 0.9rem; font-weight: 600; margin-top: 1rem; display: none; padding: 0.75em 1em; border-radius: var(--radius-sm); }
.form-status.is-visible { display: block; }
.form-status--ok { background: var(--blush); color: var(--clay-text); }
.form-status--err { background: #f3d9d3; color: #9c3b23; }

@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }

/* ---- Footer ---------------------------------------------------------------*/
.site-footer { background: var(--ink); color: var(--ink-on-dark); padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem; }
.footer__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid rgba(244,244,242,0.14); }
.footer__brand .wordmark { color: var(--ink-on-dark); }
.footer__brand p { color: var(--medallion-2); margin-top: 0.6rem; font-size: 0.92rem; max-width: 22rem; }
.footer__contact { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.footer__contact a { font-weight: 600; }
.footer__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.5rem; font-size: 0.82rem; color: rgba(244,244,242,0.55); }
.footer__bottom a { color: rgba(244,244,242,0.75); }
.footer__bottom a:hover { color: var(--ink-on-dark); }

@media (max-width: 600px) {
  .footer__top { flex-direction: column; }
  .footer__contact { align-items: flex-start; }
}

/* ---- Responsive: hero / layout collapses ---------------------------------*/
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { --sun-h: clamp(140px, 22vh, 215px); }
  /* On a phone the viewport is already narrower than the 19ch measure. */
  .hero__title { max-width: none; }
}
@media (max-width: 560px) {
  .stat-strip { grid-template-columns: 1fr; gap: 1.5rem; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .gains__card:hover { transform: none; }
}

.site-nav__page { font-weight: 600; }
.site-nav__page[aria-current="page"] { color: var(--clay-text); }

.portfolio__legend { margin-top: clamp(1.5rem, 3vw, 2.25rem); justify-content: center; }
.portfolio__prize {
  margin: clamp(1.5rem, 3vw, 2.25rem) auto 0;
  max-width: 34rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.6vw + 0.95rem, 1.35rem);
  line-height: 1.4;
  color: var(--ink);
}
.portfolio__prize strong { color: var(--clay-text); font-weight: 700; }
.portfolio__legend .k-tariff { background: #F7E8E0; border: 1px solid #DEB29C; }
.portfolio__legend .k-solar-house { background: #D97757; }
.portfolio__legend .k-battery-house { background: #B85C3C; }

/* ---- Questions we answer -------------------------------------------------*/
.questions { background: var(--card); }
.q-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
}
.q-card {
  background: var(--paper);
  border: 1.5px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 2.6vw, 2rem);
  transition: transform 340ms var(--ease-out), border-color 340ms var(--ease-out), box-shadow 340ms var(--ease-out);
}
.q-card:hover {
  transform: translateY(-4px);
  border-color: var(--clay);
  box-shadow: 0 18px 34px -20px rgba(30,29,27,0.28);
}
.q-card__q {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 0.5vw + 1rem, 1.28rem);
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}
.q-card__a {
  margin-top: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (max-width: 1000px) { .q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .q-grid { grid-template-columns: 1fr; } }

/* ---- Pricing --------------------------------------------------------------*/
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 1.75rem); }
.pricing__card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--hairline);
  padding: clamp(1.5rem, 3vw, 2rem);
  transition: transform 350ms var(--ease-out), box-shadow 350ms var(--ease-out);
}
.pricing__card:hover { transform: translateY(-6px); box-shadow: 0 20px 36px -18px rgba(30,29,27,0.22); }
.pricing__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 1.4vw + 1.2rem, 2.15rem); color: var(--clay-deep); margin-bottom: 0.5rem; }
.pricing__card h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.pricing__card p:not(.pricing__num) { color: var(--ink-soft); font-size: 0.95rem; }

/* The filled variant must come after the base rules: its selectors carry the
   same specificity, so source order is what decides. Ink on clay reads at
   5.4:1; the light-on-clay it replaced managed 2.9 at best. */
.pricing__card--filled { background: var(--clay); border-color: var(--clay); }
.pricing__card--filled .pricing__num,
.pricing__card--filled h3,
.pricing__card--filled p:not(.pricing__num) { color: var(--ink); }
.pricing__oncharge {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--blush);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}
.pricing__oncharge p { color: var(--ink); font-size: 0.98rem; max-width: 46rem; margin-inline: auto; }
@media (max-width: 820px) {
  .pricing { grid-template-columns: 1fr; }
}

/* ---- Legal / plain-text pages -------------------------------------------- */
.legal { padding-top: clamp(8.5rem, 16vh, 12rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.legal .wrap { max-width: 42rem; }
.legal h1 { margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.15rem; margin-top: 2.2rem; margin-bottom: 0.75rem; }
.legal p, .legal li { color: var(--ink-soft); margin-bottom: 0.9rem; }
.legal ul { padding-left: 1.2rem; list-style: disc; }

/* ---- Sub-page head and closing call to action ---------------------------- */
.page-head { padding-top: clamp(8.5rem, 16vh, 12rem); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.page-head__tag {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-text);
  margin-bottom: 1.1rem;
}
.page-head h1 { font-size: clamp(2rem, 2.6vw + 1.1rem, 3.2rem); max-width: 20ch; text-wrap: balance; }
.page-head .lead { margin-top: 1.5rem; max-width: 46rem; }
.page-head--center h1 { margin-inline: auto; }
.page-head--center .lead { margin-inline: auto; }
/* First section on a sub-page has to clear the fixed header. */
.ongoing--lead { padding-top: clamp(8.5rem, 16vh, 12rem); }
.ongoing--lead h1 { font-size: clamp(2rem, 2.6vw + 1.1rem, 3.2rem); max-width: 20ch; margin-inline: auto; text-wrap: balance; }
.page-cta { background: var(--card); }
.page-cta h2 { max-width: 30ch; margin-inline: auto; text-wrap: balance; }

/* ---- Utility ---------------------------------------------------------------*/
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
