/* HLand Wind — styles
   Palette from the prototype itself: galvanized steel ground, blue survey flags (wind),
   yellow guy lines (sun). Wind is always blue, sun is always yellow.
   All layout responds to the width of .site (container queries), so the same CSS drives
   the real site and the Desktop / Mobile preview. */

:root {
  --ground: #e8edf0;
  --panel: #f7f9fa;
  --ink: #0f1b26;
  --steel: #485866;
  --line: #b4c0c8;
  --wind: #1b57d6;
  --sun: #f5c400;
  --on-sun: #0f1b26;
  --on-wind: #ffffff;
  --focus: #1b57d6;
  --sheet-ink: #0f1b26;
  --stage: #cfd8de;
  --font-display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', Impact, sans-serif;
  --font-text: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --gutter: clamp(1rem, 4.5cqi, 3rem);
  --measure: 62ch;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b141c;
    --panel: #121e28;
    --ink: #e6eef3;
    --steel: #a1b3c0;
    --line: #2b3c4a;
    --wind: #7ea6ff;
    --on-wind: #0b141c;
    --focus: #9db9ff;
    --sheet-ink: #16242f;
    --stage: #05090d;
  }
}
:root[data-theme="dark"] {
  --ground: #0b141c;
  --panel: #121e28;
  --ink: #e6eef3;
  --steel: #a1b3c0;
  --line: #2b3c4a;
  --wind: #7ea6ff;
  --on-wind: #0b141c;
  --focus: #9db9ff;
  --sheet-ink: #16242f;
  --stage: #05090d;
}

