:root {
  --ink: #173342;
  --muted: #5e727a;
  --line: #d9e3e3;
  --paper: #f3f6f5;
  --white: #fff;
  --warm: #fff3b0;
  --accent: #9e2a2b;
  --accent-dark: #540b0e;
  --teal: #335c67;
  --teal-soft: #d9e3e3;
  --tan: #e09f3e;
  --navy: #10384a;
  --window: #335c67;
  --shadow: 0 20px 55px rgba(23, 51, 66, .10);
  --radius: 18px;
  --max: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(24px, 5vw, 76px);
  background: rgba(243, 246, 245, .94);
  border-bottom: 1px solid rgba(23, 51, 66, .14);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { display: block; width: 210px; height: 50px; object-fit: contain; object-position: left center; }
.header-actions { display: flex; align-items: center; gap: 30px; }
.header-actions > a:not(.button) { font-size: 14px; font-weight: 600; text-decoration: none; }
.header-actions > a:not(.button):hover { color: var(--accent); }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 23px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-2px); background: var(--accent-dark); box-shadow: 0 10px 24px rgba(84, 11, 14, .23); }
.button:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(158, 42, 43, .28); outline-offset: 3px; }
.button-small { min-height: 40px; padding: 0 18px; font-size: 13px; }
.button-inverse { background: #fff; border-color: #fff; color: var(--teal); white-space: nowrap; }
.button-inverse:hover { background: var(--paper); color: var(--teal); }

main { overflow: hidden; }
.hero {
  max-width: var(--max);
  min-height: 655px;
  margin: 0 auto;
  padding: 90px clamp(24px, 5vw, 76px) 110px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(480px, 1.05fr);
  gap: 42px;
  align-items: center;
}
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 12px; line-height: 1.4; letter-spacing: .18em; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Inter, "Segoe UI", Arial, sans-serif; letter-spacing: -.035em; }
h1 { max-width: 750px; margin-bottom: 24px; font-size: clamp(46px, 5vw, 76px); line-height: 1.03; font-weight: 500; }
h1 em { color: var(--teal); font-style: normal; }
.hero-lede { max-width: 655px; margin-bottom: 32px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 23px; flex-wrap: wrap; }
.scenario-badge { color: var(--muted); font-size: 13px; }
.scenario-badge strong { color: var(--ink); font-size: 17px; }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: 4% 2% 7% 10%; border-radius: 50%; background: rgba(217, 227, 227, .72); filter: blur(1px); transform: rotate(-5deg); }
.hero-visual svg { position: relative; display: block; width: 100%; height: auto; }

