:root {
  --ink: #0e0d0b;
  --ink-2: #161310;
  --paper: #f3ecdf;
  --muted: #a89c8d;
  --brass: #e8a15a;
  --mercury: #8fd0c8;
  --line: rgba(243, 236, 223, 0.14);
  --display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(232, 161, 90, 0.14), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(143, 208, 200, 0.07), transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 460;
  font-size: 17px;
  line-height: 1.5;
  font-optical-sizing: auto;
}
body, button, input { font-family: inherit; }
button, input { color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
::selection { background: var(--brass); color: #1c140d; }
:focus-visible { outline: 2px solid var(--mercury); outline-offset: 3px; }

#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.top, main, .foot { position: relative; z-index: 1; }

.wrap { width: min(1120px, calc(100% - 36px)); margin-inline: auto; }
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(14, 13, 11, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 72px;
  padding: 8px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--brass);
  border-radius: 50%;
  position: relative;
  flex: none;
}
.mark:before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--mercury);
}
.brand span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; line-height: 1.25; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: 0.18em; }
.nav { display: flex; gap: 18px; overflow: auto; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--paper); }
.top-meta { display: flex; align-items: center; gap: 10px; }
#clock { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; }
.ghost-btn, .btn, .chip {
  min-height: 44px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ghost-btn, .btn.ghost, .chip {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(243, 236, 223, 0.28);
  padding: 0 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--brass);
  color: #1c140d;
  border: 1px solid var(--brass);
  text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--paper); }
.btn.full { width: 100%; }
.chip[aria-pressed="true"] { background: var(--brass); color: #1c140d; border-color: var(--brass); }

.hero {
  display: grid;
  gap: 28px;
  padding: 34px 0 10px;
  align-items: center;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--brass);
}
.eyebrow i { width: 28px; height: 1px; background: var(--brass); display: block; flex: none; }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.03em; line-height: 0.96; margin: 0; }
h1 { font-size: clamp(3.1rem, 8vw, 6.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3.15rem); }
h1 em, h2 em { font-style: italic; font-weight: 460; }
.lede, .section-head p, #stageLede, .note p, .hint, .protocol li, .sum {
  color: var(--muted);
}
.lede { font-size: 1.12rem; max-width: 38rem; margin: 18px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 22px 28px; margin: 28px 0 0; padding: 0; }
.facts div { min-width: 80px; }
.facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-family: var(--mono); font-size: 1.25rem; color: var(--paper); }

.hero-plate {
  padding: 0;
  width: 100%;
  height: min(68vw, 520px);
  min-height: 300px;
  border-radius: 24px;
  border: 1px solid rgba(232, 161, 90, 0.38);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(232, 161, 90, 0.08), transparent 60%),
    #13110f;
  box-shadow: inset 0 0 0 1px rgba(232, 161, 90, 0.12);
  position: relative;
  overflow: hidden;
  text-align: left;
}
.hero-plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.plate-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(243, 236, 223, 0.78);
  pointer-events: none;
}
.plate-label small { display: block; color: var(--brass); margin-bottom: 4px; }

.section { margin-top: 72px; }
.section-head, .stage-head {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head p, #stageLede { margin: 0; max-width: 36rem; }

.grid { display: grid; gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(243, 236, 223, 0.03);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(232, 161, 90, 0.45); }
.card[aria-pressed="true"] {
  border-color: rgba(232, 161, 90, 0.85);
  box-shadow: inset 0 0 0 1px rgba(232, 161, 90, 0.35);
}
.mini { width: 100%; height: 104px; border-radius: 12px; background: #100e0c; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 6px; }
.kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.kicker b { font-weight: 500; color: var(--brass); }
.card h3 { font-size: 1.45rem; line-height: 1.05; }
.sum { font-size: 0.98rem; }

.protocol { border: 1px solid var(--line); border-radius: 18px; padding: 16px 16px 6px; background: rgba(20, 18, 16, 0.45); }
.protocol ol { list-style: none; margin: 8px 0 0; padding: 0; }
.protocol li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.protocol b { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--brass); font-weight: 500; }

.stage-layout { display: grid; gap: 12px; }
.glass {
  position: relative;
  min-height: 340px;
  height: min(62vh, 560px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(232, 161, 90, 0.32);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(232, 161, 90, 0.06), transparent 55%),
    #100e0c;
  box-shadow: inset 0 0 0 1px rgba(232, 161, 90, 0.1);
}
.glass canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#paint { pointer-events: none; }
.veil {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(243, 236, 223, 0.75);
  pointer-events: none;
}
.aside {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: rgba(20, 18, 16, 0.72);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .aside .label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.hint { margin: 0; font-size: 0.98rem; }
.textin {
  min-height: 44px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(243, 236, 223, 0.22);
  background: var(--ink);
  color: var(--paper);
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: rgba(243, 236, 223, 0.35); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid #1c140d;
}
input[type="range"]::-moz-range-track { height: 2px; background: rgba(243, 236, 223, 0.35); }
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid #1c140d;
}
.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-top: auto;
  padding-top: 8px;
}
.meter { border-top: 1px solid var(--line); padding-top: 8px; }
.meter small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.meter b { display: block; margin-top: 3px; font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--paper); }

.bench {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  background: rgba(20, 18, 16, 0.55);
}
#stair { width: 100%; height: 168px; background: #100e0c; border-radius: 16px; }
.bench h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.bench .lede { margin-top: 8px; font-size: 1rem; }

.notes { display: grid; gap: 18px; }
.note { border-top: 1px solid var(--line); padding-top: 14px; }
.note span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--brass); }
.note h3 { font-size: 1.55rem; margin: 8px 0; line-height: 1.08; }
.note p { margin: 0; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 56px;
  padding: 22px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.foot a { color: var(--paper); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

@media (min-width: 800px) {
  .section-head, .stage-head { grid-template-columns: 1.15fr 0.85fr; align-items: end; }
  .notes { grid-template-columns: repeat(3, 1fr); }
  .bench { grid-template-columns: minmax(220px, 280px) 1fr minmax(190px, 230px); align-items: center; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.12fr 0.88fr; min-height: calc(100vh - 96px); padding-top: 18px; }
  .hero-plate { height: min(68vh, 560px); }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .feature { grid-column: span 2; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: stretch; }
  .feature .mini { height: 100%; min-height: 190px; }
  .protocol { grid-column: span 2; }
  .stage-layout { grid-template-columns: 1fr 300px; align-items: stretch; }
}
@media (max-width: 720px) {
  .glass { height: 68vw; min-height: 280px; }
  .card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
