:root {
  color-scheme: dark;
  --body: "PingFang TC","Noto Sans TC","Source Han Sans TC","Microsoft JhengHei",system-ui,sans-serif;
  --display: "LXGW WenKai TC", "PMingLiU", serif;
  --stage: #120c0a;
  --stage-raised: #211511;
  --ink: #f6eedc;
  --muted: #d5bfa7;
  --accent: #f3d58c;
  --accent-ink: #26130d;
  --edge: #805238;
  --rule: #f3d58c36;
  --honey: #f3d58c;
  --amber: #e0873a;
  --paper: #f5e5c5;
  --paper-ink: #301c13;
  --paper-rule: #734b3d58;
  --shell: clamp(15px, 3.1vw, 62px);
  --mast: clamp(64px, 8.2vh, 94px);
  --foot: clamp(80px, 10vh, 110px);
}



*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--stage); color: var(--ink); font: 16px/1.72 var(--body); }
h1, h2, h3, p, ol, dl, dd { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:is(button, input, textarea, select, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.display { font-family: var(--display); font-weight: 400; line-height: 1.22; letter-spacing: 0; font-synthesis: none; text-wrap: balance; }

.theatre {
  height: var(--theatre-height, 100dvh);
  display: grid;
  grid-template-rows: var(--mast) minmax(0, 1fr) var(--foot);
  padding-inline: var(--shell);
  background: radial-gradient(ellipse at 50% 58%, var(--stage-raised), transparent 78%), var(--stage);
}
.is-lit .theatre::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #000;
  pointer-events: none;
  animation: house-lights 1000ms both;
}
@keyframes house-lights { 0%, 14% { opacity: 1; } 100% { opacity: 0; } }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-inline: clamp(1px, 0.7vw, 14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(20px, 2vw, 29px); white-space: nowrap; }
.brand .display { white-space: inherit; }
.lamp-mark { position: relative; display: block; flex: 0 0 25px; width: 25px; aspect-ratio: 1; border: 1px solid var(--accent); transform: rotate(45deg); }
.lamp-mark::before { content: ""; position: absolute; inset: 5px 6px 7px 7px; background: var(--accent); border-radius: 65% 12% 67% 60%; }
.lamp-mark::after { content: ""; position: absolute; top: 15px; left: 12px; width: 11px; height: 1px; background: var(--accent); transform: translate(-50%, 1px) rotate(-45deg); }
.header-actions { display: flex; align-items: center; gap: clamp(8px, 1.5vw, 28px); }
.button, .sound-toggle, .menu-toggle, .close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.button { min-height: 48px; padding: 0 19px; gap: 18px; font-weight: 700; }
.button--primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.button--outline, .button--quiet { border-color: var(--rule); }
.button--quiet { min-width: 78px; }
.button--primary:hover { filter: brightness(1.12); }
.button--quiet:hover, .button--outline:hover { border-color: var(--accent); }
.sound-toggle, .menu-toggle { min-width: 44px; padding: 0 5px; color: var(--muted); }
.sound-toggle[aria-pressed="true"], .sound-toggle:hover, .menu-toggle:hover { color: var(--accent); }
.sound-icon { position: relative; width: 20px; height: 17px; }
.sound-icon::before { content: ""; position: absolute; inset: 1px 7px 1px 0; background: currentColor; clip-path: polygon(0 32%, 38% 32%, 100% 0, 100% 100%, 38% 68%, 0 68%); }
.sound-icon::after { content: ""; position: absolute; width: 7px; height: 1px; right: 0; top: 8px; background: currentColor; transform: rotate(-45deg); }
[aria-pressed="true"] .sound-icon::after { width: 7px; height: 13px; top: 2px; background: none; border: 1px solid transparent; border-right-color: currentColor; border-radius: 50%; transform: none; }
.menu-toggle > span:first-child { width: 22px; height: 10px; border-block: 1px solid currentColor; }

.screen { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--edge); background: #050304; perspective: 1550px; }
.screen:not([data-act="2"], [data-act="3"], [data-act="4"]) { touch-action: none; }
.gesture-surface { position: absolute; inset: 0; touch-action: none; }
.screen-turn, .screen-face, .screen-light, .projection, .rivet-glow, .screen-finish, .lamp-dimmer, .screen-stitches {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.screen-turn { z-index: 0; transform-style: preserve-3d; transition: transform 1050ms cubic-bezier(0.55, 0.03, 0.3, 1); }
.screen[data-act="3"] .screen-turn { transform: rotateY(180deg); }
.screen-face { backface-visibility: hidden; isolation: isolate; }
.screen-front { background: #050304; }
.screen-back { transform: rotateY(180deg); background: var(--stage); }
.screen-light {
  background:
    radial-gradient(ellipse 42% 75% at var(--lamp-x, 70%) var(--lamp-y, 55%), var(--honey) 0%, #f6cf7c 32%, #eea451 60%, #b46032 78%, #6d3120 100%),
    var(--amber);
  opacity: 1;
  transform: scale(1.025);
}
.is-lit .screen-light { animation: lamp-on 1450ms ease-out both, flame 6.5s 1450ms ease-in-out infinite alternate; }
.projection { mix-blend-mode: multiply; }
.screen-finish {
  background:
    linear-gradient(90deg, #1a0b09 0%, #211009f5 18%, #30150ad6 29%, #30150a8c 37%, #2e110a12 49%, transparent 62%),
    radial-gradient(ellipse at 65% 51%, transparent 45%, #260e0960 76%, #1b0d0adc 100%),
    repeating-linear-gradient(95deg, #3e210715 0 1px, transparent 1px 4px),
    repeating-linear-gradient(1deg, #fff2cc16 0 1px, transparent 1px 3px);
}
.screen-stitches {
  inset: 7px;
  width: auto;
  height: auto;
  border: 1px solid #eed0a22b;
  box-shadow: 0 0 0 6px #0e080726, inset 0 0 22px #1408042e;
}
.moon-space { position: absolute; inset: 0 0 0 37%; opacity: 0; pointer-events: none; transition: opacity 900ms; z-index: 1; mix-blend-mode: screen; }
[data-act="1"] .moon-space { opacity: 1; }
.projection { z-index: 2; }
.rivet-glow { z-index: 4; }
.screen-finish, .screen-stitches { z-index: 3; }
.lamp-dimmer { z-index: 5; background: #120c0a; opacity: var(--dimmer, 0); }
.moon {
  position: absolute;
  width: min(44%, 46vh);
  aspect-ratio: 1;
  top: 7%;
  left: 52%;
  translate: -50% 0;
  border-radius: 50%;
  background:
    repeating-linear-gradient(97deg, #ad6a3028 0 1px, transparent 1px 5px),
    repeating-linear-gradient(3deg, #ffefba52 0 1px, transparent 1px 3px),
    radial-gradient(circle at 40% 35%, #fff9d6e8, #ffdc909b 66%, #eea05a10 100%);
  box-shadow: 0 0 45px #f3d58c35;
}
@keyframes lamp-on { from { opacity: 0; } to { opacity: 1; } }
@keyframes flame { 0%, 100% { transform: scale(1.025); filter: brightness(1); } 23% { transform: translate(0.35%, -0.25%) scale(1.026); filter: brightness(1.025); } 67% { transform: translate(-0.28%, 0.24%) scale(1.031); filter: brightness(0.98); } }

.act { position: absolute; z-index: 4; inset: 0; display: grid; opacity: 0; visibility: hidden; pointer-events: none; }
.act.is-current, .act.is-leaving { visibility: visible; }
.act.is-current { opacity: 1; }
.act.is-current :is(button, a, input, textarea, select, label, [data-act-scroll]) { pointer-events: auto; }
.act.is-leaving { opacity: 0; transition: opacity 330ms ease-out; }
.act--backstage.is-leaving { opacity: 1; }
[data-act-scroll] { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--edge) transparent; }
.act--opening {
  grid-template-columns: 45% 55%;
  align-items: center;
}
.opening-copy { padding-inline-start: clamp(28px, 6.6vw, 136px); }
.act-title { font-size: clamp(56px, 7.5vw, 148px); }
.act-title:focus { outline: none; }
.title-line { display: block; white-space: nowrap; }
.title-glyph, .title-word { display: inline-block; }
.is-lit .act.is-current .title-glyph { animation: imprint 860ms both; animation-delay: calc(var(--glyph) * var(--glyph-delay, 62ms) + 200ms + var(--reveal-after, 0ms)); }
@keyframes imprint {
  from { opacity: 0; filter: blur(16px); transform: translateY(6%) scale(1.38); }
  to { opacity: 1; filter: blur(0); transform: none; }
}
.opening-line { margin-top: clamp(11px, 2.2vh, 28px); font-size: clamp(18px, 2vw, 30px); }
.opening-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: clamp(20px, 4.1vh, 48px); }
.is-lit .act.is-current [data-read-in] { animation: read-in 650ms calc(240ms + var(--reveal-after, 0ms)) both; }
@keyframes read-in { from { opacity: 0; } to { opacity: 1; } }
.hero-space { height: 100%; }
.puppet-hint {
  position: absolute;
  bottom: clamp(18px, 3%, 32px);
  right: clamp(20px, 4.1vw, 85px);
  border: 1px solid #fff5d74f;
  padding: 4px 10px;
  background: #1e0e0bdc;
  color: var(--ink);
  font-size: 14px;
}
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-touch { display: inline; } .hint-desktop { display: none; } }

.act--show {
  grid-template: "intro performance" auto "details performance" 1fr / 35% 65%;
  padding-block: clamp(22px, 8vh, 105px);
}
.show-intro, .show-details { padding-inline: clamp(23px, 4.4vw, 100px) clamp(10px, 1.8vw, 30px); }
.show-intro { grid-area: intro; }
.season-label { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 14px; font-weight: 700; }
.season-label::before { content: ""; display: block; width: 21px; height: 1px; background: currentColor; }
.show-intro .act-title { font-size: clamp(61px, 8.2vw, 150px); }
.synopsis { max-width: 24em; margin-top: 10px; font-size: clamp(15px, 1.2vw, 20px); text-wrap: pretty; }
.show-details { grid-area: details; padding-top: clamp(14px, 3.8vh, 45px); }
.facts { margin-bottom: clamp(14px, 2.6vh, 32px); border-top: 1px solid var(--rule); font-size: clamp(14px, 1.04vw, 18px); line-height: 1.7; }
.facts > div { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); align-items: baseline; gap: 4px; padding: 7px 0; overflow: hidden; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.is-lit .act.is-current :is(.facts > div > *, [data-craft-step] > *, [data-fact] > label) {
  animation: fact-reveal 600ms both;
  animation-delay: calc(350ms + var(--row) * 135ms + var(--reveal-after, 0ms));
}
@keyframes fact-reveal { from { transform: translateY(115%) rotate(2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.performance { position: absolute; inset: 0 0 0 35%; }
.caption { position: absolute; left: 50%; bottom: 6%; translate: -50% 0; width: max-content; max-width: calc(100% - 28px); padding: 6px 14px; border: 1px solid #d8b98470; background: #1e120de8; text-align: center; font-size: clamp(14px, 1.3vw, 21px); }
.caption-line { display: none; }
.caption-line.is-spoken { display: block; }
.is-lit .caption-line.is-spoken { animation: read-in 420ms both; }
.caption-line span { margin-right: 0.8em; padding-right: 0.75em; color: var(--accent); border-right: 1px solid var(--rule); font-size: 14px; font-weight: 700; white-space: nowrap; }

.stage-foot { display: grid; align-items: center; justify-items: center; }
.act-nav { display: grid; grid-template-columns: repeat(5, minmax(73px, 1fr)); gap: clamp(6px, 1.35vw, 26px); }
.act-stop {
  min-height: 56px;
  padding: 4px 5px 5px;
  display: grid;
  gap: 1px;
  justify-items: center;
  align-items: center;
  border: 1px solid transparent;
  border-top-color: var(--rule);
  background: transparent;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}
.act-stop[aria-current] { background: var(--rule); color: var(--accent); border-color: var(--rule); border-top-color: var(--accent); }
.act-stop:hover { border-color: var(--accent); color: var(--accent); }
.head-cutout {
  display: inline-block;
  width: 30px;
  height: 24px;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center top;
  mask-size: 28px auto;
  opacity: 0.92;
}
.head-cutout--boy { mask-image: url("../pieces/puppets/boy-body.webp"); }
.head-cutout--ferryman { mask-image: url("../pieces/puppets/ferryman-body.webp"); }
.head-cutout--craft { mask-image: url("../pieces/puppets-2/grandma-body.webp"); }
.head-cutout--backstage {
  mask-image: url("../pieces/puppets-2/warrior-body.webp");
  mask-size: 47px auto;
  mask-position: right top;
}
.head-cutout--finale { mask-image: url("../pieces/tools/oil-lamp.webp"); mask-size: contain; }

dialog { padding: 0; color: var(--ink); background: var(--stage); border: 1px solid var(--edge); overscroll-behavior: contain; }
dialog::backdrop { background: #070508be; }
.close-button { width: 44px; min-width: 44px; padding: 0; border-color: currentColor; }
.close-button span { position: relative; width: 17px; height: 17px; }
.close-button span::before, .close-button span::after { content: ""; position: absolute; inset: 8px 0 auto; height: 1px; background: currentColor; transform: rotate(45deg); }
.close-button span::after { transform: rotate(-45deg); }
.menu-dialog {
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  isolation: isolate;
  background: radial-gradient(ellipse 80% 80% at 50% 35%, #67331b, var(--stage) 78%);
  opacity: 0;
  overflow: auto;
  transition: opacity 220ms ease-out, overlay 220ms allow-discrete, display 220ms allow-discrete;
}
.menu-dialog[open] { opacity: 1; animation: menu-light 640ms ease-out both; }
@keyframes menu-light { from { filter: brightness(0.18); } to { filter: brightness(1); } }
.menu-curtains {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  overflow: hidden;
  pointer-events: none;
}
.menu-curtains::before, .menu-curtains::after {
  content: "";
  flex: 1;
  background: repeating-linear-gradient(90deg, transparent 0 5px, #efdcb91d 5px 6px), linear-gradient(90deg, var(--stage-raised), var(--stage));
  animation: curtain-left 650ms cubic-bezier(0.24, 0.72, 0.3, 1) both;
}
.menu-curtains::after { animation-name: curtain-right; }
@keyframes curtain-left { from { transform: none; } to { transform: translateX(-100%); } }
@keyframes curtain-right { from { transform: none; } to { transform: translateX(100%); } }
.menu-layout { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; width: min(100%, 920px); min-height: 100%; margin: auto; padding: clamp(17px, 3.5vh, 48px) clamp(21px, 6vw, 76px); }
.menu-header, .menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.menu-acts { align-self: center; display: grid; border-top: 1px solid var(--rule); }
.menu-act {
  display: grid;
  grid-template-columns: 41px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: clamp(6px, 1.25vh, 18px) 3px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  line-height: 1.4;
  text-align: left;
}
.menu-act[aria-current], .menu-act:hover { color: var(--accent); }
.menu-act strong { display: block; font-size: clamp(24px, 4.5vw, 46px); }
.menu-act small { display: block; font-size: 14px; line-height: 1.7; }
.menu-arrow { justify-self: center; }
.menu-footer address { font-size: 14px; font-style: normal; line-height: 1.7; text-align: right; }

.program-dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(calc(100% - 28px), 1030px);
  max-width: none;
  max-height: min(90dvh, 850px);
  margin: 0 auto;
  color: var(--paper-ink);
  background:
    repeating-linear-gradient(95deg, #8268440c 0 1px, transparent 1px 5px),
    var(--paper);
  border: 1px solid var(--paper-rule);
  border-top: 5px solid var(--edge);
  overflow: auto;
}
.program-dialog[open] { animation: program-up 420ms cubic-bezier(0.25, 0.75, 0.25, 1) both; }
@keyframes program-up { from { transform: translateY(105%); } to { transform: none; } }
.program-dialog :focus-visible { outline-color: var(--paper-ink); }
.program-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--paper-rule); padding: 17px clamp(16px, 4vw, 54px); }
.program-header p { font-size: 14px; }
.program-header h2 { font-size: clamp(36px, 5vw, 66px); }
.program-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: clamp(22px, 4vw, 54px); padding: 20px clamp(16px, 4vw, 54px) 32px; }
.program-body h3 { margin-bottom: 5px; font-size: 21px; line-height: 1.4; }
.program-story ol { padding-left: 1.4em; }
.program-story li { padding: 7px 0 8px 5px; }
.program-story li p, .program-notes, .program-times > p { font-size: 14px; }
.program-notes { padding-top: 10px; border-top: 1px solid var(--paper-rule); }
.schedule { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; font-variant-numeric: tabular-nums; }
.schedule thead { border-block: 1px solid var(--paper-rule); }
.schedule th, .schedule td { padding: 3px 2px; }
.schedule tr + tr { border-top: 1px solid var(--paper-rule); }
.schedule tbody th { font-weight: 400; }
.schedule button { min-width: 52px; min-height: 44px; padding: 0 5px; border: 1px solid var(--paper-rule); background: transparent; }
.schedule button:hover, .schedule button[aria-pressed="true"] { background: var(--paper-ink); color: var(--paper); }
.ticket-status { margin-top: 10px; font-weight: 700; }

.screen[data-act="2"] .screen-light { --lamp-x: 69%; }
.screen[data-act="2"] .screen-finish {
  background:
    linear-gradient(90deg, #190c0a 0%, #25130cf2 20%, #35190d88 35%, transparent 49%),
    radial-gradient(ellipse at 66% 51%, transparent 49%, #230e0a99 100%),
    repeating-linear-gradient(1deg, #fff2cc17 0 1px, transparent 1px 3px);
}
.act--craft, .act--backstage, .act--finale {
  --act-padding-x: clamp(24px, 4.2vw, 84px);
  --act-padding-y: clamp(18px, 5.6vh, 70px);
  align-content: center;
}
.act--craft .act-title, .act--backstage .act-title, .act--finale .act-title {
  font-size: clamp(38px, min(5.7vw, 8.5vh), 110px);
}
.act--craft {
  grid-template: "title art" auto "detail art" minmax(0, auto) / minmax(0, 33%) minmax(0, 1fr);
  padding: var(--act-padding-y) 0 var(--act-padding-y) var(--act-padding-x);
}
.act--craft .act-title { grid-area: title; margin-bottom: clamp(11px, 2.3vh, 28px); }
.craft-space { grid-area: art; height: 100%; position: relative; }
.craft-tools { position: absolute; inset: 0 7% 0 auto; width: 24%; }
.craft-tool {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6%;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 440ms, transform 520ms;
}
.craft-tool.is-shown { opacity: 1; transform: none; }
.craft-tool img { width: 100%; height: auto; max-height: 78%; object-fit: contain; }
.craft-tool--knives img { width: min(24%, 58px); }
.craft-tool--knives img:nth-child(1) { transform: rotate(-14deg) translateY(6%); }
.craft-tool--knives img:nth-child(3) { transform: rotate(14deg) translateY(6%); }
.craft-tool--sketch { mix-blend-mode: multiply; }
.craft-details { grid-area: detail; padding: 3px 4px; margin: -3px -4px; }
.craft-steps { padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.craft-steps button {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  background: #1a0c0a4d;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-size: 14px;
  overflow: hidden;
}
.craft-steps button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.craft-steps button[aria-pressed="false"]:hover { background: #f3d58c24; }
.craft-steps button:focus-visible { outline-offset: -3px; }
.craft-steps button[aria-pressed="true"]:focus-visible { outline-color: var(--accent-ink); }
.craft-note { min-height: 3.5em; padding: 10px 8px 0; color: var(--ink); font-size: clamp(14px, 1.03vw, 18px); }

.act--backstage {
  --reveal-after: 515ms;
  grid-template: "title photo" minmax(0, 0.36fr) "detail photo" minmax(0, 0.64fr) / minmax(0, 31%) minmax(0, 1fr);
  align-content: stretch;
  background: radial-gradient(ellipse at right, #2b1b14, var(--stage) 74%);
}
.act--backstage .act-title {
  grid-area: title;
  align-self: end;
  margin: var(--act-padding-y) 0 0 var(--act-padding-x);
}
.backstage-photo {
  grid-area: photo;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.backstage-details {
  grid-area: detail;
  padding: 12px clamp(15px, 2.1vw, 38px) var(--act-padding-y) var(--act-padding-x);
}
.crew-count { margin-bottom: clamp(10px, 2.3vh, 26px); font-size: clamp(16px, 1.45vw, 24px); }
.backstage-details .facts > div { grid-template-columns: minmax(4.6em, auto) minmax(0, 1fr); }
.backstage-details .facts dd { font-weight: 400; }
.crew-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(20px, 5vw, 62px);
  margin: 0;
  padding: 5px clamp(16px, 4vw, 54px) 24px;
  list-style: none;
}
.crew-list li { padding-block: 16px; border-bottom: 1px solid var(--paper-rule); }
.crew-list h3 { font-size: 22px; line-height: 1.3; text-wrap: balance; }
.crew-list p { margin-top: 4px; font-size: 14px; }
.crew-list .crew-role { color: #674026; font-weight: 700; }

.screen[data-act="4"] .screen-light { --lamp-x: 26%; }
.screen[data-act="4"] .screen-finish {
  background:
    radial-gradient(ellipse at 28% 50%, transparent 36%, #200e0b8c 68%, #140b09d1 100%),
    repeating-linear-gradient(1deg, #fff2cc18 0 1px, transparent 1px 3px);
}
.act--finale {
  grid-template: "title form" auto "bow form" minmax(0, 1fr) / minmax(0, 1.15fr) minmax(0, 1fr);
  align-content: stretch;
  padding: var(--act-padding-y) clamp(20px, 4vw, 68px) var(--act-padding-y) clamp(18px, 2.7vw, 55px);
  column-gap: clamp(14px, 3vw, 58px);
}
.act--finale .act-title {
  grid-area: title;
  margin: 0 auto;
  padding: 5px 0 0;
  color: var(--ink);
  text-shadow: 0 1px 12px #2e1609, 0 1px 2px #241105;
}
.bow-space { grid-area: bow; }
.invitation { grid-area: form; padding: 4px; margin: -4px; align-self: center; max-height: calc(100% + 8px); }
.invitation-form {
  padding: clamp(12px, 2vh, 24px) clamp(14px, 2.1vw, 32px);
  color: var(--paper-ink);
  background: radial-gradient(ellipse at 45% 8%, #f9edcf, #e8cca3);
  border: 1px solid #d8ad78;
}
.invitation-form h3 { font-size: clamp(19px, 1.55vw, 27px); line-height: 1.3; text-wrap: balance; }
.form-note { font-size: 14px; margin-block: 3px 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 14px; font-weight: 700; }
.form-field :is(input, textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #a17b56;
  border-radius: 0;
  background: #fbf0d8;
  color-scheme: light;
  font-size: 16px;
}
.form-field textarea { resize: vertical; }
.invitation-form :focus-visible { outline-color: #472619; }
.form-field [aria-invalid] { border: 2px solid #99271c; }
.field-error { display: block; color: #8a2017; font-size: 14px; }
.field-error:empty, .form-status:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; }
.invitation-form .button--primary { color: var(--paper); background: var(--paper-ink); border-color: var(--paper-ink); }
.form-status { font-size: 14px; font-weight: 700; }
.theatre-contact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 8px 2px 2px; }
.theatre-contact address { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; font-style: normal; font-size: 14px; }
.theatre-contact a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }

@media (min-width: 801px) {
  .act--finale {
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "title form" "bow form" "contact form";
  }
  .invitation { display: contents; }
  .invitation-form {
    grid-area: form;
    align-self: center;
    min-height: 0;
    max-height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .theatre-contact { grid-area: contact; }
}
@media (max-width: 800px) {
  :root { --foot: 66px; }
  .act-nav { width: min(100%, 500px); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(3px, 1vw, 8px); }
  .act--opening { grid-template-columns: minmax(0, 1fr); grid-template-rows: max-content minmax(0, 1fr); align-items: stretch; }
  .opening-copy { padding: clamp(18px, 4.3vh, 58px) clamp(19px, 6.7vw, 54px) 0; }
  .opening-copy .act-title { font-size: clamp(41px, min(11vw, 8.3vh), 78px); }
  .opening-line { margin-top: 7px; }
  .opening-actions { margin-top: 11px; }
  .hero-space { height: auto; margin-bottom: 38px; }
  .puppet-hint { right: 14px; bottom: 14px; padding-block: 2px; }
  .screen-light { background: radial-gradient(ellipse 68% 65% at var(--lamp-x, 65%) var(--lamp-y, 67%), var(--honey) 0%, #f6cf7c 33%, var(--amber) 66%, #713921 100%); }
  .screen-finish { background: linear-gradient(180deg, #1a0b09 1%, #211009ea 16%, #30150a93 33%, #2e110a0b 52%, transparent 78%, #260e0985 100%), repeating-linear-gradient(1deg, #fff2cc17 0 1px, transparent 1px 3px); }
  .screen[data-act="1"] .screen-finish { background: linear-gradient(180deg, #1a0b09 0%, #211009f5 11%, #30150a24 28%, transparent 63%, #30150a72 70%, #211009f7 79%, #1a0b09 100%), repeating-linear-gradient(1deg, #fff2cc18 0 1px, transparent 1px 3px); }
  .act--show { grid-template: "intro" max-content "performance" minmax(0, 1fr) "details" max-content / minmax(0, 1fr); padding: 15px 0 13px; }
  .show-intro, .show-details { padding-inline: clamp(16px, 5.7vw, 54px); }
  .show-intro .act-title { font-size: clamp(40px, 8.5vw, 70px); }
  .synopsis { max-width: none; margin-top: 2px; }
  .show-details { padding-top: 6px; }
  .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 8px; }
  .facts > div { display: block; padding: 2px 0 3px; }
  .facts dt, .facts dd { line-height: 1.7; }
  .performance { grid-area: performance; position: relative; inset: auto; min-height: 0; }
  .caption { bottom: 2%; padding: 3px 8px; }
  .moon { width: min(46%, 34vh); }
  .moon-space { inset: 25% 0 25%; }

  .act--craft, .act--backstage, .act--finale {
    --act-padding-x: clamp(15px, 5.4vw, 46px);
    --act-padding-y: clamp(12px, 2.8vh, 34px);
  }
  .act--craft .act-title, .act--backstage .act-title, .act--finale .act-title {
    font-size: clamp(32px, 6vw, 58px);
  }
  .act--craft {
    grid-template: "title" auto "art" minmax(0, 1fr) "detail" auto / minmax(0, 1fr);
    align-content: stretch;
    padding: var(--act-padding-y) var(--act-padding-x) 12px;
  }
  .act--craft .act-title { margin: 0 0 6px; }
  .act--craft .title-line { display: inline; }
  .craft-tools { right: 0; min-width: 0; width: 22%; }
  .craft-details { max-height: 38vh; }
  .craft-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 4px; }
  .craft-steps button { padding: 6px; }
  .craft-note { min-height: 3.7em; padding: 6px 0 0; }
  .screen[data-act="2"] .screen-light { --lamp-x: 48%; --lamp-y: 45%; }
  .screen[data-act="2"] .screen-finish {
    background:
      linear-gradient(180deg, #190c0a 0%, #261308e8 8%, transparent 30%, transparent 53%, #26140cce 75%, #190c0a 92%),
      repeating-linear-gradient(1deg, #fff2cc17 0 1px, transparent 1px 3px);
  }

  .act--backstage {
    grid-template: "title" auto "photo" minmax(0, min(42vh, calc((100vw - var(--shell) * 2) * 0.5625))) "detail" minmax(0, auto) / minmax(0, 1fr);
    align-content: center;
  }
  .act--backstage .act-title { margin: var(--act-padding-y) var(--act-padding-x) 10px; }
  .backstage-photo { object-position: center; }
  .backstage-details { max-height: 45vh; padding: 8px var(--act-padding-x) 12px; }
  .backstage-details .facts { margin-bottom: 7px; }
  .crew-count { margin-bottom: 5px; }

  .act--finale {
    grid-template: "title" auto "bow" clamp(76px, 17vh, 210px) "form" minmax(0, 1fr) / minmax(0, 1fr);
    padding: var(--act-padding-y) var(--act-padding-x) 0;
  }
  .act--finale .act-title { margin: 0; padding: 0; }
  .invitation { align-self: stretch; max-height: none; margin-block: -4px 0; padding-bottom: 12px; }
  .screen[data-act="4"] .screen-light { --lamp-x: 48%; --lamp-y: 21%; }
  .screen[data-act="4"] .screen-finish {
    background: linear-gradient(180deg, #26120ad4, transparent 30%, #20110b 58%),
      repeating-linear-gradient(1deg, #fff2cc18 0 1px, transparent 1px 3px);
  }
}
@media (max-width: 450px) {
  .masthead { gap: 5px; }
  .brand { gap: 8px; }
  .masthead .brand { font-size: clamp(16px, 4.4vw, 21px); }
  .lamp-mark { flex-basis: 19px; width: 19px; }
  .lamp-mark::before { inset: 3px 5px 6px 5px; }
  .lamp-mark::after { top: 11px; left: 9px; width: 8px; }
  .header-actions { gap: 4px; }
  .header-ticket { min-width: 53px; padding-inline: 10px; }
  .menu-toggle { padding: 0; gap: 0; }
  .menu-label { display: none; }
  .sound-toggle { gap: 4px; }
  .sound-icon { width: 18px; }
  .button { gap: 10px; }
  .facts > div:nth-child(3) dd { max-width: 11em; }
  .program-body { grid-template-columns: minmax(0, 1fr); }
  .crew-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 355px) {
  .masthead .lamp-mark { display: none; }
  .header-ticket { min-width: 44px; padding-inline: 6px; }
}
@media (max-width: 800px) and (max-height: 740px) {
  :root { --mast: 56px; --foot: 58px; }
  .act-stop { min-height: 50px; }
  .opening-copy { padding-top: 16px; }
  .opening-line { margin-top: 4px; }
  .opening-actions { margin-top: 9px; }
  .show-intro .act-title { font-size: 42px; }
  .act--show { padding-top: 10px; padding-bottom: 8px; }
}
@media (min-width: 801px) and (max-height: 750px) {
  .act--show { padding-block: clamp(18px, 5vh, 37px); }
  .show-intro .act-title { font-size: min(8.2vw, 15vh); }
  .show-details { padding-top: 12px; }
  .facts { margin-bottom: 12px; }
  .facts > div { padding-block: 4px; }
  .act--craft, .act--backstage, .act--finale { --act-padding-y: 18px; }
  .craft-steps button { padding-block: 5px; }
  .invitation-form { padding-block: 10px; }
}
@media (max-height: 550px) {
  .act--finale .act-title, .act--backstage .act-title { font-size: clamp(26px, 5.2vw, 41px); }
}
@media (max-width: 800px) and (max-height: 550px) {
  .act--finale { grid-template-rows: auto clamp(30px, 12vh, 85px) minmax(0, 1fr); }
}
@media (max-width: 800px) and (max-height: 460px) {
  .act--finale { grid-template-rows: auto 0 minmax(0, 1fr); }
  .act--finale .act-title { margin-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
  .moon-space, .act.is-leaving, .craft-tool { transition-duration: 260ms; }
  .act.is-current { animation: read-in 260ms both !important; }
  .screen-turn, .screen[data-act="3"] .screen-turn, .screen-back, .craft-tool { transform: none; }
  .screen-face { transition: opacity 260ms; }
  .screen-back, .screen[data-act="3"] .screen-front { opacity: 0; }
  .screen[data-act="3"] .screen-back { opacity: 1; }
  .menu-curtains, .is-lit .theatre::after { display: none; }
}