/* Sections on the dark sheet re-map the tokens locally, in both themes */
.sheet--ink {
  --ground: var(--sheet-ink);
  --panel: #1a2b38;
  --ink: #e6eef3;
  --steel: #a9bac6;
  --line: #34495a;
  --wind: #86adff;
  --on-wind: #0b141c;
  --focus: #b4caff;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-block: 5.5rem 6rem; }
body {
  margin: 0;
  background: var(--stage);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}
img, svg, canvas { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--wind); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sun); color: #0f1b26; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* the contact form's honeypot: bots fill it, people never see it */

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--sun); color: #0f1b26; padding: 0.75rem 1.25rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- preview stage (Desktop / Mobile) ---------- */
.frame { background: var(--ground); min-height: 100%; }
body[data-view="mobile"] { padding: 1.25rem 0 6rem; }
body[data-view="mobile"] .frame {
  width: 390px; max-width: calc(100% - 1rem);
  height: calc(100dvh - 8rem); min-height: 34rem;
  margin-inline: auto; overflow: auto;
  border: 12px solid #0a0f14; border-radius: 40px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  scroll-padding-block: 5rem 2rem;
  overscroll-behavior: contain;
}
.viewbar {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; display: flex; gap: 0.25rem; padding: 0.25rem;
  background: #0f1b26; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
}
.viewbar button {
  font: 600 1.125rem/1 var(--font-display); letter-spacing: 0.02em;
  min-height: 2.75rem; padding: 0 1.25rem; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: #e6eef3;
}
.viewbar button[aria-pressed="true"] { background: var(--sun); color: #0f1b26; }
.viewbar button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- site container ---------- */
.site { container: site / inline-size; background: var(--ground); color: var(--ink); }
.wrap { width: 100%; max-width: 80rem; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
h1, h2, h3, h4, .display {
  font-family: var(--font-display); font-weight: 800; line-height: 0.95;
  letter-spacing: 0; margin: 0; text-wrap: balance;
}
h1 { font-size: clamp(3.75rem, 15cqi, 9.5rem); }
h2 { font-size: clamp(2.5rem, 8.5cqi, 5rem); max-width: 16ch; }
h3 { font-size: clamp(1.625rem, 4.2cqi, 2.125rem); font-weight: 700; line-height: 1; }
p { margin: 0; max-width: var(--measure); }
p + p { margin-top: 1em; }
.lede { font-size: clamp(1.25rem, 3cqi, 1.5rem); line-height: 1.5; max-width: 40ch; }
.muted { color: var(--steel); }
.note { font-size: 1rem; color: var(--steel); max-width: 60ch; }
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.25rem; padding: 0 1.75rem; border: 2px solid var(--ink); border-radius: var(--radius);
  font: 700 1.375rem/1 var(--font-display); letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  background: var(--ink); color: var(--ground);
}
.btn:hover { background: var(--wind); border-color: var(--wind); color: var(--on-wind); }
.btn--sun { background: var(--sun); border-color: var(--sun); color: var(--on-sun); }
.btn--sun:hover { background: #ffd83a; border-color: #ffd83a; color: var(--on-sun); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.textlink { font: 700 1.375rem/1.2 var(--font-display); letter-spacing: 0.02em; }

/* ---------- header ---------- */
.header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.logo { display: inline-flex; color: var(--ink); border-radius: 2px; }
.logo svg { height: 2.5rem; width: auto; display: block; }
.nav-wide { display: none; }
.nav-wide ul, .nav-narrow ul { list-style: none; margin: 0; padding: 0; }
.nav-wide ul { display: flex; gap: 0.25rem; align-items: center; }
.nav-wide a, .nav-narrow a {
  font: 600 1.25rem/1 var(--font-display); letter-spacing: 0.02em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem;
}
.nav-wide a:not(.btn):hover, .nav-narrow a:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); border-radius: var(--radius); }
.nav-wide a[aria-current], .nav-narrow a[aria-current] {
  text-decoration: underline; text-decoration-color: var(--ink); text-decoration-thickness: 3px; text-underline-offset: 0.4em;
}
.nav-wide .btn { min-height: 2.75rem; padding: 0 1.25rem; font-size: 1.25rem; color: var(--ground); }
.nav-narrow { position: relative; }
.nav-narrow summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0 1rem; border: 2px solid var(--ink); border-radius: var(--radius);
  font: 700 1.25rem/1 var(--font-display); letter-spacing: 0.02em;
}
.nav-narrow summary::-webkit-details-marker { display: none; }
.nav-narrow summary::after { content: ''; width: 0.6rem; height: 0.6rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.nav-narrow[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.nav-narrow ul {
  position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 15rem; padding: 0.5rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}
.nav-narrow li a { width: 100%; min-height: 3rem; }

@container site (min-width: 62rem) {
  .nav-wide { display: block; }
  .nav-narrow { display: none; }
}

/* ---------- sheets (sections) ---------- */
.sheet { padding-block: clamp(3.5rem, 10cqi, 7.5rem); background: var(--ground); color: var(--ink); }
.sheet--panel { background: var(--panel); }
.sheet--ink { background: var(--ground); }
.sheet-head { display: grid; gap: 1.25rem; margin-bottom: clamp(2rem, 6cqi, 3.5rem); }
.sheet-head .lede { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding-block: clamp(2rem, 6cqi, 4rem) clamp(3rem, 8cqi, 5rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 2rem; }
.hero-copy { display: grid; gap: 1.5rem; align-content: start; }
.hero-copy h1 { max-width: 11ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin-top: 0.5rem; }
.stage { display: grid; gap: 0.75rem; }
.viewport {
  position: relative; aspect-ratio: 4 / 3; width: 100%;
  background:
    linear-gradient(var(--line), var(--line)) left top / 1.75rem 2px no-repeat,
    linear-gradient(var(--line), var(--line)) left top / 2px 1.75rem no-repeat,
    linear-gradient(var(--line), var(--line)) right top / 1.75rem 2px no-repeat,
    linear-gradient(var(--line), var(--line)) right top / 2px 1.75rem no-repeat,
    linear-gradient(var(--line), var(--line)) left bottom / 1.75rem 2px no-repeat,
    linear-gradient(var(--line), var(--line)) left bottom / 2px 1.75rem no-repeat,
    linear-gradient(var(--line), var(--line)) right bottom / 1.75rem 2px no-repeat,
    linear-gradient(var(--line), var(--line)) right bottom / 2px 1.75rem no-repeat,
    var(--panel);
  overflow: hidden;
}
#turbine-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#turbine-canvas:active { cursor: grabbing; }
#turbine-canvas:focus-visible { outline-offset: -3px; }
.dims { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dims line { stroke: var(--steel); stroke-width: 1.5; }
.dims text {
  fill: var(--ink); font: 700 17px/1 var(--font-display); letter-spacing: 0.02em; text-anchor: middle;
  paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round;
}
.dims [data-d="h-label"] { text-anchor: end; }
.drag-hint {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; margin: 0; max-width: none;
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; padding: 0 1rem 0 0.75rem;
  background: var(--ink); color: var(--ground); border-radius: 999px; pointer-events: none;
  font: 700 1.125rem/1 var(--font-display); letter-spacing: 0.02em;
}
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
.hero-fallback { display: none; position: absolute; inset: 0; }
.hero-fallback img { width: 100%; height: 100%; object-fit: cover; }
.no-webgl #turbine-canvas, .no-webgl .dims, .no-webgl .drag-hint { display: none; }
.no-webgl .hero-fallback { display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button, .tool {
  font: 700 1.25rem/1 var(--font-display); letter-spacing: 0.02em; min-height: 2.75rem; padding: 0 1.25rem;
  background: transparent; color: var(--ink); border: 0; cursor: pointer;
}
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.seg button[data-mode="wind"][aria-pressed="true"] { background: var(--wind); color: var(--on-wind); }
.seg button[data-mode="sun"][aria-pressed="true"] { background: var(--sun); color: var(--on-sun); }
.tools { display: inline-flex; gap: 0.25rem; }
.tool { border: 2px solid transparent; border-radius: var(--radius); text-decoration: underline; text-underline-offset: 0.25em; }
.tool:hover { border-color: var(--ink); }
.caption { font-size: 1rem; color: var(--steel); max-width: 60ch; line-height: 1.45; }

.titleblock { margin: 0; display: grid; border: 2px solid var(--ink); background: var(--panel); }
.titleblock > div { display: grid; grid-template-columns: minmax(6.5rem, 30%) 1fr; border-top: 1px solid var(--line); }
.titleblock > div:first-child { border-top: 0; }
.titleblock dt, .titleblock dd { margin: 0; padding: 0.55rem 0.9rem; }
.titleblock dt { color: var(--steel); font: 600 1.125rem/1.3 var(--font-display); letter-spacing: 0.02em; border-right: 1px solid var(--line); }
.titleblock dd { font: 700 1.25rem/1.3 var(--font-display); letter-spacing: 0.01em; }
.titleblock dd small { display: block; font: 400 0.9375rem/1.4 var(--font-text); color: var(--steel); letter-spacing: 0; margin-top: 0.15rem; }

@container site (min-width: 62rem) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 4cqi, 4rem); align-items: start; }
  .hero-copy { padding-top: 1rem; }
  .viewport { aspect-ratio: 5 / 4; }
}
@container site (min-width: 40rem) and (max-width: 61.99rem) {
  .viewport { aspect-ratio: 4 / 3; }
}

/* ---------- problem ---------- */
.problem-grid { display: grid; gap: 2.5rem; }
.bignum { display: grid; gap: 0.5rem; align-content: start; }
.bignum .num { font-size: clamp(5rem, 22cqi, 11rem); line-height: 0.85; color: var(--ink); }
.bignum p { font-size: 1.25rem; max-width: 26ch; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; }
.rules > li { display: grid; gap: 0.35rem; padding-block: 1.25rem; border-top: 2px solid var(--ink); }
.rules > li:last-child { border-bottom: 1px solid var(--line); }
.rules h3 { margin-bottom: 0.15rem; }
@container site (min-width: 62rem) {
  .problem-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(3rem, 6cqi, 6rem); align-items: start; }
}

/* ---------- machine ---------- */
.mech-title { font-size: clamp(2rem, 5.5cqi, 3.25rem); font-weight: 800; line-height: 1; color: var(--ink); }
.mech { display: grid; gap: 0; }
.mech > article { display: grid; gap: 1.5rem; padding-block: 2rem; border-top: 2px solid var(--ink); }
.mech > article:last-child { border-bottom: 1px solid var(--line); }
.mech figure { margin: 0; display: grid; gap: 0.5rem; align-content: start; justify-items: start; }
.mech figure img { width: 100%; max-width: 20rem; max-height: 21rem; object-fit: contain; object-position: left top; }
.mech figure img.wide { max-width: 100%; max-height: none; }   /* a landscape drawing that needs the column's width */
.mech figcaption { font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--steel); }
.mech h4 { font-size: clamp(1.625rem, 4.2cqi, 2.125rem); font-weight: 700; line-height: 1; margin-bottom: 0.75rem; }
[data-theme="dark"] .mech img, [data-theme="dark"] .mech-img { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mech img { filter: invert(1); }
}
@container site (min-width: 44rem) {
  .mech { grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 5cqi, 5rem); }
  .mech > article { grid-template-rows: auto auto 1fr; align-content: start; }   /* pictures start under their own text */
  .mech > article:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--line); }   /* only when the last row is full */
}
.mech-note { margin-top: 2rem; }


