:root {
  --bg: #e7eee8;
  --fg: #18241f;
  --muted: #5a6b63;
  --surface: #f7f3ea;
  --border: color-mix(in oklab, #18241f 16%, transparent);
  --primary: #1e3f34;
  --glass: #2d6a56;
  --glass-edge: #1c4a3c;
  --fog: #ffffff;
  --danger: #9b3d32;
  --stamp: #c45c4a;
  --font: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --display: "Source Serif 4", ui-serif, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html {
  background:
    radial-gradient(1200px 700px at 88% -10%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(900px 520px at 0% 100%, rgba(45, 106, 86, 0.08), transparent 55%),
    var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; font-family: var(--font); line-height: 1.5; min-height: 100dvh; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; font-weight: 500; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(24, 36, 31, 0.07) 0.7px, transparent 0.7px);
  background-size: 3px 3px;
  opacity: 0.55;
}

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
}
.top-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.lockup { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.lockup img { width: 22px; height: 22px; object-fit: contain; }
.lockup span { font-family: var(--display); }
.nav.desktop { display: none; gap: 0.25rem; }
.nav a { padding: 0.5rem 0.65rem; font-size: 0.875rem; color: var(--muted); }
.nav a.active, .nav a:hover { color: var(--fg); }
.nav.mobile { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0 0.75rem 0.5rem; }
.nav.mobile a {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.nav.mobile a.active { border-color: var(--glass-edge); color: var(--fg); }
.lang {
  min-width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.wrap { position: relative; max-width: 72rem; margin: 0 auto; padding: 2rem 1rem 6rem; }
.foot {
  border-top: 1px solid var(--border);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}
.foot p { max-width: 36rem; margin: 0.5rem auto 0; }

.kicker { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.hero { display: grid; gap: 2rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.75rem); margin: 0.5rem 0 0; max-width: 48rem; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 0.5rem;
  background: var(--primary);
  color: var(--surface);
  font-weight: 500;
}
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.card {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  border-radius: 0.85rem;
  padding: 1rem;
}
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; display: flex; gap: 0.75rem; }
.clock b { display: block; font-size: 1.35rem; font-weight: 500; }
.clock span { display: block; margin-top: 0.25rem; font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.seats { display: grid; gap: 0.75rem; margin-top: 2.5rem; }
.houses { display: flex; align-items: flex-end; gap: 0.25rem; margin-top: 1rem; }
.chip {
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.85rem;
  font-size: 0.875rem;
  color: var(--muted);
}
.chip.on, .seat-btn.on { border-color: var(--glass-edge); color: var(--fg); }
.seat-btn {
  text-align: left;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.65rem;
  padding: 0.75rem;
}
.seat-btn b { display: block; font-family: var(--display); font-weight: 500; }
.seat-btn span { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.65rem;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.choice.on { border-color: var(--glass-edge); }
.stack { display: grid; gap: 0.5rem; }
textarea {
  width: 100%;
  min-height: 7rem;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 0.65rem;
  padding: 0.75rem;
  font: inherit;
}
.house-list { display: grid; gap: 1rem; margin-top: 2rem; }
.house-link { display: flex; align-items: center; gap: 1rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.paper {
  max-width: 22rem;
  margin-top: 2rem;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  box-shadow: 8px 14px 40px rgba(24, 36, 31, 0.08);
  transform: rotate(-1.15deg);
  border-radius: 0.85rem;
  padding: 1.25rem;
}
.paper .kicker { color: var(--muted); }
.paper p.hint { font-size: 0.75rem; color: var(--muted); }
.paper img, .paper canvas { display: block; width: 10rem; height: 10rem; margin-top: 1rem; background: var(--surface); }
.lede {
  max-width: 36rem;
  margin: 1rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-style: italic;
  line-height: 1.3;
}
.square { --beat: 1; --mx: 50%; --my: 22%; --mxn: 0.5; --myn: 0.22; position: relative; }
.square[data-story="seen"] { --beat: 0; }
.daylight {
  pointer-events: none;
  position: absolute;
  inset: -6rem;
  z-index: 0;
  background: radial-gradient(460px circle at var(--mx) var(--my), rgba(255,255,255,.58), transparent 58%);
  opacity: 0.85;
}
.square > *:not(.daylight):not(.veil) { position: relative; z-index: 1; }
.live-headline {
  transform: translate3d(calc((var(--mxn) - 0.5) * 18px), calc((var(--myn) - 0.5) * 8px), 0);
  transition: transform 500ms cubic-bezier(.22,1,.36,1);
}
.live-card {
  position: relative;
  transform: perspective(740px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(0);
  transition: transform 180ms cubic-bezier(.23,1,.32,1), box-shadow 180ms cubic-bezier(.23,1,.32,1);
}
.live-card:hover {
  box-shadow: 10px 20px 44px rgba(24, 36, 31, 0.12);
  transform: perspective(740px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-8px);
}
.live-card::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(160px circle at var(--hx, 50%) var(--hy, 20%), rgba(255,255,255,.55), transparent 62%);
  opacity: 0;
  transition: opacity 180ms;
}
.live-card:hover::after { opacity: 1; }
.live-house {
  display: block;
  transform-origin: 50% 100%;
  transition: transform 220ms cubic-bezier(.23,1,.32,1);
}
.live-house:hover { transform: translateY(-12px) scale(1.08); }
.glass-gleam { opacity: 0; }
.live-house:hover .glass-gleam { animation: gleam 720ms cubic-bezier(.23,1,.32,1); }
.live-house:hover .frost-pane {
  opacity: calc(var(--frost-to, 0.5) * 0.38);
  transition: opacity 280ms;
}
.live-notice {
  transform: perspective(640px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 180ms cubic-bezier(.23,1,.32,1);
}
@keyframes gleam {
  0% { opacity: 0; transform: translateX(-10px); }
  35% { opacity: 0.9; }
  100% { opacity: 0; transform: translateX(54px); }
}
.veil {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 24;
  background: linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(231,238,232,.42) 55%, rgba(231,238,232,.08) 100%);
  backdrop-filter: blur(14px);
  animation: veil-lift 1.4s .05s cubic-bezier(.22,1,.36,1) forwards;
}
.ink {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(14px);
  animation: ink-dry 880ms cubic-bezier(.22,1,.36,1) forwards;
}
.ink-1 { animation-delay: calc(var(--beat) * 720ms); }
.ink-2 { animation-delay: calc(var(--beat) * 1100ms); }
.ink-3 { animation-delay: calc(var(--beat) * 1580ms); }
.ink-4 { animation-delay: calc(var(--beat) * 2100ms); }
.ink-5 { animation-delay: calc(var(--beat) * 1980ms); }
.ink-6 { animation-delay: calc(var(--beat) * 3180ms); }
.seat-rise {
  opacity: 0;
  transform: translateY(24px);
  animation: rise 780ms cubic-bezier(.22,1,.36,1) forwards;
}
.notice {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1.25rem;
  box-shadow: 8px 14px 40px rgba(24, 36, 31, 0.08);
  transform: rotate(-1.15deg);
}
.notice.ink { animation-name: notice-in; }
.stamp {
  position: absolute;
  right: -0.4rem;
  top: -0.7rem;
  display: inline-block;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  transform: rotate(-8deg);
  animation: stamp-in 420ms calc(var(--beat) * 2480ms) cubic-bezier(.23,1,.32,1) both;
}
.frost-thaw { animation: thaw 1.5s cubic-bezier(.22,1,.36,1) both; }
.desk-sheet { animation: sheet-in 700ms cubic-bezier(.22,1,.36,1) both; }
.choice-in { opacity: 0; transform: translateY(10px); animation: rise 520ms cubic-bezier(.22,1,.36,1) forwards; }
.square[data-story="seen"] .ink,
.square[data-story="seen"] .seat-rise,
.square[data-story="seen"] .stamp,
.square[data-story="seen"] .frost-thaw { animation: none; opacity: 1; filter: none; transform: none; }
.square[data-story="seen"] .notice { transform: rotate(-1.15deg); }
.square[data-story="seen"] .stamp { transform: rotate(-8deg); }
.square[data-story="seen"] .frost-thaw { opacity: var(--frost-to); }
.square[data-story="seen"] .veil { display: none; }
@keyframes ink-dry { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(-8deg) scale(1.55); }
  70% { opacity: 1; transform: rotate(-8deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@keyframes notice-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(18px) rotate(-1.15deg); }
  to { opacity: 1; filter: blur(0); transform: rotate(-1.15deg); }
}
@keyframes veil-lift { to { opacity: 0; visibility: hidden; } }
@keyframes thaw { from { opacity: .92; } to { opacity: var(--frost-to); } }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px) rotate(-.6deg); }
  to { opacity: 1; transform: none; }
}
.method { max-width: 40rem; }
.method ol { padding-left: 1.25rem; }
.method li + li { margin-top: 0.75rem; }
.play-grid { display: grid; gap: 2.5rem; }
.aside { display: none; }

@media (min-width: 640px) {
  .seats { grid-template-columns: 1fr 1fr; }
  .house-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .nav.desktop { display: flex; }
  .nav.mobile { display: none; }
  .hero { grid-template-columns: 1.3fr 0.7fr; align-items: end; }
  .seats, .house-list { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .house-list.two { grid-template-columns: 1fr 1fr; }
  .play-grid { grid-template-columns: minmax(0,1fr) 240px; }
  .aside { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .veil, .daylight { display: none; }
  .ink, .seat-rise, .stamp, .frost-thaw, .desk-sheet, .choice-in, .live-card, .live-house, .live-headline, .live-notice {
    animation: none !important;
    opacity: 1;
    filter: none;
    transform: none !important;
  }
  .notice { transform: rotate(-1.15deg); }
  .stamp { transform: rotate(-8deg); }
  .frost-thaw { opacity: var(--frost-to); }
}
