.website-theatre {
  --theatre-ink: var(--machine-ink);
  --theatre-ivory: #f1efe7;
  --theatre-muted: #b9bec4;
  --theatre-rule: #444c55;
  --theatre-light: 231 164 112;
  --theatre-pad: clamp(1rem, 4.2vw, 4.5rem);
  position: relative;
  isolation: isolate;
  padding: clamp(3rem, 6.5vw, 7.25rem) 0 clamp(3.25rem, 6.8vw, 7.5rem);
  overflow: clip;
  background: var(--theatre-ink);
  color: var(--theatre-ivory);
  font-family: Manrope, Arial, sans-serif;
}

.website-theatre--standalone { padding-top: clamp(2rem, 5vw, 5rem); }
.website-theatre[data-theatre-selection="royalfly"] { --theatre-light: 118 212 225; }
.website-theatre[data-theatre-selection="rainmaker"] { --theatre-light: 171 205 132; }

.theatre-wrap {
  max-width: 1440px;
  width: calc(100% - 2 * var(--theatre-pad));
  margin-inline: auto;
}

.theatre-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.25rem;
  margin-bottom: clamp(1.25rem, 2.15vw, 2.5rem);
}

.website-theatre .theatre-kicker,
.website-theatre .theatre-project-type,
.website-theatre figcaption {
  color: var(--theatre-muted);
  font: 500 .75rem/1.5 var(--tech, ui-monospace, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.website-theatre .theatre-kicker { margin: 0 0 .55rem; }

.website-theatre #website-work-title {
  margin: 0;
  color: var(--theatre-ivory);
  font: 650 clamp(2.85rem, 6.3vw, 5.85rem)/.99 Manrope, Arial, sans-serif;
  letter-spacing: -.085em;
}

.website-theatre--standalone #website-work-title { font-size: clamp(3.1rem, 7.3vw, 6.7rem); }

.website-theatre a { color: var(--theatre-ivory); }
.website-theatre button { font: inherit; }

.website-theatre :focus-visible {
  outline: 2px solid rgb(var(--theatre-light));
  outline-offset: 3px;
}

.website-theatre .theatre-index {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  flex: 0 0 auto;
  color: var(--theatre-muted);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .24em;
}

.website-theatre .theatre-index:hover { color: var(--theatre-ivory); }

.theatre-deck {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  border-block: 1px solid var(--theatre-rule);
  min-height: 54px;
}

.theatre-selector {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem clamp(.8rem, 2.3vw, 2.7rem);
  min-width: 0;
}

.website-theatre .theatre-selector a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--theatre-muted);
  font-size: .92rem;
  font-weight: 720;
  text-decoration: none;
  transition: color 180ms ease;
}