/* ---------- assembly ---------- */
.asm-grid { display: grid; gap: 2.5rem; }
.asm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.asm-controls .btn { min-width: 11rem; }
.asm-scrub { flex: 1 1 14rem; min-width: 0; }
.asm-fallback { display: none; position: absolute; inset: 0; padding: 1rem; }
.asm-fallback img { width: 100%; height: 100%; object-fit: contain; filter: none; }
.no-webgl-asm #asm-canvas, .no-webgl-asm #asm-hint { display: none; }
.no-webgl-asm .asm-fallback { display: block; }
[data-theme="dark"] .asm-fallback img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .asm-fallback img { filter: invert(1); } }
.asm-steps { list-style: none; margin: 0; padding: 0; counter-reset: none; display: grid; align-content: start; }
.asm-steps > li { border-top: 2px solid var(--ink); }
.asm-steps > li:last-child { border-bottom: 1px solid var(--line); }
.asm-steps button {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-items: center; column-gap: 1rem; width: 100%; min-height: 3.5rem;
  padding: 0.65rem 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer;
  font: 700 clamp(1.375rem, 3.6cqi, 1.75rem)/1.1 var(--font-display); letter-spacing: 0.01em;
}
.asm-steps button:hover .t { text-decoration: underline; text-underline-offset: 0.25em; }
.asm-steps .n {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--steel); color: var(--steel); font: 800 1.25rem/1 var(--font-display);
}
.asm-steps li.is-done .n { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.asm-steps button[aria-current="step"] .n { background: var(--sun); border-color: var(--ink); color: var(--on-sun); }
.asm-step-body { display: none; padding: 0 0 1.25rem 3.5rem; }
li:has(> button[aria-current="step"]) > .asm-step-body { display: grid; gap: 0.5rem; }
.asm-step-body p { font-size: 1.0625rem; max-width: 52ch; }
.no-js .asm-step-body, .no-webgl-asm .asm-step-body { display: grid; gap: 0.5rem; }
@container site (min-width: 62rem) {
  .asm-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2.5rem, 5cqi, 5rem); align-items: start; }
}

