/* The stage frame (Rajeev, 2026-10-23); see stage.js. Active when stage.js
   has set html.staged. --open-l/r/t/b are the opening's insets on screen. */

html.staged { --open-l: 24%; --open-r: 24%; --open-t: 20vh; --open-b: 9vh; }
html.staged, html.staged body { background: #0D0806; }

/* The stage, twice: behind the page, and in front of it with the middle cut
   out, so the page passes under the valance and behind the footlights. */
.stage-frame {
  position: fixed;
  inset: 0;
  background: #120A05 url('stage-end-land.jpg') center / cover no-repeat;
  pointer-events: none;
}
@media (orientation: portrait) {
  .stage-frame { background-image: url('stage-end-port.jpg'); }
}
.stage-frame-back { z-index: 0; }
.stage-frame-front {
  z-index: 20;
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0, #000 calc(var(--open-t) - 28px), transparent var(--open-t),
    transparent calc(100% - var(--open-b)), #000 calc(100% - var(--open-b) + 18px), #000 100%);
  mask-image: linear-gradient(to bottom,
    #000 0, #000 calc(var(--open-t) - 28px), transparent var(--open-t),
    transparent calc(100% - var(--open-b)), #000 calc(100% - var(--open-b) + 18px), #000 100%);
}

/* The bar: logo and tagline fixed at top centre, on the valance; menu at the
   right. No CSS filter on the logo: a filtered layer is drawn as a bitmap and
   its edges went soft (Rajeev: rough edges). A soft shade sits behind it instead. */
.stage-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.stage-logo { pointer-events: auto; display: block; position: relative; }
.stage-logo::before {
  content: "";
  position: absolute;
  inset: -18px -40px;
  background: radial-gradient(ellipse closest-side, rgba(18, 10, 5, 0.6), rgba(18, 10, 5, 0));
  z-index: -1;
}
.stage-logo img { width: clamp(210px, 22vw, 300px); height: auto; display: block; }
.stage-burger {
  pointer-events: auto;
  position: absolute;
  right: 16px;
  top: 10px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(217, 178, 106, 0.7);
  border-radius: 2px;
  background: rgba(18, 10, 5, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.stage-burger span { display: block; width: 20px; height: 2px; background: #EBE8DC; transition: transform 0.2s ease, opacity 0.2s ease; }
html.stage-menu-open .stage-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
html.stage-menu-open .stage-burger span:nth-child(2) { opacity: 0; }
html.stage-menu-open .stage-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.stage-menu {
  position: fixed;
  z-index: 29;
  top: 60px;
  right: 16px;
  min-width: 220px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: rgba(18, 10, 5, 0.94);
  border: 1px solid rgba(217, 178, 106, 0.5);
  border-radius: 2px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.stage-menu[hidden] { display: none; }
.stage-menu a {
  color: #EBE8DC;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-radius: 2px;
}
.stage-menu a:hover, .stage-menu a:focus-visible { background: rgba(217, 178, 106, 0.15); }
.stage-menu a.btn-primary { margin-top: 6px; text-align: center; background: #8E1B22; }

/* Floating buttons, right edge, above the footlights. */
.stage-fab {
  position: fixed;
  z-index: 31;
  right: 16px;
  bottom: calc(var(--open-b) + 14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-fab-btn {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(217, 178, 106, 0.8);
  border-radius: 50%;
  background: rgba(18, 10, 5, 0.78);
  color: #EBE8DC;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.stage-fab-btn[hidden] { display: none; }
.stage-fab-btn:hover, .stage-fab-btn:focus-visible { background: #8E1B22; border-color: #D9B26A; }

/* The page itself: inside the opening. The old headers give way to the bar. */
html.staged .site-nav,
html.staged .page-header { display: none; }
html.staged body > header,
html.staged body > main,
html.staged body > footer {
  position: relative;
  z-index: 1;
  margin-left: var(--open-l);
  margin-right: var(--open-r);
}
html.staged body { padding-top: var(--open-t); padding-bottom: var(--open-b); }

/* Home: the hero is the stage already; its own background goes. */
html.staged .stage-hero { background: none; min-height: calc(100vh - var(--open-t) - var(--open-b)); }
html.staged .hero-split { padding: 24px 16px; }
html.staged .hero-rail-wrap { padding: 0 8px 24px; }

/* Reading on the stage (Rajeev, 23 Oct: no dark panel behind the text, as on
   the poster; the stage behind the curtains is dark enough). Text sits
   directly on the stage, with only a tight shadow to hold its edges. */
html.staged main {
  max-width: none;
  padding: 40px clamp(18px, 4vw, 48px) 56px;
  background: none;
  color: #EBE8DC;
  text-shadow: 0 1px 3px rgba(18, 10, 5, 0.6);
}
html.staged .stage-hero::after { display: none; }
html.staged .hero-panel .tagline,
html.staged .hero-panel p,
html.staged .hero-panel .hero-headline,
html.staged .hero-panel p.pillars,
html.staged .hero-panel p.audience,
html.staged .hero-panel p.hero-meet,
html.staged .hero-panel p.hero-hook,
html.staged .hero-panel p.hero-built { text-shadow: 0 1px 3px rgba(18, 10, 5, 0.6); }
html.staged main + main, html.staged .stage-hero + * { margin-top: 0; }
html.staged main a { color: #E9C987; }
html.staged .eyebrow,
html.staged .direct-score-kicker,
html.staged .name-note-label,
html.staged .category-card .status,
html.staged .showcase-entry .meta { color: #D9B26A; }
html.staged main table th, html.staged main table td { border-color: rgba(198, 195, 178, 0.35); }
html.staged thead th { background: rgba(235, 232, 220, 0.08); }
html.staged table.matrix td.yes { color: #E9C987; }
html.staged .direct-score { background: rgba(168, 123, 46, 0.16); }
/* Cards stay paper, with ink text, so they read as programmes on the stage. */
html.staged .card,
html.staged .door,
html.staged .category-card,
html.staged .showcase-entry { color: var(--ink); text-shadow: none; }
html.staged .card a, html.staged .door a, html.staged .category-card a, html.staged .showcase-entry a { color: var(--umber); }
html.staged .site-footer {
  background: none;
  color: rgba(235, 232, 220, 0.8);
  border-top: 1px solid rgba(217, 178, 106, 0.35);
}

/* A phone on its side: little height, so the valance and footlights keep only a slim band. */
@media (orientation: landscape) and (max-height: 500px) {
  html.staged body { padding-top: 76px; padding-bottom: 12px; }
  .stage-frame-front {
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 58px, transparent 76px, transparent calc(100% - 12px), #000 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 58px, transparent 76px, transparent calc(100% - 12px), #000 100%);
  }
  .stage-bar { height: 76px; }
  .stage-logo img { width: 190px; }
}

/* The outline button over the lit stage floor needs its own backing. */
html.staged .btn-secondary { background: rgba(18, 10, 5, 0.6); border-color: rgba(235, 232, 220, 0.7); }
