/* Layout: fixed 3D canvas, story cards on the left, site-size control bottom right.
   Look: architectural maquette at night. Off-white models, one warm accent for gas and heat,
   one cool accent for electricity and compute. */
/* Fonts are self-hosted (IBM Plex, SIL Open Font License, see fonts/OFL.txt). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/ibm-plex-sans-latin-300-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-300-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0b0d10;
  --ink: #ecebe6;
  --muted: #8d9197;
  --faint: rgba(236, 235, 230, 0.1);
  --panel: rgba(11, 13, 16, 0.8);
  --gas: #e3a646;
  --power: #a9d8e8;
  --font-display: "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
#fade { position: fixed; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; z-index: 2; }

#loader {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 50; color: var(--muted);
  font: 12px/1 var(--font-data); letter-spacing: 0.12em; text-transform: uppercase;
  transition: opacity 0.8s ease;
}
#loader.done { opacity: 0; pointer-events: none; }

/* ---------- chrome ---------- */
.brand {
  position: fixed; top: 22px; left: max(24px, env(safe-area-inset-left, 0px)); z-index: 10;
  display: flex; align-items: center; gap: 10px;
  font: 500 14px var(--font-display); letter-spacing: 0.02em;
}
.brand b { color: var(--power); font-weight: 500; }
.logo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gas); box-shadow: 0 0 10px rgba(227, 166, 70, 0.7); }

.steps { position: fixed; right: max(24px, env(safe-area-inset-right, 0px)); top: 42%; transform: translateY(-50%); z-index: 10; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; justify-items: end; }
.steps li { display: flex; justify-content: flex-end; }
.steps button {
  all: unset; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  font: 11px var(--font-data); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 3px 0;
}
.steps button::after { content: ""; width: 14px; height: 1px; background: var(--muted); transition: all 0.3s ease; }
.steps button span { opacity: 0; transform: translateX(6px); transition: all 0.3s ease; }
.steps:hover button span, .steps button.active span { opacity: 1; transform: none; }
.steps button.active { color: var(--ink); }
.steps button.active::after { width: 28px; background: var(--ink); }
.steps button:focus-visible { outline: 1px solid var(--power); outline-offset: 4px; }