.asm-now { display: grid; gap: 0.35rem; padding-top: 0.75rem; border-top: 2px solid var(--ink); }
.asm-now-title { font: 700 1.5rem/1.1 var(--font-display); letter-spacing: 0.01em; max-width: none; }
.asm-now p:last-child { font-size: 1rem; line-height: 1.5; color: var(--steel); }
@container site (min-width: 62rem) { .asm-now { display: none; } }
@container site (max-width: 39.99rem) { #asm-viewport { aspect-ratio: 1 / 1; } }

/* ---------- proof ---------- */
.gallery { display: grid; gap: 2rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; display: grid; gap: 0.75rem; align-content: start; }
.gallery img { width: 100%; object-fit: cover; background: var(--line); }
.gallery .land img { aspect-ratio: 4 / 3; }
.gallery .port img { aspect-ratio: 3 / 4; }
.gallery figcaption { display: grid; gap: 0.15rem; font-size: 1rem; line-height: 1.4; color: var(--steel); }
.gallery figcaption strong { font: 700 1.375rem/1.1 var(--font-display); letter-spacing: 0.01em; color: var(--ink); }
@container site (min-width: 40rem) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container site (min-width: 62rem) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Construction photos: a thumbnail grid that opens each photo in a lightbox */
.build-photos { margin-top: 3.5rem; display: grid; gap: 1rem; }
.build-photos h3 { margin: 0; font: 700 1.75rem/1.1 var(--font-display); color: var(--ink); }
.build-photos p { margin: 0; max-width: var(--measure); color: var(--steel); }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
@container site (min-width: 40rem) { .thumbs { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); } }
.thumbs a { display: block; border-radius: var(--radius); overflow: hidden; outline-offset: 3px; }
.thumbs a:focus-visible { outline: 3px solid var(--focus); }
.thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--line); transition: transform 0.2s; }
.thumbs a:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .thumbs img { transition: none; } .thumbs a:hover img { transform: none; } }
.lightbox { border: 0; padding: 0; margin: auto; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; color: #e6eef3; }
.lightbox::backdrop { background: rgb(5 9 13 / 0.92); }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; padding: 3.5rem 1rem 1rem; box-sizing: border-box; gap: 0.75rem; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { max-width: 60ch; text-align: center; font-size: 1rem; line-height: 1.4; }
.lightbox .lb-count { font: 700 1.1rem/1 var(--font-display); letter-spacing: 0.04em; margin-right: 0.4rem; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgb(255 255 255 / 0.26); }
.lightbox button:focus-visible { outline: 3px solid #9db9ff; outline-offset: 2px; }
.lightbox .lb-close { top: 0.5rem; right: 0.5rem; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; translate: 0 -50%; }
.lightbox .lb-prev { left: 0.5rem; }
.lightbox .lb-next { right: 0.5rem; }
.callout {
  margin-top: clamp(2.5rem, 6cqi, 4rem); padding: 1.5rem; display: grid; gap: 0.75rem;
  border: 2px solid var(--ink); background: var(--panel);
}
.callout h3 { font-size: 1.75rem; }
.callout p { max-width: 70ch; }
@container site (min-width: 62rem) {
  .callout { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; padding: 2rem; gap: 2rem; }
}

/* ---------- product spec ---------- */
.product-grid { display: grid; gap: 2.5rem; }
.tablewrap { overflow-x: auto; }
.tablewrap:focus-visible { outline-offset: 6px; }
table.spec { width: 100%; border-collapse: collapse; font-size: 1.0625rem; }
table.spec caption { text-align: left; font: 700 1.5rem/1.1 var(--font-display); padding-bottom: 0.75rem; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 0.75rem 0.75rem 0.75rem 0; overflow-wrap: anywhere; border-top: 1px solid var(--line); }
table.spec thead th { font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--steel); border-top: 2px solid var(--ink); }
table.spec tbody th { font-weight: 600; width: 34%; }
table.spec td.status { color: var(--steel); font-size: 0.9375rem; }
table.spec td .num { font-size: 1.375rem; }
.kit { display: grid; gap: 1.25rem; align-content: start; }
.kit ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; max-width: 50ch; }
.kit-fig { margin: 0.5rem 0 0; display: grid; gap: 0.5rem; justify-items: start; }
.kit-fig img { width: 100%; max-width: 28rem; height: auto; background: #fff; }
.kit-fig figcaption { font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--steel); }
@container site (min-width: 62rem) {
  .product-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(3rem, 6cqi, 6rem); align-items: start; }
}

