:root {
  --paper: #f3eee3;
  --paper-2: #fffaf1;
  --ink: #1b1712;
  --muted: #6d665b;
  --line: #ddd4c3;
  --stage: #0c0b09;
  --stage-2: #1a1814;
  --stage-ink: #f6f1e6;
  --stage-muted: #a79f90;
  --cinnabar: #b23a2c;
  --cinnabar-deep: #7a241f;
  --gold: #d4a84b;
  --teal: #2f6b5c;
  --rose: #d98990;
  --radius: 16px;
  --sans: "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}
a { color: var(--cinnabar-deep); }
code, pre { font-family: var(--mono); }
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; font-family: var(--serif); }
h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 0.4rem; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold);
  color: var(--stage);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

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

.eyebrow {
  margin: 0 0 12px;
  font: 700 12px/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cinnabar);
}
.eyebrow.gold { color: var(--gold); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.94rem;
  font-family: inherit;
  background: none;
}
.btn.primary { background: var(--cinnabar); color: #fff; }
.btn.quiet { color: var(--stage-ink); border-color: #4a463d; }
.btn.quiet:hover { border-color: var(--gold); }

.hero {
  background: var(--stage);
  color: var(--stage-ink);
  padding: 22px 0 64px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.back {
  display: inline-block;
  color: var(--stage-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin: 0 0 28px;
}
.back:hover { color: var(--gold); }
h1 {
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  font-family: var(--sans);
}
.lede {
  margin: 16px 0 22px;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--stage-muted);
}

.slate-mascot {
  position: relative;
  width: 118px;
  height: 96px;
  margin: 0 0 22px;
}
.slate-mascot .body {
  position: absolute;
  left: 0;
  top: 26px;
  width: 118px;
  height: 70px;
  border-radius: 8px;
  background: #2a221c;
  border: 2px solid #f6f1e6;
}
.slate-mascot .body i {
  position: absolute;
  left: 12px;
  height: 3px;
  background: #6f6a5c;
  border-radius: 2px;
}
.slate-mascot .body i:nth-child(1) { top: 16px; width: 54px; }
.slate-mascot .body i:nth-child(2) { top: 28px; width: 78px; }
.slate-mascot .body i:nth-child(3) { top: 40px; width: 40px; }
.slate-mascot .eyes {
  position: absolute;
  left: 18px;
  bottom: 12px;
  width: 28px;
  height: 8px;
  background:
    radial-gradient(circle at 4px 4px, #f6f1e6 3px, transparent 4px),
    radial-gradient(circle at 22px 4px, #f6f1e6 3px, transparent 4px);
}
.slate-mascot .body span:last-child {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font: 700 12px/1 var(--mono);
  color: var(--gold);
}
.slate-mascot .stick {
  position: absolute;
  left: 0;
  top: 4px;
  width: 118px;
  height: 20px;
  border-radius: 4px;
  transform-origin: 6px 100%;
  background: repeating-linear-gradient(-45deg, #f6f1e6 0 12px, #0c0b09 12px 24px);
  border: 2px solid #f6f1e6;
  animation: clap 3.4s cubic-bezier(.2, .9, .2, 1) infinite;
}
@keyframes clap {
  0%, 58% { transform: rotate(-30deg); }
  68%, 100% { transform: rotate(0deg); }
}

.install {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px 12px 12px 16px;
  border-radius: 12px;
  background: var(--stage-2);
  border: 1px solid #35322a;
}
.install code { font-size: 0.88rem; color: var(--stage-ink); overflow-wrap: anywhere; }
.install code b { color: var(--gold); font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.title-card { margin: 0; }
.stage-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid #35322a;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.stage-frame svg { display: block; width: 100%; height: auto; }
.title-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font: 600 12px/1.4 var(--mono);
  color: var(--stage-muted);
  letter-spacing: 0.03em;
}
.hud {
  position: absolute;
  left: 12px;
  top: 10px;
  font: 700 12px/1 var(--mono);
  color: var(--gold);
  letter-spacing: 0.08em;
}
.play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(12, 11, 9, 0.72);
  color: var(--stage-ink);
  border: 1px solid #4a463d;
  border-radius: 8px;
  padding: 6px 10px;
  font: 700 12px/1 var(--mono);
  cursor: pointer;
}

.block { padding: 72px 0; border-top: 1px solid var(--line); }
.intro { margin: 12px 0 26px; color: var(--muted); font-size: 1.05rem; }

.demo {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}
.demo > *, .music > *, .hero-grid > *, .two > * { min-width: 0; }
.viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #35322a;
}
.viewport svg { width: 100%; height: 100%; display: block; }
.scrub {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  font: 600 12px var(--mono);
  color: var(--muted);
}
.scrub input[type="range"] { width: 100%; accent-color: var(--cinnabar); }
.note { margin: 12px 0 0; color: var(--muted); font-size: 0.92rem; }
pre {
  margin: 0;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--stage);
  color: var(--stage-ink);
  font-size: 0.78rem;
  line-height: 1.55;
  overflow-x: auto;
}
.c { color: #7d786a; }
.k { color: #8fc1d9; }
.n { color: var(--gold); }
.s { color: var(--gold); }

.pipe {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.pipe li {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
}
.pipe li + li::before {
  content: "→";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  background: var(--paper);
  padding: 0 2px;
}
.pipe b { display: block; margin-bottom: 4px; }
.pipe span { color: var(--muted); font-size: 0.82rem; }
.pipe .out { background: #f4e4d8; border-color: #e2c4b4; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.cards article, .posters article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.cards p, .posters p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.music {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.roll {
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 14px;
}
.roll svg { width: 100%; height: auto; display: block; }
.roll-cap {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 0;
  font: 600 12px var(--mono);
  color: var(--muted);
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.facts div {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.facts b { display: block; font-size: 1.5rem; letter-spacing: -0.03em; }
.facts span { color: var(--muted); font-size: 0.82rem; }

.sheet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.thumb {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--stage);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}
.thumb svg { display: block; width: 100%; height: auto; }
.thumb.active { outline: 2px solid var(--cinnabar); outline-offset: 1px; }
.thumb-cap {
  display: block;
  padding: 6px 8px 8px;
  background: var(--paper-2);
  font: 600 11px/1.3 var(--mono);
  color: var(--muted);
}

.posters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.posters article { padding: 0 0 18px; overflow: hidden; }
.poster {
  height: 132px;
  display: grid;
  place-items: center;
  color: #f6f1e6;
  font: 800 28px/1 var(--serif);
  margin-bottom: 12px;
}
.poster-a { background: radial-gradient(circle at 30% 20%, #f1c95a, #7a241f); }
.poster-b { background: linear-gradient(135deg, #173f31, #8fc1d9); }
.poster-c { background: repeating-linear-gradient(90deg, #1b1712 0 12px, #2a221c 12px 24px); }
.poster-d { background: linear-gradient(180deg, #2f6b5c, #1b1712); }
.posters .meta {
  padding: 0 18px;
  font: 600 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.posters h3, .posters p { padding: 0 18px; }

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
ul, .rules { margin: 0; padding-left: 1.15rem; }
li { margin: 8px 0; }
.rules { margin-top: 28px; }

.close {
  background: var(--stage);
  color: var(--stage-ink);
  padding: 72px 0;
}
.close h2 { color: var(--stage-ink); }
.close .lede { color: var(--stage-muted); }
blockquote {
  margin: 18px 0 0;
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  color: var(--stage-ink);
  background: var(--stage-2);
  border-radius: 0 12px 12px 0;
  font-size: 1rem;
}
.close .actions { margin-top: 22px; }

footer {
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
footer .shell { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer p { margin: 0; }
footer a { color: var(--cinnabar-deep); }

@media (prefers-reduced-motion: reduce) {
  .slate-mascot .stick { animation: none; }
}

@media (max-width: 900px) {
  .shell { width: min(100% - 28px, 680px); }
  .hero-grid, .demo, .music, .two { grid-template-columns: 1fr; gap: 24px; }
  .pipe { grid-template-columns: 1fr; }
  .pipe li + li::before {
    content: "↓";
    left: 50%;
    top: -14px;
    transform: translateX(-50%);
  }
  .cards, .posters, .sheet { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
  h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .install { grid-template-columns: 1fr; }
  .title-card figcaption { flex-direction: column; }
}

@media (max-width: 560px) {
  .cards, .posters, .sheet { grid-template-columns: 1fr; }
}