/* ---------- site-size control ---------- */
.config {
  position: fixed; z-index: 12;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 268px; padding: 16px 16px 14px;
  background: var(--panel); border: 1px solid var(--faint); border-radius: 4px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.config.show { opacity: 1; transform: none; pointer-events: auto; }
.config-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.config-head label { font: 11px var(--font-data); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.config-head output { font: 500 22px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.config-row { display: grid; grid-template-columns: 28px 1fr 28px; gap: 10px; align-items: center; }
.config-row button {
  all: unset; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--faint); border-radius: 3px; color: var(--ink); font-size: 16px;
}
.config-row button:hover { border-color: var(--power); }
.config-row button:focus-visible { outline: 1px solid var(--power); outline-offset: 2px; }
.config input[type="range"] { width: 100%; accent-color: var(--power); margin: 0; }
.config-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--faint); }
.config-stats div { min-width: 0; }
.config-stats dt { font: 10px var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.config-stats dd { margin: 2px 0 0; font: 500 13px var(--font-data); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- story ---------- */
main { position: relative; z-index: 5; }
section {
  height: 100vh; display: flex; align-items: center;
  padding-block: 0;
  padding-left: max(clamp(16px, 6vw, 88px), env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.card {
  width: min(400px, 100%);
  background: var(--panel); border: 1px solid var(--faint); border-radius: 4px;
  padding: 24px 26px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  will-change: opacity, transform;
}
.card.hero { background: transparent; border: none; backdrop-filter: none; -webkit-backdrop-filter: none; width: min(600px, 100%); padding: 0; }

.eyebrow { margin: 0 0 12px; font: 11px var(--font-data); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
h1, h2 { font-family: var(--font-display); font-weight: 500; margin: 0 0 14px; line-height: 1.04; text-wrap: balance; }
h1 { font-size: clamp(42px, 6.4vw, 84px); letter-spacing: -0.03em; }
h2 { font-size: clamp(22px, 2.3vw, 28px); letter-spacing: -0.015em; }
.accent { color: var(--gas); }
.attrib { font: 12px var(--font-data) !important; letter-spacing: 0.04em; color: var(--muted) !important; margin-bottom: 26px !important; }
p { margin: 0 0 12px; line-height: 1.6; color: #c3c6c9; font-size: 14.5px; }
.hero p { font-size: 16.5px; max-width: 44ch; }
p b, li b { color: var(--ink); font-weight: 500; }
.note { font-size: 12px; color: var(--muted); }
.hint { color: var(--muted) !important; font: 11px var(--font-data) !important; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 30px !important; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.stats div { border-top: 1px solid var(--faint); padding-top: 10px; display: grid; gap: 3px; min-width: 0; }
.stats b { font: 500 19px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; color: var(--muted); }

.facts { margin: 6px 0 12px; padding-left: 16px; color: #c3c6c9; font-size: 13.5px; line-height: 1.75; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 14px; }
.metrics div { border-top: 1px solid var(--faint); padding-top: 8px; min-width: 0; }
.metrics dt { font: 10px var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.metrics dd { margin: 3px 0 0; font: 500 17px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.summary .card { width: min(440px, 100%); }

/* ---------- contact ---------- */
.mail-link {
  position: fixed; top: 22px; right: max(24px, env(safe-area-inset-right, 0px)); z-index: 10;
  font: 12px var(--font-data); letter-spacing: 0.04em; color: var(--muted); text-decoration: none;
}
.mail-link:hover, .mail-link:focus-visible { color: var(--power); }
.contact { height: auto; min-height: 100vh; padding-block: 64px 32px; }
.contact .card { width: min(460px, 100%); }
.mail { font: 13px var(--font-data) !important; }
.mail a { color: var(--power); text-decoration: none; }
.mail a:hover { text-decoration: underline; }
.contact-form { display: grid; gap: 10px; margin-top: 14px; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-form label { display: grid; gap: 4px; font: 10px var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact-form .opt { text-transform: none; letter-spacing: 0; }
.contact-form input, .contact-form textarea {
  font: 14px var(--font-body); color: var(--ink); background: rgba(236, 235, 230, 0.04);
  border: 1px solid var(--faint); border-radius: 3px; padding: 8px 10px; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 72px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--power); }
.contact-form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .send { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.contact-form button {
  font: 500 13px var(--font-display); color: var(--bg); background: var(--power);
  border: none; border-radius: 3px; padding: 9px 16px; cursor: pointer; white-space: nowrap;
}
.contact-form button:disabled { opacity: 0.6; cursor: default; }
.contact-form button:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.status { margin: 0 !important; font-size: 12.5px !important; }
.status.ok { color: var(--power) !important; }
.status.err { color: var(--gas) !important; }

/* ---------- 3D labels ---------- */
.lbl {
  font: 10.5px var(--font-data); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); background: rgba(11, 13, 16, 0.62);
  padding: 3px 7px; border-left: 1px solid rgba(236, 235, 230, 0.5);
  white-space: nowrap; transition: opacity 0.25s linear;
}
.lbl.field { border-left-color: var(--gas); }
.lbl.focus { border-left-color: var(--gas); color: var(--gas); }
.lbl.city { border-left-color: var(--power); color: var(--power); }
.lbl.big { font-size: 12px; padding: 4px 9px; }

#nogl { position: fixed; top: 70px; left: 24px; right: 24px; z-index: 20; color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .steps { display: none; }
  section { align-items: flex-start; padding-top: 70px; }
  .card { padding: 16px 16px; }
  .card.hero { align-self: center; }
  .hero p { font-size: 15px; }
  .facts { display: none; }
  .config { left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding: 12px; }
  .config-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; padding-top: 8px; }
  .config-stats dd { font-size: 11.5px; }
  .lbl { font-size: 9px; padding: 2px 5px; }
  .mail-link { display: none; }
  .contact-form .row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .lbl, #loader, .config { transition: none; }
}
