/* ==========================================================================
   Era4 Energy — era4energy.com
   Design tokens taken from the Figma source. Mobile first.
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:300;font-display:swap;
  src:url('fonts/space-grotesk-300.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:400;font-display:swap;
  src:url('fonts/space-grotesk-400.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:500;font-display:swap;
  src:url('fonts/space-grotesk-500.woff2') format('woff2')}
@font-face{font-family:'Space Grotesk';font-style:normal;font-weight:600;font-display:swap;
  src:url('fonts/space-grotesk-600.woff2') format('woff2')}

/* --- Tokens --------------------------------------------------------------- */
:root{
  /* colour */
  --stone:#efede8;
  --white:#ffffff;
  --ink:#040404;
  --orange:#f05b2b;
  --teal:#008091;
  --ember:#421200;          /* Explore button */
  --card:rgba(255,255,255,.4);
  --rule:rgba(0,0,0,.1);
  --glass:rgba(255,255,255,.25);
  --glass-dim:rgba(255,255,255,.15);

  /* gradients, sampled from the Figma render */
  --grad-hero:linear-gradient(to top right,
      #7e0000 0%, #a80600 16%, #c81d00 34%, #e14c00 58%, #fb7e00 82%, #ff9800 100%);
  --grad-footer:linear-gradient(to bottom right,
      #b03d11 0%, #93340e 24%, #6e2409 52%, #441200 80%, #260a00 100%);

  /* type scale, fluid between 360px and 1440px */
  --fs-h1:clamp(2.25rem, 1.05rem + 5.1vw, 4rem);          /* 36 → 64 */
  --fs-lede:clamp(1.125rem, 0.98rem + 0.63vw, 1.5rem);    /* 18 → 24 */
  --fs-h2:clamp(1.625rem, 1.35rem + 1.17vw, 2.25rem);     /* 26 → 36 */
  --fs-intro:clamp(1rem, 0.95rem + 0.21vw, 1.125rem);     /* 16 → 18 */
  --fs-h3:clamp(1.25rem, 1.14rem + 0.47vw, 1.5rem);       /* 20 → 24 */
  --fs-body:1rem;
  --fs-stat:clamp(2.25rem, 1.9rem + 1.5vw, 3rem);         /* 36 → 48 */
  --fs-stat-sm:clamp(1.125rem, 0.95rem + 0.75vw, 1.5rem); /* 18 → 24 */
  --fs-small:0.875rem;

  /* spacing, 8px base */
  --s1:8px; --s2:16px; --s3:24px; --s4:32px; --s5:40px;
  --s6:48px; --s7:64px; --s8:80px; --s9:96px;
  --section-y:clamp(72px, 8.5vw, 140px);
  --gutter:clamp(24px, 4vw, 40px);
  --shell:1200px;

  --radius-card:10px;
  --radius-pill:100px;

  --ease:cubic-bezier(.22,.61,.36,1);

  /* Distance from the shell's right edge to the viewport edge. This 100vw
     fallback is a few px out when a scrollbar is present; script.js measures
     it exactly and overrides. */
  --bleed:max(0px, (100vw - var(--shell)) / 2);
}

/* --- Reset ---------------------------------------------------------------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body,h1,h2,h3,p,figure,dl,dd{margin:0}
ul{margin:0;padding:0;list-style:none}
img,svg{display:block;max-width:100%}
a{color:inherit}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

body{
  font-family:'Space Grotesk',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:var(--fs-body);
  line-height:1.5;
  color:var(--ink);
  background:var(--stone);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

/* --- Layout --------------------------------------------------------------- */
.shell{
  width:min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline:auto;
  position:relative; z-index:3;
}

/* Decorative vertical frame rules. They start where the hero ends and run to
   the footer, centred on the shell and 60px outside it. Hidden below 1360px,
   where there is no room for them. */
/* Everything below the hero is one positioned block, so a single pair of rules
   can run unbroken from the end of the hero to the foot of the page. */
.below-hero{position:relative}
.rules{position:absolute;inset:0;pointer-events:none;display:none;z-index:2}
.rules span{position:absolute;top:0;bottom:0;width:1px;background:var(--rule)}
/* The footer gradient is dark, so a black rule would vanish against it. A
   matching light pair sits over the footer to carry the line through. */
.rules--light span{background:rgba(255,255,255,.18)}
.site-footer{position:relative}
.rules span:first-child{left:calc(50% - (var(--shell) / 2) - 60px)}
.rules span:last-child{right:calc(50% - (var(--shell) / 2) - 60px)}
@media (min-width:1360px){.rules{display:block}}

.plus{width:32px;height:32px;color:var(--teal)}
/* Sits on the left rule, centred on the seam between the two sections. */
.plus--boundary{
  /* The rule is 1px wide, so its centre sits half a pixel right of its left
     edge. Without the 0.5px the cross reads as off-centre. */
  position:absolute; top:0; left:calc(50% - (var(--shell) / 2) - 60px + 0.5px);
  transform:translate(-50%,-50%); display:none; z-index:4;
}
@media (min-width:1360px){.plus--boundary{display:block}}

/* --- Buttons -------------------------------------------------------------- */
.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:12px 24px; border-radius:var(--radius-pill);
  font-size:1rem; font-weight:400; line-height:1.25;
  text-decoration:none; color:var(--white);
  transition:transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.btn:hover{transform:translateY(-2px)}
.btn:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.btn--ember{background:var(--ember)}
.btn--ember:hover{background:#5a1900;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.btn--teal{background:var(--teal)}
.btn--teal:hover{background:#006b7a;box-shadow:0 8px 24px rgba(0,128,145,.3)}
.btn svg{width:13px;height:13px;flex:none;transition:transform .25s var(--ease)}
.btn--ember:hover svg{transform:translateY(2px)}

/* --- Logo ----------------------------------------------------------------- */
.logo{display:inline-block;text-decoration:none;line-height:0}
.logo__img{width:clamp(190px,22vw,293px);height:auto}
.logo--footer .logo__img{width:clamp(118px,14vw,143px)}

/* --- Hero ----------------------------------------------------------------- */
.hero{
  position:relative; isolation:isolate; overflow:hidden;
  background:var(--grad-hero); color:var(--white);
  padding-block:clamp(32px,5vw,65px) clamp(72px,9vw,110px);
}
.hero__grid-lines{position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.5}
.hero__top{position:relative;z-index:2}
.hero__body{
  position:relative; z-index:2;
  display:grid; gap:clamp(48px,7vw,64px);
  margin-top:clamp(56px,9vw,120px);
}
.hero__text{max-width:710px}
.hero h1{
  font-size:var(--fs-h1); font-weight:600; line-height:1.14;
  letter-spacing:-.01em; text-wrap:balance;
}
.hero__lede{
  font-size:var(--fs-lede); font-weight:400; line-height:1.5;
  margin-top:clamp(28px,4.5vw,64px); max-width:670px;
}
.hero__cta{margin-top:clamp(28px,3.5vw,40px)}

/* Hero collage */
.collage{width:100%;max-width:571px;margin-inline:auto}
.collage img{width:100%;height:auto}

/* Below 1280 the collage sits under the headline, which keeps the headline on
   two lines rather than squeezing it into a half-width column.

   From 1280 the collage leaves the grid and anchors to the viewport edge, as
   it does on the artboard. That frees the headline to keep its full 710px and
   hold two lines. Widths step up so it never reaches back under the text. */
@media (min-width:1280px){
  .hero__body{display:block;position:relative}
  .hero__text{max-width:710px}
  .collage{
    position:absolute; top:50%; right:calc(var(--bleed) * -1);
    transform:translateY(-50%); width:500px; margin:0;
  }
  .hero{min-height:720px;display:flex;flex-direction:column;justify-content:flex-start}
  .hero__body{flex:1;display:flex;align-items:center}
  .hero__body > .hero__text{flex:1}
}
@media (min-width:1440px){
  .collage{width:571px}
  .hero{min-height:820px}
}

/* --- Section 2, the chain ------------------------------------------------- */
.chain{position:relative;padding-block:var(--section-y)}
.chain__head{max-width:755px}
.chain h2{font-size:var(--fs-h2);font-weight:600;line-height:1.2;text-wrap:balance}
.chain__intro{font-size:var(--fs-intro);margin-top:clamp(20px,3vw,36px)}

.cards{
  display:grid; gap:var(--s3);
  margin-top:clamp(40px,6vw,118px);
}
.card{
  background:var(--card); border-radius:var(--radius-card);
  padding:clamp(24px,3.2vw,40px);
  display:flex; flex-direction:column; gap:var(--s3);
}
.card__icon{width:32px;height:32px;flex:none;color:var(--teal)}
.card h3{font-size:var(--fs-h3);font-weight:600;line-height:1.3}
.card p{font-size:var(--fs-body);line-height:1.5}
@media (min-width:860px){.cards{grid-template-columns:repeat(3,1fr)}}

/* --- Part of Era4 --------------------------------------------------------- */
.era4{position:relative;background:var(--white);padding-block:var(--section-y)}
.era4__grid{display:grid;gap:clamp(40px,6vw,72px);align-items:center}
.era4 h2{font-size:var(--fs-h2);font-weight:600;line-height:1.2}
.era4__copy{font-size:var(--fs-intro);margin-top:clamp(20px,3vw,36px)}
.era4__copy + .era4__copy{margin-top:1.1em}
.era4__cta{margin-top:var(--s4)}

.map{width:100%;max-width:390px;margin-inline:auto}
.map img{width:100%;height:auto}

.stats{
  display:flex; flex-wrap:wrap; gap:clamp(24px,3.4vw,58px);
  margin-top:clamp(40px,5vw,55px);
}
.stat{min-width:max-content}
.stat dt{font-size:var(--fs-stat);font-weight:400;line-height:1.15;letter-spacing:-.005em}
.stat dt small{font-size:var(--fs-stat-sm);font-weight:400}
.stat dd{font-size:var(--fs-body);margin-top:var(--s1);letter-spacing:.009em}

@media (min-width:1024px){
  .era4__grid{grid-template-columns:minmax(0,320px) minmax(0,1fr);gap:clamp(48px,5vw,80px)}
  .map{margin-inline:0}
}
/* The three stats side by side need at most 538px, which is where the stat
   type and the gaps stop growing (1680px up). The whole text block is capped
   just above that, so the stats always hold one line and the paragraphs above
   never run wider than they need to. */
@media (min-width:1024px){
  .era4__text{max-width:560px}
}
@media (min-width:1280px){
  .era4__grid{grid-template-columns:minmax(0,390px) minmax(0,1fr);gap:clamp(64px,6vw,112px)}
}

/* --- Footer --------------------------------------------------------------- */
.site-footer{
  background:var(--grad-footer); color:var(--white);
  padding-block:clamp(56px,7vw,114px) clamp(48px,6vw,78px);
}
.site-footer .logo__suffix{background:var(--glass-dim);font-size:clamp(.75rem,1.4vw,.855rem);padding:3px 5px;border-radius:3px;letter-spacing:.22em}
.site-footer .logo__mark{width:clamp(44px,4.5vw,51px)}
.footer__legal{font-size:var(--fs-small);line-height:1.5;margin-top:var(--s3);max-width:800px}
/* The registered office line needs 1205px to sit on one line, which is wider
   than the 1200px container, so it always wraps. At 800px it breaks in two
   evenly; narrower and the postcode ends up alone on a third line. */
.footer__legal p{text-wrap:pretty}
.footer__legal p + p{margin-top:1.5em}
.footer__legal a{color:var(--white);text-decoration:underline;text-underline-offset:3px}
.footer__legal a:hover{text-decoration-thickness:2px}

/* --- Accessibility -------------------------------------------------------- */
.skip{
  position:absolute;left:-9999px;top:0;z-index:99;
  background:var(--ink);color:var(--white);padding:12px 20px;border-radius:0 0 8px 0;
}
.skip:focus{left:0}
:focus-visible{outline:2px solid var(--orange);outline-offset:3px}

/* --- Reveal animations ---------------------------------------------------- */
.reveal{opacity:0;transform:translateY(18px);
  transition:opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay:var(--d,0ms)}
.reveal.is-in{opacity:1;transform:none}

.hero .reveal{transform:translateY(24px)}
.collage.reveal{transform:translateY(26px) scale(.985)}
.collage.reveal.is-in{transform:none}
@media (min-width:1280px){
  .collage.reveal{transform:translateY(calc(-50% + 26px)) scale(.985)}
  .collage.reveal.is-in{transform:translateY(-50%)}
}

@media (prefers-reduced-motion:reduce){
  .reveal{opacity:1 !important;transform:none !important;transition:none !important}
  .btn,.btn svg{transition:none}
  .btn:hover{transform:none}
}
