/* Palette shared with the visualiser: blueprint navy, cyan accent, amber for heat */
:root {
  color-scheme: dark;
  --paper: #0B1620;
  --sheet: #112130;
  --sheet-2: #172B3C;
  --ink: #E3ECF1;
  --ink-2: #9DB2C1;
  --line: #24405A;
  --accent: #47C6E0;
  --on-accent: #05202A;
  --heat: #F4A13B;
  --good: #6BD6A4;
  --good-bg: #123A2E;
  --bad: #FF8C7A;
  --brick: #8A5440;
  --block: #56666F;
  --insul: #C9B44A;
  --board: #D9DDE0;

  --f-head: "Space Grotesk", system-ui, sans-serif;
  --f-body: "DM Sans", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --r: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--f-head); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  background: var(--accent); color: var(--on-accent);
  font: 600 1rem var(--f-head); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 10px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px -8px rgb(71 198 224 / .6); }
.btn:active { transform: translateY(0); }
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.1rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgb(11 22 32 / .78);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(36 64 90 / .6);
}
.nav-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 1rem var(--f-head); }
.brand b { color: var(--accent); font-weight: 700; }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem; transition: color .2s, background .2s; }
.nav nav a:hover { color: var(--ink); background: var(--sheet); }

/* Hero */
.hero { position: relative; padding: 72px 0 24px; overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgb(36 64 90 / .35) 1px, transparent 1px),
    linear-gradient(90deg, rgb(36 64 90 / .35) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
}
.hero-in { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 .85rem var(--f-mono); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--sheet); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgb(107 214 164 / .18); }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 22px 0 20px; }
h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px 32px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-stats dt { font: 500 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.hero-stats dd { margin: 4px 0 0; font: 600 1.5rem var(--f-head); }

.hero-fig { margin: 0; }
.stage { position: relative; background: linear-gradient(160deg, var(--sheet-2), var(--sheet)); border: 1px solid var(--line); border-radius: 20px; padding: 12px; box-shadow: 0 40px 80px -40px rgb(0 0 0 / .8); }
#wall { display: block; width: 100%; height: auto; }
#wall .layer { cursor: pointer; transition: transform .55s var(--ease), opacity .25s; }
#wall .layer path { transition: filter .2s; }
#wall.hovering .layer { opacity: .45; }
#wall.hovering .layer.on { opacity: 1; }
#wall .layer.on path { filter: brightness(1.18); }
#wall .lbl { font: 500 12px var(--f-mono); fill: var(--ink-2); transition: opacity .3s; pointer-events: none; }
#wall .lbl-line { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
#wall .dim { font: 500 11px var(--f-mono); fill: var(--ink-2); }

.readout {
  position: absolute; left: 20px; bottom: 20px; min-width: 200px;
  background: rgb(11 22 32 / .88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.ro-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ro-k { font: 500 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.pill { font: 600 .75rem var(--f-head); padding: 3px 10px; border-radius: 999px; }
.pill.good { background: var(--good-bg); color: var(--good); }
.ro-v { font: 600 2.4rem/1.1 var(--f-mono); margin-top: 4px; }
.ro-v small { font-size: .8rem; color: var(--ink-2); margin-left: 6px; font-weight: 400; }
.ro-layer { font: 400 .8rem var(--f-mono); color: var(--ink-2); margin-top: 6px; min-height: 1.3em; }

.explode { display: flex; align-items: center; gap: 14px; margin-top: 16px; font: 500 .85rem var(--f-mono); color: var(--ink-2); }
.explode input { flex: 1; accent-color: var(--accent); min-height: 44px; }
figcaption { margin-top: 6px; font-size: .85rem; color: var(--ink-2); }

/* Sections */
.section { padding: 96px 0; }
.section.alt { background: var(--sheet); border-block: 1px solid var(--line); }
.sec-head { max-width: 640px; margin-bottom: 48px; }
.kicker { font: 500 .8rem var(--f-mono); color: var(--accent); letter-spacing: .06em; margin-bottom: 14px; }
.sec-head h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 14px; }
.sec-head p:last-child { color: var(--ink-2); font-size: 1.05rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; position: relative; }
.step { position: relative; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 22px; transition: border-color .25s, transform .25s var(--ease); }
.step:hover { border-color: var(--accent); transform: translateY(-3px); }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font: 600 .95rem var(--f-mono); margin-bottom: 18px; }
.step h3 { font-size: 1.25rem; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: .95rem; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; display: flex; flex-direction: column; gap: 10px; transition: border-color .25s, transform .25s var(--ease); }
.card:hover { border-color: rgb(71 198 224 / .6); transform: translateY(-3px); }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--ink-2); font-size: .95rem; }
.c-wide { grid-column: span 2; }
.card-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgb(71 198 224 / .12); color: var(--accent); margin-bottom: 6px; }
.card-ic.heat { background: rgb(244 161 59 / .14); color: var(--heat); }
.card-ic.bad { background: rgb(255 140 122 / .14); color: var(--bad); }
.card-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.calc { margin-top: auto; padding-top: 12px; font: 400 .85rem var(--f-mono); display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.calc-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--ink-2); }
.calc-row.hl { color: var(--insul); }
.calc-row.tot { grid-column: 1 / -1; border-bottom: 0; border-top: 1px solid var(--accent); margin-top: 6px; padding-top: 10px; color: var(--ink); font-weight: 600; font-size: 1rem; }
.calc-row.tot span:last-child { color: var(--accent); }

.big-num { margin-top: auto; font: 600 2.6rem/1 var(--f-mono); color: var(--heat); }
.big-num small { font-size: .8rem; color: var(--ink-2); margin-left: 6px; font-weight: 400; }

.months { margin-top: auto; display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 56px; align-items: end; padding-top: 10px; border-bottom: 1px solid var(--line); }
.months i { display: block; height: calc(var(--h) * 100% + 2px); background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }

.tags { list-style: none; margin: auto 0 0; padding: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font: 500 .8rem var(--f-mono); padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }

/* In and out */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.split .sec-head { margin-bottom: 0; position: sticky; top: 100px; }
.io { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.io li { display: flex; gap: 18px; align-items: flex-start; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; transition: border-color .25s; }
.io li:hover { border-color: var(--accent); }
.io-tag { flex: none; font: 600 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: 6px; background: rgb(244 161 59 / .14); color: var(--heat); margin-top: 2px; }
.io-tag.in { background: rgb(71 198 224 / .14); color: var(--accent); }
.io h3 { font-size: 1.1rem; margin-bottom: 4px; }
.io p { color: var(--ink-2); font-size: .95rem; }

/* Standards */
.std { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.std li { background: var(--paper); padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.std b { font: 600 1rem var(--f-head); }
.std span { color: var(--ink-2); font-size: .88rem; }
.note { margin-top: 20px; font-size: .9rem; color: var(--ink-2); }

/* CTA */
.cta { padding: 112px 0; text-align: center; background:
  radial-gradient(ellipse 60% 80% at 50% 100%, rgb(71 198 224 / .16), transparent 70%); }
.cta-in { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.cta p { color: var(--ink-2); font-size: 1.1rem; margin-bottom: 12px; }

.foot { border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--ink-2); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
  .hero-in, .split { grid-template-columns: 1fr; }
  .split .sec-head { position: static; margin-bottom: 8px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: 1fr 1fr; }
  .std { grid-template-columns: repeat(2, 1fr); }
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 0 64px; }
  .section { padding: 64px 0; }
  .steps, .bento, .std { grid-template-columns: 1fr; }
  .c-wide { grid-column: auto; }
  .calc { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, auto); }
  .brand span { display: none; }
  .readout { position: static; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
