/* theatre.css — The Papermoon Theatre, Whitby.
   Midnight #1d2a44 · warm paper #f3e9d2 · coral #e2725b · moon gold #e8c56a.
   Two faces: Baloo 2 (display) + Nunito (body), vendored woff2. */

@font-face {
  font-family: 'Baloo 2';
  src: url('../fonts/baloo-2-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../fonts/nunito-latin-wght-italic.woff2') format('woff2-variations');
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

:root {
  --mid: #1d2a44;
  --mid-deep: #16203a;
  --mid-soft: #2a3a5e;
  --paper: #f3e9d2;
  --paper-dim: #e6d9bd;
  --coral: #e2725b;
  --coral-ink: #b04832;   /* coral, shaded for small text on paper */
  --coral-deep: #b14a36;
  --gold: #e8c56a;
  --gold-deep: #b98f3a;
  --ink: #24314e;         /* body ink on paper */
  --display: 'Baloo 2', 'Comic Sans MS', system-ui, sans-serif;
  --body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --out: cubic-bezier(.22, .9, .32, 1);
  --inout: cubic-bezier(.65, .02, .28, 1);
  --settle: cubic-bezier(.3, 1.35, .44, 1);
  /* faint paper-fibre tile, procedural (feTurbulence) */
  --grain-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.33 0 0 0 0 0.17 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
  --grain-night: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 0.86 0 0 0 0 0.80 0 0 0 0 0.62 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mid);
  color: var(--paper);
  font-family: var(--body);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); text-wrap: balance; line-height: 1.12; margin: 0 0 .6em; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--mid-deep); }

:focus-visible {
  outline: 3px dashed var(--gold);   /* cut along the dotted line */
  outline-offset: 4px;
  border-radius: 4px;
}
.paperbit :focus-visible { outline-color: var(--coral-ink); }

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 99;
  background: var(--gold); color: var(--mid-deep);
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  padding: .55rem 1rem; border-radius: .6rem;
  transition: top .25s var(--out);
}
.skip:focus-visible { top: 1rem; }

/* ————— masthead, floating over the stage ————— */
.masthead {
  position: absolute; z-index: 30; inset: 0 0 auto 0;
  display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem;
  padding: 1.1rem clamp(1.1rem, 3.5vw, 2.4rem) 0;
  pointer-events: none;
}
.masthead a, .masthead p { pointer-events: auto; }
.masthead .est {
  margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold);
  position: absolute; left: clamp(1.1rem, 3.5vw, 2.4rem); top: 8.6vh;  /* below the valance */
}
.masthead nav { display: flex; gap: clamp(.9rem, 2.4vw, 1.8rem); flex-wrap: wrap; justify-content: flex-end; }
.masthead nav a {
  font-family: var(--display); font-weight: 600; font-size: .98rem;
  color: var(--paper); text-decoration: none; position: relative;
}
.masthead nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2.5px;
  background: var(--coral); border-radius: 2px;
  transition: right .3s var(--out);
}
.masthead nav a:hover::after { right: 0; }

/* ————— the stage ————— */
.show { height: 560vh; position: relative; }
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: var(--mid-deep);
  cursor: none;                       /* the torch is the cursor here */
}
.scene, .dim, .torch, .acts, .rig { position: absolute; inset: 0; }
.scene { z-index: 1; }
.flat { position: absolute; inset: 0; will-change: transform; }
.flat svg { width: 100%; height: 100%; display: block; overflow: visible; }