/* ---------- markets ---------- */
.markets { list-style: none; margin: 0; padding: 0; display: grid; }
.markets > li { display: grid; gap: 0.75rem; padding-block: 1.75rem; border-top: 2px solid var(--ink); }
.markets > li:last-child { border-bottom: 1px solid var(--line); }
@container site (min-width: 50rem) {
  .markets > li { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; }
}

/* ---------- economics ---------- */
.calc { display: grid; gap: 2.5rem; }
.calc-controls { display: grid; gap: 1.5rem; align-content: start; border: 0; margin: 0; padding: 0; min-width: 0; }
.calc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.calc legend { font: 700 1.5rem/1.1 var(--font-display); letter-spacing: 0.01em; padding: 0; margin-bottom: 0.75rem; }
.field { display: grid; gap: 0.4rem; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field label, .field .lbl { font: 600 1.25rem/1.2 var(--font-display); letter-spacing: 0.02em; }
.field output { font: 700 1.5rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.field input[type="range"] { width: 100%; height: 2.75rem; accent-color: var(--sun); background: transparent; }
.field input[type="number"], .form input, .form select, .form textarea {
  width: 100%; min-height: 3rem; padding: 0.5rem 0.75rem; font: 1.125rem/1.4 var(--font-text);
  color: var(--ink); background: var(--panel); border: 2px solid var(--steel); border-radius: var(--radius);
}
.sheet--ink .field input[type="number"], .sheet--ink .form input, .sheet--ink .form select, .sheet--ink .form textarea { background: #0f1b26; }
.hint { font-size: 0.9375rem; color: var(--steel); line-height: 1.4; }
.radios { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.radios label { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; font-size: 1.125rem; cursor: pointer; }
.radios input { width: 1.4rem; height: 1.4rem; accent-color: var(--sun); margin: 0; }
.stepper { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.75rem; }
.step-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--ink); background: transparent; color: var(--ink);
  font: 700 1.5rem/1 var(--font-display); cursor: pointer; display: grid; place-items: center;
}
.step-btn:hover { background: color-mix(in srgb, var(--sun) 20%, transparent); }
.step-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.range-ends { display: flex; justify-content: space-between; padding-inline: 3.5rem; font-size: 0.9375rem; color: var(--steel); }
.calc select {
  width: 100%; min-height: 3rem; padding: 0.5rem 0.75rem; font: 1.125rem/1.4 var(--font-text);
  color: var(--ink); background: #0f1b26; border: 2px solid var(--steel); border-radius: var(--radius);
}
/* the twelve months, Jan-Mar down the first column, as in the client's sketch */
.months { display: grid; grid-template-rows: repeat(6, auto); grid-auto-flow: column; gap: 0.5rem 1rem; }
.month { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: center; gap: 0.5rem; }
.month span { font: 600 1.125rem/1 var(--font-display); letter-spacing: 0.02em; color: var(--steel); }
.month input {
  width: 100%; min-height: 2.75rem; padding: 0.35rem 0.5rem; font: 1.0625rem/1.3 var(--font-text); font-variant-numeric: tabular-nums;
  color: var(--ink); background: #0f1b26; border: 2px solid var(--steel); border-radius: var(--radius);
}
@container site (min-width: 30rem) { .months { grid-template-rows: repeat(3, auto); } }
.month input { appearance: textfield; -moz-appearance: textfield; }   /* no spinners: they hide the value in these small boxes */
.month input::-webkit-inner-spin-button, .month input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.calc-out { display: grid; gap: 1.5rem; align-content: start; min-width: 0; }
.payback { display: grid; gap: 0.25rem; padding-bottom: 1.25rem; border-bottom: 2px solid var(--ink); }
.payback .num { font-size: clamp(5rem, 20cqi, 9rem); line-height: 0.85; color: var(--sun); }
.payback .unit { font: 700 1.75rem/1 var(--font-display); letter-spacing: 0.01em; }
.summary { font-size: 1.125rem; max-width: 52ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.facts dt { font: 600 1.125rem/1.2 var(--font-display); color: var(--steel); letter-spacing: 0.02em; }
.facts dd { margin: 0; font: 700 clamp(1.75rem, 5cqi, 2.375rem)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--steel); stroke-width: 1.5; }
.chart .tick { fill: var(--steel); font: 600 15px var(--font-display); letter-spacing: 0.02em; }
.chart .tick-y { text-anchor: end; }
.chart .tick-x { text-anchor: middle; }
.chart .cum { fill: none; stroke: var(--wind); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.chart .price { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 8 6; }
.chart .mark { fill: var(--sun); stroke: var(--ink); stroke-width: 3; }
.chart .lbl { fill: var(--ink); font: 700 17px var(--font-display); letter-spacing: 0.02em; paint-order: stroke; stroke: var(--ground); stroke-width: 5px; stroke-linejoin: round; }
.chart .lbl-wind { fill: var(--wind); }
.chart-cap { font-size: 0.9375rem; color: var(--steel); }
@container site (min-width: 62rem) {
  .calc { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 5cqi, 5rem); }
}

/* ---------- IP ---------- */
.ip-grid { display: grid; gap: 2.5rem; }
.bigtable-num { display: grid; gap: 0.5rem; align-content: start; }
.bigtable-num .num { font-size: clamp(5rem, 18cqi, 9rem); line-height: 0.85; }
table.patents { width: 100%; border-collapse: collapse; font-size: 1.0625rem; }
table.patents caption { text-align: left; font: 700 1.5rem/1.1 var(--font-display); padding-bottom: 0.75rem; }
table.patents th, table.patents td { text-align: left; padding: 0.7rem 0.75rem 0.7rem 0; overflow-wrap: anywhere; border-top: 1px solid var(--line); vertical-align: top; }
table.patents thead th { font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--steel); border-top: 2px solid var(--ink); }
table.patents tbody th { font-weight: 600; }
table.patents td.n { font-variant-numeric: tabular-nums; }
table.patents small { display: block; color: var(--steel); font-size: 0.9375rem; line-height: 1.35; }
table.patents tr.validated > * { border-top: 0; padding-block: 0.2rem; color: var(--steel); }   /* the EP validations, listed under Europe */
table.patents tr.validated th { font-weight: 400; padding-left: 1.25rem; }
table.patents tr.validated:last-child > * { padding-bottom: 0.7rem; }
@container site (min-width: 62rem) {
  .ip-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(3rem, 6cqi, 6rem); align-items: start; }
}

