/* Layout: a specimen plate. Seven printed bodies turn in transparent wells
   over a measurement grid, each with an instrument register beneath it, and a
   millimetre rule at the foot showing their real relative heights. */
:root {
  --bench:  #0E1210;   /* the bench: near-black with a green bias */
  --panel:  #161B17;
  --bone:   #E9ECE2;
  --mute:   #8D9589;
  --rule:   #262D25;
  --accent: #D2843C;   /* copper, lifted to read as text on the bench */
  --teal:   #58B49F;

  /* read by the renderer in g9-3d.js, so the printed parts match the page */
  --ink:       #C6CCBA;   /* the filament */
  --copper:    #BD6A2E;   /* pads, antenna */
  --signal:    #1C7A6B;   /* solar panel */
  --rule-hard: #9CA79D;   /* fabric */
  --paper:     #F1F3F0;   /* the glazing */

  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bench:#F2F1E9; --panel:#FFFFFF; --bone:#171C16; --mute:#5F675B;
    --rule:#DDDED2; --accent:#A2541A; --teal:#1C7A6B;
    --ink:#4C5645; --copper:#A85524; --signal:#1C7A6B; --rule-hard:#8E9A8E; --paper:#F7F8F4;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bench:#F2F1E9; --panel:#FFFFFF; --bone:#171C16; --mute:#5F675B;
  --rule:#DDDED2; --accent:#A2541A; --teal:#1C7A6B;
  --ink:#4C5645; --copper:#A85524; --signal:#1C7A6B; --rule-hard:#8E9A8E; --paper:#F7F8F4;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bench);
  color: var(--bone);
  font: 400 16px/1.6 "Spline Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the faint measurement grid the parts sit on */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--rule) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 120% 80% at 50% 12%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 12%, #000 25%, transparent 78%);
}

/* every painted thing sits above the model canvas, which init() pins at z-index 0 */
.sheet { position: relative; z-index: 1; }

.wrap {
  width: 100%; max-width: 1140px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

h1, h2, h3 { font-family: "Saira Condensed", "Arial Narrow", sans-serif; font-weight: 600; margin: 0; text-wrap: balance; }

.mono { font-family: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ masthead */
.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 14px; }

.mark { display: flex; align-items: baseline; gap: 10px; }
.mark b { font-family: "Saira Condensed", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; }
.mark span { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }

.live { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.76); } }

/* ------------------------------------------------------------ hero */
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; padding-block: 56px 40px; }
.hero h1 { font-size: clamp(36px, 6.3vw, 70px); line-height: 0.98; letter-spacing: -0.015em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--mute); max-width: 44ch; margin: 22px 0 0; }
.soon {
  display: inline-block; margin-top: 28px; padding: 9px 16px;
  border: 1px solid var(--accent); border-radius: 2px;
  font-family: "Saira Condensed", sans-serif; font-weight: 600;
  font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.hero-well { aspect-ratio: 1 / 1; max-width: 100%; min-width: 0; touch-action: pan-y; }

/* ------------------------------------------------------------ the plate */
.plate { border-top: 1px solid var(--rule); }
.plate .wrap { padding-block: 44px 8px; }

.plate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.plate-head h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.01em; }
.plate-head p { margin: 0; color: var(--mute); font-size: 14px; max-width: 46ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 20px; list-style: none; padding: 0; margin: 0; }

.unit { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 3px; min-width: 0; transition: border-color 0.25s ease; }
.unit:hover, .unit:focus-within { border-color: var(--accent); }

.well { aspect-ratio: 1 / 1; min-width: 0; touch-action: pan-y; position: relative; }
.well::before {
  content: attr(data-no); position: absolute; top: 10px; left: 12px;
  font-family: "Spline Sans Mono", monospace; font-size: 11px; letter-spacing: 0.1em;
  color: var(--mute);
}
.no3d .well { display: flex; align-items: center; justify-content: center; }
.no3d .well::after {
  content: attr(data-no); font-family: "Saira Condensed", sans-serif;
  font-size: 52px; font-weight: 700; color: var(--rule);
}

.card { border-top: 1px solid var(--rule); background: var(--panel); padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1 1 auto; }
.card h3 { font-size: 20px; line-height: 1.15; }
.card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--mute); }

.reg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; margin-top: 2px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.reg div { min-width: 0; }
.reg dt { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin: 0; }
.reg dd { margin: 2px 0 0; font-family: "Spline Sans Mono", monospace; font-size: 13px; font-variant-numeric: tabular-nums; }

.state { justify-self: start; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px; }
.state.soon { color: var(--teal); }
.state.redesign { color: var(--accent); }
.state.dev { color: var(--mute); }
.extra { font-size: 12px; color: var(--mute); margin-top: auto; padding-top: 2px; }
.extra b { color: var(--bone); font-weight: 500; }

/* ------------------------------------------------------------ the rule */
.scale, .note { border-top: 1px solid var(--rule); margin-top: 48px; }
.scale .wrap, .note .wrap { padding-block: 40px 48px; }
.scale h2, .note h2 { font-size: clamp(22px, 3vw, 30px); }
.scale p, .note p { margin: 8px 0 0; color: var(--mute); font-size: 14px; max-width: 54ch; }
.note { margin-top: 0; }
.note p { font-size: 15.5px; line-height: 1.65; max-width: 64ch; }
.note p + p { margin-top: 14px; }
.note b { color: var(--bone); font-weight: 500; }

.bars { display: flex; align-items: flex-end; gap: clamp(8px, 2.4vw, 26px); height: 240px; margin: 34px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--bone); }
.bars li { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.bars .mm { font-family: "Spline Sans Mono", monospace; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.bars .bar { width: min(100%, 72px); background: var(--rule); border: 1px solid var(--mute); border-bottom: 0; border-radius: 2px 2px 0 0; }
.bars li:nth-child(odd) .bar { background: var(--panel); }
.ticks { display: flex; gap: clamp(8px, 2.4vw, 26px); margin: 8px 0 0; padding: 0; list-style: none; }
.ticks li { flex: 1 1 0; min-width: 0; text-align: center; font-family: "Spline Sans Mono", monospace; font-size: 10.5px; color: var(--mute); letter-spacing: 0.04em; }

/* ------------------------------------------------------------ foot */
.foot { border-top: 1px solid var(--rule); background: var(--panel); }
.foot .wrap { padding-block: 40px; display: grid; gap: 28px; grid-template-columns: 1.3fr 1fr; align-items: start; }
.foot h2 { font-size: clamp(22px, 3vw, 30px); }
.foot p { margin: 10px 0 0; color: var(--mute); font-size: 14.5px; max-width: 48ch; }
.contact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.addr { font-family: "Spline Sans Mono", monospace; font-size: 15px; color: var(--bone); user-select: all; }
button.copy {
  font: 500 13px/1 "Spline Sans", sans-serif; color: var(--bench); background: var(--accent);
  border: 1px solid var(--accent); border-radius: 2px; padding: 8px 14px; cursor: pointer;
}
button.copy:hover { filter: brightness(1.08); }
button.copy:focus-visible, .unit:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.colophon { border-top: 1px solid var(--rule); }
.colophon .wrap { padding-block: 18px 28px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--mute); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; padding-block: 38px 28px; }
  .hero-well { width: 100%; max-width: 340px; justify-self: center; }
  .foot .wrap { grid-template-columns: 1fr; }
  .bars { height: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  * { transition: none !important; }
}
