:root {
  --paper: #efeae1;
  --paper-2: #f7f3ec;
  --ink: #1c1915;
  --quiet: #5e584f;
  --line: #1c1915;
  --copper: #9a3e22;
  --copper-2: #e07a4c;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(640px, calc(100% - 40px)); }

h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 560; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 7vw, 5.4rem); margin: 0 0 18px; max-width: 16ch; }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0 0 12px; }
h3 { font-size: 1.45rem; margin: 0 0 8px; }
p { margin: 0 0 1em; }
a { color: var(--copper); text-underline-offset: 0.18em; }
.kicker, .sheet, .num, .cat, time, .go {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
}
.kicker { color: var(--copper); margin: 28px 0 12px; }
.lede { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.45; max-width: 38ch; color: var(--ink); }

.home .stage {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(280px, 1.14fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  min-height: calc(100svh - var(--em-bar-h));
  padding: 36px max(20px, calc((100% - 1180px) / 2)) 48px;
  background:
    radial-gradient(70% 80% at 72% 46%, #2a3138 0%, rgba(18, 22, 26, 0) 58%),
    #12161a;
  color: #f4efe6;
}
.home .stage-copy { max-width: 36rem; }
.home .kicker { color: #e7a08a; margin: 0 0 16px; }
.home .kicker span + span::before { content: "·"; margin: 0 0.7em; color: #e07a4c; }
.home .stage h1 {
  color: #f7f3ec;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  max-width: 14ch;
  margin: 0 0 16px;
}
.home .lede {
  color: #d9d0c4;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 38ch;
  margin: 0 0 26px;
}
.home .enter {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  background: #efeae1;
  color: #1c1915;
  text-decoration: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.home .enter:hover { background: #e07a4c; color: #1c1915; }
.home .stage-model {
  position: relative;
  margin: 0;
  min-height: min(72vh, 640px);
}
.home .stage-model img,
.home .stage-model canvas {
  width: 100%;
  height: min(72vh, 640px);
  object-fit: contain;
}
.home .stage-model img { filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.45)); }
.home .stage-model canvas { display: none; cursor: grab; touch-action: none; }
.home .stage-model.live img { display: none; }
.home .stage-model.live canvas { display: block; }
.home .turn {
  position: absolute;
  left: 0;
  bottom: 8px;
  margin: 0;
  color: #c8c0b4;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
}
.home .stage-model.live .turn { opacity: 1; }

.home .models { padding: 42px 0 72px; }
.home .models h2 { margin-bottom: 18px; }
.home .models ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 18px;
}
.home .model {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #12161a;
  color: #f4efe6;
  text-decoration: none;
}
.home .model img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: radial-gradient(70% 80% at 50% 45%, #2a3138, #12161a 72%);
}
.home .cap { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; }
.home .meta { display: flex; gap: 12px; margin: 0; }
.home .cat, .home time { color: #c8c0b4; }
.home time { margin-left: auto; }
.home .name {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.home .sum { color: #d9d0c4; font-size: 1rem; }
.home .model:hover .name { color: #e7a08a; }

.prose { padding: 42px 0 80px; }
.prose h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.prose p { max-width: 62ch; font-size: 1.15rem; }

.flashes { list-style: none; margin: 16px auto; padding: 0; }
.flash { padding: 12px 14px; border: 1px solid var(--ink); background: #fff; }
.flash.error { border-color: #8f2d2d; }
.flash.ok { border-color: #2f6b3a; }

@media (max-width: 800px) {
  .home .stage {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 12px;
  }
  .home .stage-model { order: -1; min-height: min(46vh, 320px); }
  .home .stage-model img,
  .home .stage-model canvas { height: min(46vh, 320px); }
  .home .stage h1 { max-width: none; }
  h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