/* ---------- build & roadmap ---------- */
.build-grid { display: grid; gap: 3rem; }
.roadmap { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; }
.roadmap li { counter-increment: step; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); column-gap: 1rem; padding-block: 1.25rem; border-top: 2px solid var(--ink); }
.roadmap li:last-child { border-bottom: 1px solid var(--line); }
.roadmap li::before {
  content: counter(step); grid-row: 1 / span 3; grid-column: 1; width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  font: 800 1.5rem/1 var(--font-display); background: var(--ink); color: var(--ground); border-radius: 50%;
}
.roadmap li > * { grid-column: 2; }
.roadmap li.now::before { background: var(--sun); color: var(--on-sun); }
.roadmap h3 { font-size: 1.625rem; }
.roadmap p { font-size: 1.0625rem; color: var(--steel); }
.roadmap .when { font: 600 1.125rem/1.2 var(--font-display); letter-spacing: 0.02em; color: var(--ink); margin-top: 0.5rem; }
.build-copy { display: grid; gap: 1.5rem; align-content: start; }
.build-copy > p, .build-copy > ul { margin: 0; }
.mats { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; max-width: 50ch; }
@container site (min-width: 62rem) {
  .build-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(3rem, 6cqi, 6rem); align-items: start; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; }
.faq > div { display: grid; gap: 0.6rem; padding-block: 1.5rem; border-top: 2px solid var(--ink); }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq h3 { font-size: clamp(1.625rem, 4cqi, 2rem); }
@container site (min-width: 62rem) {
  .faq > div { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem; }
}