.dim {
  z-index: 2; pointer-events: none;
  background: #070d1d;
  opacity: 0;
  -webkit-mask-image: radial-gradient(circle 300px at var(--tx, 50%) var(--ty, 45%),
      rgba(0,0,0,.14) 0, rgba(0,0,0,.62) 46%, #000 100%);
  mask-image: radial-gradient(circle 300px at var(--tx, 50%) var(--ty, 45%),
      rgba(0,0,0,.14) 0, rgba(0,0,0,.62) 46%, #000 100%);
}
.torch {
  z-index: 3; pointer-events: none;
  background: radial-gradient(circle 250px at var(--tx, 50%) var(--ty, 45%),
      rgba(232, 197, 106, .17), rgba(232, 197, 106, .055) 46%, transparent 72%);
  mix-blend-mode: screen;
}

/* acts — supertitles at the side of the stage */
.acts { z-index: 4; pointer-events: none; }
.act {
  position: absolute; top: 16vh; width: min(36ch, 40vw);
  opacity: 0; will-change: transform, opacity;
}
.act.slot-r { right: clamp(1.4rem, 6vw, 6rem); }
.act.slot-l { left: clamp(1.4rem, 6vw, 6rem); }
.act .kick {
  font-size: 1.05rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .5em;
}
.act .kick .star { color: var(--coral); margin-right: .5em; }
.act p {
  font-size: clamp(1.02rem, 1.5vw, 1.24rem); font-weight: 600; line-height: 1.62;
  color: var(--paper);
  text-shadow: 0 2px 22px rgba(6, 11, 24, .95), 0 0 6px rgba(6, 11, 24, .65);
}

/* rig — the proscenium valance, above everything */
.rig { z-index: 5; pointer-events: none; }

/* playbill — the title card */
.playbill {
  position: absolute; z-index: 6; inset: 0;
  display: grid; place-content: center; text-align: center;
  padding: 0 1.4rem; pointer-events: none;
  will-change: transform, opacity;
}
.playbill::before {
  content: ''; position: absolute; inset: -10%;
  background: radial-gradient(ellipse 60% 52% at 50% 46%, rgba(13, 20, 38, .78), rgba(13, 20, 38, .3) 58%, transparent 76%);
  z-index: -1;
}
.playbill .presents {
  font-size: .85rem; font-weight: 800; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.1rem;
}
.playbill h1 {
  font-size: clamp(2.7rem, 7.4vw, 5.6rem); font-weight: 700; letter-spacing: -.015em;
  line-height: 1.02; color: var(--paper); margin: 0 0 1rem;
  text-shadow: 0 4px 30px rgba(6, 11, 24, .8);
}
.nowrap { white-space: nowrap; }
.playbill .bill-sub {
  max-width: 46ch; margin: 0 auto 2.2rem;
  font-size: clamp(1rem, 1.5vw, 1.18rem); font-weight: 500; color: var(--paper-dim);
}
.playbill .cue {
  font-size: .82rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--coral); margin: 0;
  animation: cue 2.6s var(--inout) infinite;
}
.cue-arrow { display: inline-block; margin-left: .6em; }
@keyframes cue { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

.endcard {
  position: absolute; z-index: 6; inset: 0;
  display: grid; place-content: center; text-align: center;
  padding: 0 1.4rem; pointer-events: none; opacity: 0;
  will-change: transform, opacity;
}
.endcard .fin {
  font-family: var(--display); font-size: clamp(3rem, 7vw, 5rem); font-weight: 800;
  color: var(--gold); margin: 0 0 .4rem;
  text-shadow: 0 4px 26px rgba(6, 11, 24, .8);
}
.endcard .fin-sub {
  max-width: 40ch; margin: 0 auto; font-size: 1.05rem; color: var(--paper-dim);
  text-shadow: 0 2px 16px rgba(6, 11, 24, .9);
}

/* ————— below the stage: front of house ————— */
.paperbit, .nightbit { position: relative; padding: clamp(3.6rem, 8vh, 5.6rem) 0; }
.paperbit {
  background: var(--paper) var(--grain-paper);
  color: var(--ink);
}
.nightbit {
  background: var(--mid) var(--grain-night);
  color: var(--paper);
}
.tear { position: absolute; left: 0; right: 0; top: -26px; height: 30px; width: 100%; pointer-events: none; display: block; }

.wrap { max-width: 1140px; margin-inline: auto; padding-inline: clamp(1.2rem, 5vw, 3rem); }

.paperbit h2, .nightbit h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 700; letter-spacing: -.01em;
  color: var(--mid); margin-bottom: .4em;
}
.nightbit h2 { color: var(--gold); }
.paperbit h2::after, .nightbit h2::after {
  content: ''; display: block; width: 92px; margin-top: .35em;
  border-top: 3px dashed var(--coral);
}
.paperbit p { font-weight: 550; }
.paperbit a { color: var(--coral-ink); text-decoration: underline wavy 1.5px; text-underline-offset: 3px; }
.nightbit a { color: var(--gold); text-decoration: underline wavy 1.5px; text-underline-offset: 3px; }

.two-col { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.prose { max-width: 58ch; }

.cutfig { margin: 0; }
.cutfig .cut svg { width: 100%; height: auto; display: block; }
.cutfig figcaption {
  font-size: .9rem; font-style: italic; font-weight: 550; color: #5a5237;
  margin-top: .8rem; text-align: center;
}
.nightbit .cutfig figcaption { color: var(--paper-dim); }

/* ————— tickets ————— */
.tickets { display: grid; gap: 1.4rem; margin: 2.6rem 0 1.6rem; }
.ticket {
  position: relative; z-index: 0;
  display: grid; grid-template-columns: 132px 1fr 160px; gap: 1.4rem; align-items: center;
  padding: 1.35rem 0 1.35rem 1.35rem;
  transition: transform .45s var(--settle);
}
.ticket.t1 { transform: rotate(-.8deg); }
.ticket.t2 { transform: rotate(.65deg); }
.ticket.t3 { transform: rotate(-.45deg); }
.ticket:hover { transform: rotate(0deg) translateY(-3px); }
.paper-bg {
  position: absolute; inset: 0; z-index: -1;
  background: #faf3e1;
  filter: url(#wobble);
  box-shadow: 0 10px 22px rgba(29, 42, 68, .18), 0 2px 5px rgba(29, 42, 68, .12);
}
.ticket.night { color: var(--paper); }
.ticket.night .paper-bg { background: var(--mid); }
.ticket h3 { font-size: 1.42rem; font-weight: 700; color: var(--mid); margin-bottom: .15em; }
.ticket.night h3 { color: var(--gold); }
.ticket .pitch { font-weight: 600; margin-bottom: .3em; }
.ticket .when { font-size: .88rem; font-weight: 650; color: #6a5f41; margin: 0; font-variant-numeric: tabular-nums; }
.ticket.night .when { color: var(--paper-dim); }
.tick-art svg { width: 100%; height: auto; display: block; }
.stub {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: .5rem;
  border-left: 2.5px dashed rgba(29, 42, 68, .4);
  padding: .8rem 1.1rem .8rem 1.3rem; position: relative; text-align: center;
}
.ticket.night .stub { border-left-color: rgba(243, 233, 210, .4); }
.stub::before {  /* the punch hole */
  content: ''; position: absolute; left: -9px; top: 50%; width: 15px; height: 15px;
  border-radius: 50%; background: var(--paper); transform: translateY(-50%);
  box-shadow: inset 0 1px 2px rgba(29, 42, 68, .3);
}
.stub span { font-size: .62rem; font-weight: 800; letter-spacing: .18em; color: #6a5f41; }
.ticket.night .stub span { color: var(--paper-dim); }
.stub b { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: var(--coral-ink); font-variant-numeric: tabular-nums; }
.ticket.night .stub b { color: var(--coral); }
.prices { font-size: .98rem; font-weight: 650; color: #5a5237; max-width: 62ch; }

/* ————— the troupe: puppets on their pegs ————— */
.people {
  list-style: none; margin: 3.4rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.2rem, 3vw, 2.4rem);
}
.people li { text-align: center; position: relative; }
.people li:nth-child(odd) { transform: translateY(10px) rotate(-.5deg); }
.people li:nth-child(even) { transform: translateY(-4px) rotate(.5deg); }
.people .chip { position: relative; margin: 0 auto 1rem; width: min(150px, 70%); }
.people .chip::before {  /* the string it hangs from */
  content: ''; position: absolute; left: 50%; top: -34px; width: 2px; height: 34px;
  background: var(--gold-deep); transform: translateX(-1px);
}
.people .chip::after {   /* the peg */
  content: ''; position: absolute; left: 50%; top: -40px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--coral-ink); transform: translateX(-5px);
}
.people .chip svg { width: 100%; height: auto; display: block; transform-origin: 50% -34px; transition: transform .6s var(--settle); }
.people li:hover .chip svg { transform: rotate(2.4deg); }
.people h3 { font-size: 1.3rem; font-weight: 700; color: var(--mid); margin: 0; }
.people .role { font-size: .85rem; font-weight: 700; letter-spacing: .06em; color: var(--coral-ink); margin: .1em 0 .5em; }
.people p:not(.role) { font-size: .95rem; font-weight: 550; margin: 0; }

/* ————— visit table ————— */
.times { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.times caption {
  text-align: left; font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  color: var(--coral-ink); padding-bottom: .6rem;
}
.times th {
  font-family: var(--display); font-weight: 600; text-align: left; font-size: .95rem;
  color: var(--mid); border-bottom: 2.5px solid var(--mid); padding: .45rem .6rem .45rem 0;
}
.times td {
  padding: .6rem .6rem .6rem 0; font-size: .95rem; font-weight: 600;
  border-bottom: 1.5px dashed rgba(29, 42, 68, .3); vertical-align: top;
}
.times td:nth-child(2), .times td:nth-child(3) { white-space: nowrap; }

/* ————— footer ————— */
.tail { background: var(--mid-deep) var(--grain-night); position: relative; padding: 3.6rem 0 3rem; }
.tail-grid { display: grid; grid-template-columns: 130px 1fr; gap: 2.2rem; align-items: center; max-width: 820px; margin-inline: auto; }
.tail .cut svg { width: 100%; height: auto; display: block; }
.tail-name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--gold); margin-bottom: .3em; }
.tail p { color: var(--paper-dim); font-size: .95rem; max-width: 60ch; }
.tail .credit a { color: var(--gold); text-decoration: underline wavy 1.5px; text-underline-offset: 3px; }
.tail .home { margin: 1.2rem 0 0; }
.tail .home a {
  font-family: var(--display); font-weight: 700; font-size: .95rem; color: var(--paper);
  text-decoration: none; border: 2px dashed var(--gold-deep); border-radius: .6rem; padding: .3rem .8rem;
}
.tail .home a:hover { color: var(--gold); border-color: var(--gold); }

/* ————— responsive ————— */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .cutfig { max-width: 340px; margin-inline: auto; }
  .people { grid-template-columns: repeat(2, 1fr); }
  .ticket { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; padding: 1.1rem; }
  .tick-art { grid-row: 1; }
  .stub {
    grid-column: 1 / -1; border-left: 0; border-top: 2.5px dashed rgba(29, 42, 68, .4);
    flex-direction: row; justify-content: space-between; align-items: center; padding: .7rem .2rem 0;
  }
  .ticket.night .stub { border-top-color: rgba(243, 233, 210, .4); }
  .stub::before { display: none; }
}
@media (max-width: 720px) {
  .act { top: 11vh; width: min(38ch, 86vw); }
  .act.slot-r, .act.slot-l { left: 6vw; right: 6vw; }
  .act p { font-size: 1.02rem; line-height: 1.55; }
  .masthead { padding-top: .9rem; }
  .masthead .est { display: none; }
  .masthead nav { width: 100%; justify-content: center; gap: 1.1rem; }
  .masthead nav a { font-size: .9rem; }
  .playbill h1 .nowrap { white-space: normal; }
  .tail-grid { grid-template-columns: 90px 1fr; gap: 1.4rem; }
}
@media (max-width: 460px) {
  .people { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .people h3 { font-size: 1.1rem; }
}

/* ————— stage loops: twinkle, dizzy stars, dangling rig stars ————— */
@keyframes tw { from { opacity: .28; } to { opacity: 1; } }
.tw { animation: tw 3.2s var(--inout) infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 7s linear infinite; }
@keyframes dangle { 0%, 100% { transform: rotate(-3.2deg); } 50% { transform: rotate(3.2deg); } }
.dangle { animation: dangle 5.4s var(--inout) infinite; }
.dangle2 { animation: dangle 4.5s var(--inout) -1.3s infinite; }

/* ————— reduced motion: the stage settles, nothing is lost ————— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .playbill .cue { animation: none; opacity: .9; }
  .people li:hover .chip svg { transform: none; }
  .ticket, .people .chip svg, .skip { transition: none; }
  .tw { animation: none !important; }
  .spin { animation: none !important; }
}