.theatre-selector a::after {
  content: "";
  position: absolute;
  inset: auto 0 -3px;
  height: 2px;
  background: rgb(var(--theatre-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.website-theatre .theatre-selector a:hover,
.website-theatre .theatre-selector a[aria-current="true"] { color: var(--theatre-ivory); }
.theatre-selector a[aria-current="true"]::after { transform: scaleX(1); }
.theatre-stepper { display: flex; gap: .2rem; }
.theatre-stepper[hidden] { display: none; }

.website-theatre .theatre-stepper button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--theatre-ivory);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.website-theatre .theatre-stepper button:hover {
  border-color: var(--theatre-rule);
  background: #262e37;
}

.theatre-stage {
  position: relative;
  z-index: 0;
  display: grid;
  gap: 1rem;
  margin-top: .55rem;
  perspective: 1200px;
  isolation: isolate;
}

.theatre-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--theatre-pad));
  background:
    linear-gradient(166deg, transparent 57%, #b6bbc72b 57.08%, #0000 58%),
    linear-gradient(0deg, #2e343c, var(--theatre-ink) 77%);
  mask-image: linear-gradient(0deg, transparent, #000 12% 84%, transparent);
}

.theatre-lights {
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--theatre-pad));
  pointer-events: none;
  mask-image: linear-gradient(#000, transparent 83%);
}

.theatre-lights span {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    conic-gradient(from -11deg at 54% 0, transparent 298deg, rgb(var(--beam) / .17) 331deg, transparent 352deg),
    radial-gradient(ellipse at 29% 70%, rgb(var(--beam) / .33), transparent 54%);
  transition: opacity 820ms cubic-bezier(.24,.75,.22,1);
}

.theatre-lights [data-theatre-light="glowfoggs"] { --beam: 234 162 111; }
.theatre-lights [data-theatre-light="royalfly"] { --beam: 107 204 227; }
.theatre-lights [data-theatre-light="rainmaker"] { --beam: 164 203 117; }
.website-theatre:not([data-theatre-selection]) .theatre-lights [data-theatre-light="glowfoggs"],
.website-theatre[data-theatre-selection="glowfoggs"] .theatre-lights [data-theatre-light="glowfoggs"],
.website-theatre[data-theatre-selection="royalfly"] .theatre-lights [data-theatre-light="royalfly"],
.website-theatre[data-theatre-selection="rainmaker"] .theatre-lights [data-theatre-light="rainmaker"] { opacity: 1; }

.theatre-panel {
  min-width: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(245px, 3fr);
  align-items: center;
  gap: clamp(1.65rem, 6vw, 7rem);
  padding: clamp(1rem, 3.5vw, 3.4rem) 0 clamp(1rem, 2.75vw, 2.5rem);
  scroll-margin-top: 6rem;
}

.theatre-panel[hidden] { display: none; }

.website-theatre[data-theatre-ready] .theatre-panel { grid-area: 1 / 1; }
.theatre-panel[data-theatre-leaving] { pointer-events: none; }
.theatre-panel[data-theatre-leaving] :is(.theatre-detail, figcaption) { visibility: hidden; }

.theatre-capture {
  min-width: 0;
  margin: 0;
  position: relative;
  padding: 4% clamp(.15rem, 2.2vw, 2.125rem) 0 .25rem;
  perspective: 1250px;
}

.theatre-capture::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 4%;
  bottom: 6%;
  height: 16%;
  border-radius: 50%;
  transform: skewX(-29deg) translateX(5%);
  background: radial-gradient(ellipse, rgb(var(--theatre-light) / .28), #13191f44 38%, transparent 73%);
  box-shadow: 0 18px 28px #05070b75;
}

.theatre-screen {
  --theatre-angle: rotateX(5deg) rotateY(-12deg) rotateZ(-1.9deg);
  position: relative;
  display: grid;
  aspect-ratio: 1440 / 880;
  padding: clamp(3px, .52vw, 8px);
  border: 1px solid #bab7bc;
  border-radius: 5px;
  background: linear-gradient(143deg, #c4c6c9 0, #525962 28%, #252932 48%, #11151c 73%, #777c83);
  box-shadow: -2px 3px 0 #343c49, -5px 5px 0 #1d232c, 0 34px 58px -24px #04050bd9;
  transform: var(--theatre-angle);
  transform-origin: 54% 84%;
  backface-visibility: hidden;
  will-change: auto;
}

.theatre-screen::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(116deg, rgb(var(--theatre-light) / .11), transparent 26%, transparent 84%, #e6edf30f);
}

.theatre-film {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  border-radius: 2px;
  overflow: hidden;
}

.website-theatre .theatre-film img {
  display: block;
  width: 101.2%;
  height: auto;
  max-width: none;
  min-width: 0;
  border: 0;
  border-radius: 2px;
  object-fit: cover;
  object-position: left center;
  aspect-ratio: 1440 / 880;
}

.website-theatre .theatre-capture figcaption {
  position: relative;
  margin-top: clamp(.65rem, 2vw, 1.5rem);
  margin-left: 1%;
  letter-spacing: .035em;
  text-transform: none;
}

.theatre-detail { align-self: center; min-width: 0; }
.website-theatre .theatre-project-type { margin: 0 0 .6rem; color: rgb(var(--theatre-light)); letter-spacing: .04em; }
.website-theatre .theatre-project-type span { color: var(--theatre-muted); margin-inline: .1rem; }

.website-theatre .theatre-detail :is(h2, h3) {
  margin: 0;
  color: var(--theatre-ivory);
  font: 650 clamp(1.9rem, 3.8vw, 4.15rem)/1.05 Manrope, Arial, sans-serif;
  letter-spacing: -.071em;
  overflow-wrap: anywhere;
}

.website-theatre .theatre-scope {
  margin: clamp(.65rem, 1.35vw, 1.15rem) 0 0;
  color: var(--theatre-ivory);
  font-weight: 750;
  font-size: 1rem;
}

.website-theatre .theatre-description {
  margin: .45rem 0 0;
  color: var(--theatre-muted);
  font-size: clamp(1rem, 1.24vw, 1.125rem);
  line-height: 1.6;
}

.theatre-actions {
  display: grid;
  justify-items: start;
  gap: .15rem;
  margin-top: clamp(.65rem, 1.6vw, 1.5rem);
}

.website-theatre .theatre-actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  color: var(--theatre-ivory);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .24em;
  transition: color 180ms ease;
}

.website-theatre .theatre-actions a:hover { color: rgb(var(--theatre-light)); }
.website-theatre .theatre-actions .theatre-external { color: var(--theatre-muted); }
.website-theatre .theatre-actions .theatre-external:hover { color: var(--theatre-ivory); }
.theatre-actions svg, .theatre-index svg { flex-shrink: 0; }

.theatre-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

@media (max-width: 880px) {
  .theatre-panel {
    grid-template-columns: minmax(0, 5fr) minmax(200px, 3fr);
    gap: clamp(1rem, 3.4vw, 1.8rem);
  }
}

@media (max-width: 680px) {
  .website-theatre { --theatre-pad: clamp(1rem, 5vw, 1.45rem); }
  .theatre-intro { flex-wrap: wrap; gap: .35rem 1.1rem; }
  .website-theatre #website-work-title { font-size: clamp(2.45rem, 10.5vw, 4rem); }
  .website-theatre .theatre-index { min-height: 44px; }
  .theatre-panel { grid-template-columns: minmax(0, 1fr); padding-top: 0; gap: 1.15rem; align-content: start; }
  .theatre-capture { padding: 7% 3% 0 1%; }
  .theatre-screen { --theatre-angle: rotateX(3deg) rotateY(-6deg) rotateZ(-1deg); }
  .theatre-stage::before {
    background: linear-gradient(159deg, transparent 33%, #b6bbc726 33.1%, transparent 34%);
  }
  .theatre-lights { mask-image: linear-gradient(#000, transparent 58%); }
  .theatre-deck { gap: .25rem; }
  .theatre-selector { gap: 0 .6rem; }
  .website-theatre .theatre-selector a { font-size: .82rem; }
  .theatre-selector a::after { bottom: 0; }
  .website-theatre .theatre-stepper button { padding: 0; }
  .theatre-stepper { gap: 0; }
  .theatre-actions { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
}

@media (max-width: 350px) {
  .theatre-deck { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .theatre-selector { gap: 0 .5rem; }
  .website-theatre .theatre-selector a { font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .website-theatre *,
  .website-theatre *::before,
  .website-theatre *::after { transition: none !important; animation: none !important; }
  .theatre-screen { transform: none; }
}