.type-section, .explorer-section { max-width: var(--max); margin: 0 auto; padding: 0 clamp(24px, 5vw, 76px) 110px; }
.type-section { padding-top: 35px; }
.section-heading { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 44px; }
.section-heading.compact { margin-bottom: 28px; }
.section-heading .step { width: 42px; height: 42px; display: grid; place-items: center; margin: 0; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-size: 12px; font-weight: 700; }
.section-heading h2 { max-width: 880px; margin-bottom: 10px; font-size: clamp(31px, 3.2vw, 47px); line-height: 1.14; font-weight: 500; }
.section-heading > div > p:last-child { max-width: 760px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.type-card {
  min-height: 122px;
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.type-card.active { border-color: var(--accent); box-shadow: 0 10px 35px rgba(23, 51, 66, .08); }
.type-card.future { opacity: .62; cursor: not-allowed; }
.type-card strong { display: block; margin-bottom: 6px; font-size: 16px; }
.type-card small { display: block; color: var(--muted); line-height: 1.35; }
.card-status { position: absolute; top: 13px; right: 13px; padding: 4px 8px; color: var(--muted); background: var(--paper); border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.active .card-status { color: #fff; background: var(--accent); }
.type-icon { width: 74px; height: 60px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding: 8px; background: var(--teal-soft); border-radius: 10px; }
.type-icon i { display: block; width: 15px; height: 28px; border: 2px solid var(--teal); border-bottom: 0; }
.type-icon i::after { content: ""; display: block; width: 5px; height: 7px; margin: 7px auto 0; background: var(--teal); }
.low-rise-res i:nth-child(2) { height: 36px; }
.warehouse { align-items: center; gap: 2px; }
.warehouse i { width: 18px; height: 27px; border-bottom: 2px solid var(--teal); }
.warehouse i:first-child { width: 7px; height: 39px; border-radius: 2px 2px 0 0; }
.warehouse i::after { width: 7px; height: 9px; margin-top: 6px; }
.high-rise i { width: 10px; }
.high-rise i:nth-child(2), .high-rise i:nth-child(3) { height: 48px; }

.explorer-section { padding-top: 100px; }
.explorer-grid { display: grid; grid-template-columns: minmax(330px, .7fr) minmax(520px, 1.3fr); gap: 20px; align-items: stretch; }
.controls-panel, .visual-panel, .results-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.controls-panel { padding: 27px 30px 24px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 17px; }
.panel-title-row h3 { margin: 0; font-size: 19px; }
.text-button { padding: 3px 0; border: 0; color: var(--accent); background: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.control-group { margin: 0; padding: 20px 0; border: 0; border-top: 1px solid var(--line); }
.control-group.last { padding-bottom: 2px; }
.control-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.control-label-row label, .option-group legend { font-size: 13px; font-weight: 700; }
.control-label-row output { color: var(--accent); font-size: 13px; font-weight: 700; }
input[type="range"] {
  width: 100%;
  height: 19px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(to right, var(--accent) var(--range-progress, 33%), var(--line) var(--range-progress, 33%)); border-radius: 3px; }
input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -6px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); -webkit-appearance: none; }
input[type="range"]::-moz-range-track { height: 3px; background: var(--line); border-radius: 3px; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; margin-top: 1px; color: #8a9498; font-size: 10px; }
.option-group legend { margin-bottom: 12px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.segmented label { min-width: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; font-size: 11px; text-align: center; cursor: pointer; transition: .15s ease; }
.segmented input:checked + span { color: var(--accent-dark); border-color: var(--accent); background: rgba(255, 243, 176, .48); font-weight: 700; }
.segmented input:focus-visible + span { outline: 3px solid rgba(158, 42, 43, .22); outline-offset: 2px; }
.segmented i { display: block; position: relative; width: 28px; height: 16px; border-bottom: 2px solid currentColor; }
.roof-flat::before { content: ""; position: absolute; left: 2px; right: 2px; bottom: 8px; border-top: 2px solid currentColor; }
.roof-cathedral::before { content: ""; position: absolute; left: 5px; top: 4px; width: 18px; height: 18px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.roof-slope::before { content: ""; position: absolute; left: 3px; top: 5px; width: 23px; border-top: 2px solid currentColor; transform: rotate(-13deg); }
.shape-options i { border: 2px solid currentColor; height: 18px; }
.shape-l { border-right: 0 !important; border-top: 0 !important; }
.shape-l::before { content: ""; position: absolute; right: 0; bottom: -2px; width: 14px; border-bottom: 6px solid currentColor; }
.shape-u { border-top: 0 !important; }

.visual-panel { min-width: 0; padding: 27px 30px 18px; display: flex; flex-direction: column; }
.visual-title { margin-bottom: 0; }
.visual-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.match-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--teal); background: var(--teal-soft); border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.match-status i { width: 7px; height: 7px; border-radius: 50%; background: #4a857d; box-shadow: 0 0 0 4px rgba(74, 133, 125, .13); }
.building-stage { min-height: 450px; flex: 1; display: grid; place-items: center; overflow: hidden; }
.building-stage svg { width: 100%; height: auto; max-height: 465px; overflow: visible; }
.building-stage svg * { vector-effect: non-scaling-stroke; }
.building-stage .building-part { transition: d .26s ease, fill .24s ease, transform .26s ease; }
.visual-footnote { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }

.results-panel { margin-top: 20px; display: grid; grid-template-columns: 1.08fr repeat(4, 1fr); overflow: hidden; }
.results-intro, .metric-card { min-width: 0; padding: 25px; }
.results-intro { background: var(--teal); color: #fff; }
.results-intro .eyebrow { color: var(--warm); }
.results-intro h3 { margin-bottom: 12px; font-size: 24px; }
.results-intro p:not(.eyebrow) { color: #dbe6e2; font-size: 12px; line-height: 1.6; }
.simulation-id { display: inline-block; margin-top: 9px; padding: 6px 9px; color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-card { border-left: 1px solid var(--line); }
.metric-top { min-height: 33px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.info-button { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; border: 1px solid #bdc6c2; border-radius: 50%; font-family: Georgia, serif; font-size: 11px; cursor: help; }
.metric-card strong { display: block; margin-top: 9px; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: clamp(26px, 2.3vw, 38px); line-height: 1; letter-spacing: -.04em; }
.metric-card small { display: block; margin-top: 7px; min-height: 20px; color: var(--muted); font-size: 11px; }
.metric-card p { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.metric-bar { height: 3px; margin-top: 12px; background: #e4e9e6; overflow: hidden; }
.metric-bar i { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }

.method-section { margin-top: 20px; padding: 100px max(24px, calc((100vw - var(--max)) / 2 + clamp(24px, 5vw, 76px))) 110px; color: #fff; background: var(--navy); }
.section-heading.light .step { border-color: var(--warm); color: var(--warm); }
.section-heading.light h2 { max-width: 760px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.15); }
.method-grid article { min-height: 240px; padding: 30px; background: var(--navy); }
.method-grid article > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 35px; border-radius: 50%; color: var(--ink); background: #fff; font-weight: 700; }
.method-grid h3 { font-size: 20px; }
.method-grid p { margin: 0; color: #c9d1d2; line-height: 1.7; font-size: 14px; }

.cta-section { max-width: calc(var(--max) - 2 * clamp(24px, 5vw, 76px)); margin: 95px auto 25px; padding: 45px 50px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px 50px; color: #fff; background: var(--teal); border-radius: 20px; }
.cta-section .eyebrow { color: var(--warm); }
.cta-section h2 { margin-bottom: 10px; font-size: clamp(31px, 3.3vw, 48px); font-weight: 500; }
.cta-section p:not(.eyebrow):not(.copy-status) { max-width: 760px; margin-bottom: 0; color: #d9e7e4; line-height: 1.65; }
.copy-status { grid-column: 1 / -1; min-height: 18px; margin: -5px 0 0; color: #fff; font-size: 12px; }
.disclaimer { max-width: calc(var(--max) - 2 * clamp(24px, 5vw, 76px)); margin: 0 auto 90px; padding: 19px 23px; display: grid; grid-template-columns: 170px 1fr; gap: 22px; color: var(--muted); background: rgba(255, 243, 176, .42); border-radius: 12px; font-size: 12px; line-height: 1.6; }
.disclaimer strong { color: var(--ink); }
.disclaimer p { margin: 0; }

.site-footer { min-height: 110px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 25px clamp(24px, 5vw, 76px); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-brand { color: var(--ink); }
.footer-brand .brand-logo { width: 170px; height: 46px; }

.tooltip { position: fixed; z-index: 50; max-width: 260px; padding: 10px 12px; color: #fff; background: var(--ink); border-radius: 8px; box-shadow: 0 8px 25px rgba(0,0,0,.18); font-size: 12px; line-height: 1.45; pointer-events: none; }

.terms-consent { max-width: calc(var(--max) - 2 * clamp(24px, 5vw, 76px)); margin: 5px auto 0; padding: 28px 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); gap: 18px 42px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.terms-consent-copy h2 { margin-bottom: 8px; font-size: 24px; font-weight: 600; }
.terms-consent-copy p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.terms-consent a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }
.terms-check { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; color: var(--ink); background: rgba(255, 243, 176, .34); border: 1px solid rgba(158, 42, 43, .22); border-radius: 12px; line-height: 1.5; cursor: pointer; }
.terms-check input { width: 19px; height: 19px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--accent); }
.terms-consent-status { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 12px; }
.terms-consent-status.accepted { color: var(--teal); font-weight: 700; }
.explorer-section.explorer-locked .controls-panel { opacity: .56; }
.explorer-section.explorer-locked .controls-panel::after { content: "Agree to the Terms and Conditions above to use the interactive controls."; display: block; margin-top: 18px; padding: 12px 14px; color: var(--accent-dark); background: rgba(255, 243, 176, .48); border-radius: 9px; font-size: 12px; font-weight: 700; line-height: 1.45; }
.explorer-section.explorer-locked .controls-panel input, .explorer-section.explorer-locked .controls-panel button { cursor: not-allowed; }
@media (max-width: 860px) { .terms-consent { margin-left: 24px; margin-right: 24px; grid-template-columns: 1fr; } }
@media (max-width: 560px) { .terms-consent { margin-left: 18px; margin-right: 18px; padding: 22px 18px; } }
@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr 1fr; min-height: 590px; }
  .type-grid { grid-template-columns: 1fr; }
  .type-card { min-height: 105px; }
  .explorer-grid { grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); }
  .building-stage { min-height: 410px; }
  .results-panel { grid-template-columns: repeat(4, 1fr); }
  .results-intro { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .site-header { min-height: 68px; }
  .header-actions > a:not(.button) { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 65px; }
  .hero-visual { max-width: 650px; margin: -25px auto 0; }
  .explorer-grid { grid-template-columns: 1fr; }
  .controls-panel { order: 2; }
  .visual-panel { order: 1; }
  .results-panel { grid-template-columns: repeat(2, 1fr); }
  .metric-card:nth-child(even) { border-left: 0; }
  .metric-card { border-top: 1px solid var(--line); }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article { min-height: 190px; }
  .cta-section { margin-left: 24px; margin-right: 24px; grid-template-columns: 1fr; padding: 38px 30px; }
  .cta-section .button { justify-self: start; }
  .disclaimer { margin-left: 24px; margin-right: 24px; grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { padding: 12px 18px; }
  .brand-logo { width: 156px; height: 42px; }
  .header-actions .button { min-height: 38px; padding: 0 13px; font-size: 11px; }
  .hero, .type-section, .explorer-section { padding-left: 18px; padding-right: 18px; }
  .hero { min-height: auto; padding-top: 50px; padding-bottom: 75px; }
  h1 { font-size: 44px; }
  .hero-lede { font-size: 16px; }
  .hero-visual { margin-top: 5px; }
  .section-heading { grid-template-columns: 38px 1fr; gap: 12px; }
  .section-heading .step { width: 34px; height: 34px; }
  .type-card { grid-template-columns: 64px 1fr; padding: 16px; }
  .type-icon { width: 62px; }
  .card-status { display: none; }
  .explorer-section { padding-top: 65px; padding-bottom: 75px; }
  .controls-panel, .visual-panel { padding: 22px 18px 17px; }
  .building-stage { min-height: 320px; margin-left: -12px; margin-right: -12px; }
  .visual-title { align-items: center; }
  .match-status { font-size: 0; padding: 8px; }
  .visual-footnote { flex-direction: column; gap: 4px; }
  .results-panel { grid-template-columns: 1fr; }
  .results-intro, .metric-card { padding: 22px; }
  .metric-card { border-left: 0; }
  .metric-card strong { font-size: 36px; }
  .method-section { padding: 75px 18px 80px; }
  .cta-section { margin-top: 65px; }
  .disclaimer { margin-bottom: 65px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