/* ---------- ask ---------- */
.ask-grid { display: grid; gap: 3rem; }
.raise { display: grid; gap: 0.75rem; align-content: start; }
.raise .num { font-size: clamp(4.5rem, 17cqi, 8.5rem); line-height: 0.85; color: var(--sun); }
.uses { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; max-width: 34rem; }
.uses li { display: grid; gap: 0.35rem; }
.uses .row { display: flex; justify-content: space-between; gap: 1rem; font-size: 1.125rem; }
.uses .row b { font: 700 1.5rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.uses .bar { height: 0.6rem; background: var(--line); border-radius: 2px; overflow: hidden; }
.uses .bar i { display: block; height: 100%; background: var(--sun); }
.form { display: grid; gap: 1.25rem; align-content: start; }
.form .field label { font: 600 1.25rem/1.2 var(--font-display); letter-spacing: 0.02em; }
.form .req { font: 400 0.9375rem var(--font-text); color: var(--steel); letter-spacing: 0; }
.form textarea { min-height: 7.5rem; resize: vertical; }
.form [aria-invalid="true"] { border-color: #ff8f8f; }
.err { color: #ffb3b3; font-size: 1rem; }
.status { min-height: 1.5rem; font-size: 1.0625rem; }
.turnstile:empty { display: none; }   /* no gap until the spam check is rendered */
.form.is-sent > :not(.form-done) { display: none; }   /* once sent, the confirmation takes the form's place */
.form-done { display: grid; gap: 1rem; justify-items: start; padding: 1.5rem 1.5rem 1.75rem; border-left: 6px solid var(--sun); background: rgba(127, 127, 127, 0.08); }
.form-done h3 { font-size: clamp(1.75rem, 4cqi, 2.25rem); line-height: 1.05; }
.form-done h3:focus { outline: none; }
.form-done p { font-size: 1.125rem; }
.founder { display: grid; gap: 0.35rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 34rem; }
.founder strong { font: 700 1.75rem/1.1 var(--font-display); }
@container site (min-width: 62rem) {
  .ask-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(3rem, 6cqi, 6rem); }
}

/* ---------- footer ---------- */
.footer { padding-block: 3rem 7rem; background: var(--ground); color: var(--ink); border-top: 1px solid var(--line); }
.footer .wrap { display: grid; gap: 1.5rem; }
.footer .logo svg { height: 2.75rem; }
.footer p { font-size: 0.9375rem; color: var(--steel); max-width: 75ch; line-height: 1.55; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.footer li a { display: inline-flex; min-height: 2.75rem; align-items: center; font: 600 1.25rem var(--font-display); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .btn, .seg, .titleblock, .callout { border: 2px solid CanvasText; }
}

/* The 3D models come from prototype.html, embedded (?embed=hero / ?embed=build) */
.viewport--frame { padding: 0; }
.viewport--frame::before, .viewport--frame::after { pointer-events: none; z-index: 1; }
.model-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
/* the framed model follows the visitor's light or dark setting like this page does; without this the frame inherits
   the published page's light color scheme and draws dark text on the dark page */
.model-frame { color-scheme: light dark; }
.model-build { position: relative; height: 54rem; max-height: calc(100vh - 2rem); min-height: 34rem; }
@media (max-width: 61.99rem) { .model-build { height: 78rem; max-height: none; } }
/* CAD renderings in the Machine section are in color: never inverted for dark mode, unlike the patent drawings */
.mech img.render, [data-theme="dark"] .mech img.render { filter: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mech img.render { filter: none; } }
