/* =========================================================
   Challenge I gate — fullscreen prevideo + burned-paper key
   ========================================================= */

.gate {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: #000;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease-out, ease);
}

.gate.is-open {
  opacity: 1;
  pointer-events: all;
}

.gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.gate.is-story-only {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(90, 70, 40, 0.22), transparent 55%),
    radial-gradient(ellipse at 30% 80%, rgba(30, 50, 70, 0.18), transparent 50%),
    linear-gradient(180deg, #0a0908 0%, #12100e 45%, #080706 100%);
}

.gate.is-story-only .gate__video {
  display: none;
}

.gate__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* Kill Chromium native media chrome (PiP / captions / translate) */
.gate__video::-webkit-media-controls,
.gate__video::-webkit-media-controls-enclosure,
.gate__video::-webkit-media-controls-panel,
.gate__video::-webkit-media-controls-overlay-enclosure,
.gate__video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
  pointer-events: none;
}

.gate.is-playing .gate__video {
  object-fit: cover;
}

.gate__veil {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4, 1rem);
  max-width: 36rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(8, 6, 12, 0.72) 0%, rgba(0, 0, 0, 0.55) 70%);
}

.gate__veil[hidden],
.gate__chrome[hidden],
.gate__modal[hidden] {
  display: none !important;
}

.gate__title {
  font-family: var(--font-display, Cinzel, serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--parchment-100, #f4ecd8);
  margin: 0;
  line-height: 1.15;
}

.gate__lede {
  color: var(--parchment-400, #c4b394);
  font-size: var(--fs-md, 1.05rem);
  line-height: 1.55;
  margin: 0;
}

.gate__chrome {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem clamp(1rem, 3vw, 2rem) 1.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  pointer-events: none;
}

.gate__pause {
  pointer-events: all;
  appearance: none;
  border: 1px solid rgba(244, 236, 216, 0.35);
  background: rgba(8, 6, 12, 0.55);
  color: rgba(244, 236, 216, 0.92);
  font-family: var(--font-type, "Special Elite", monospace);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.65rem 1.35rem;
  cursor: pointer;
}

.gate.is-paused .gate__pause {
  border-color: rgba(201, 162, 89, 0.65);
  color: #e8d5a8;
}

.gate__modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.gate__blur {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(40, 24, 12, 0.45), rgba(0, 0, 0, 0.72) 70%),
    rgba(4, 3, 6, 0.35);
  backdrop-filter: blur(14px) saturate(0.85);
  -webkit-backdrop-filter: blur(14px) saturate(0.85);
}

.burn-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 28rem);
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.4rem, 4vw, 2.2rem) 1.8rem;
  color: #2a1c12;
  text-align: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 236, 196, 0.55), transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(60, 28, 12, 0.35), transparent 40%),
    linear-gradient(145deg, #e8d2a8 0%, #c9a978 42%, #8f6a3e 100%);
  border: 1px solid rgba(42, 28, 18, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 220, 170, 0.18) inset,
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(180, 90, 30, 0.12);
  clip-path: polygon(
    1% 3%,
    4% 0%,
    97% 2%,
    100% 8%,
    98% 96%,
    92% 100%,
    6% 98%,
    0% 90%
  );
  transform: rotate(-0.6deg);
}

.burn-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(20, 10, 4, 0.55), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(20, 10, 4, 0.4), transparent 18%),
    radial-gradient(circle at 70% 88%, rgba(20, 10, 4, 0.5), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(20, 10, 4, 0.35), transparent 20%);
  mix-blend-mode: multiply;
  opacity: 0.85;
}

.burn-sheet__eyebrow,
.burn-sheet__title,
.burn-sheet__lede,
.burn-sheet__label,
.burn-sheet__note,
.burn-sheet__form,
.burn-sheet__error {
  position: relative;
  z-index: 1;
}

.burn-sheet__eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--font-type, "Special Elite", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(42, 28, 18, 0.72);
}

.burn-sheet__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display, Cinzel, serif);
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  letter-spacing: 0.04em;
  color: #1a100a;
}

.burn-sheet__lede {
  margin: 0 0 1.35rem;
  font-family: var(--font-serif, "Cormorant Garamond", serif);
  font-size: 1.08rem;
  line-height: 1.5;
  color: rgba(42, 28, 18, 0.88);
}

.burn-sheet__form {
  display: grid;
  gap: 0.55rem;
  text-align: left;
}

.burn-sheet__label {
  font-family: var(--font-type, "Special Elite", monospace);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(42, 28, 18, 0.7);
}

.burn-sheet__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(42, 28, 18, 0.4);
  background: rgba(255, 244, 220, 0.55);
  color: #1a100a;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  outline: none;
}

.burn-sheet__input:focus {
  border-color: rgba(90, 50, 18, 0.85);
  box-shadow: 0 0 0 2px rgba(160, 100, 40, 0.25);
}

.burn-sheet__error {
  min-height: 1.2em;
  margin: 0;
  font-family: var(--font-serif, "Cormorant Garamond", serif);
  font-size: 0.95rem;
  color: #7a2218;
}

.burn-sheet__submit {
  width: 100%;
  margin-top: 0.35rem;
}

.burn-sheet__note {
  margin: 1rem 0 0;
  font-family: var(--font-type, "Special Elite", monospace);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(42, 28, 18, 0.55);
}

.burn-sheet .btn--ghost {
  position: relative;
  z-index: 1;
  margin-top: 0.85rem;
  color: #2a1c12;
  border-color: rgba(42, 28, 18, 0.35);
}

/* ---------------- Room reveal (post-video blank slate) ---------------- */

.gate__reveal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: #000;
  overflow: hidden;
}

.gate__reveal[hidden] {
  display: none !important;
}

.gate.is-reveal .gate__video {
  opacity: 0;
  pointer-events: none;
}

.gate-reveal {
  position: relative;
  width: min(100%, 42rem);
  max-height: min(92vh, 52rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vw, 1.25rem);
  padding: clamp(1.4rem, 3.5vw, 2.2rem) clamp(1.25rem, 3.5vw, 2.4rem);
  text-align: left;
  color: var(--parchment-200, #e2d5b8);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(88, 60, 28, 0.22), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(30, 18, 10, 0.45), transparent 50%),
    linear-gradient(165deg, rgba(28, 20, 14, 0.96) 0%, rgba(8, 6, 10, 0.98) 100%);
  border: 1px solid rgba(217, 169, 74, 0.28);
  box-shadow:
    0 0 0 1px rgba(244, 236, 216, 0.04) inset,
    0 28px 80px rgba(0, 0, 0, 0.65),
    0 0 100px rgba(180, 90, 30, 0.08);
}

.gate-reveal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(217, 169, 74, 0.18), transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(217, 169, 74, 0.12), transparent) bottom / 100% 1px no-repeat;
  opacity: 0.9;
}

.gate-reveal__eyebrow {
  position: relative;
  margin: 0;
  font-family: var(--font-type, "Special Elite", monospace);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-400, #d9a94a);
  text-align: center;
}

.gate-reveal__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display, Cinzel, serif);
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--parchment-100, #f4ecd8);
  text-align: center;
}

.gate-reveal__scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.15rem 0.35rem 0.35rem 0;
  scrollbar-color: rgba(217, 169, 74, 0.45) rgba(0, 0, 0, 0.35);
}

.gate-reveal__scroll::-webkit-scrollbar {
  width: 8px;
}

.gate-reveal__scroll::-webkit-scrollbar-thumb {
  background: rgba(217, 169, 74, 0.4);
  border-radius: 4px;
}

.gate-reveal__prose,
.gate-reveal__lead,
.gate-reveal__closing {
  margin: 0 0 0.95rem;
  font-family: var(--font-body, "Cormorant Garamond", serif);
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  line-height: 1.7;
  color: var(--parchment-300, #c4b394);
  text-align: left;
  max-width: 62ch;
}

.gate-reveal__lead {
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
  color: var(--parchment-200, #e2d5b8);
  font-style: italic;
}

.gate-reveal__finds {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.gate-reveal__finds li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.55rem;
  align-items: start;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body, "Cormorant Garamond", serif);
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  line-height: 1.55;
  color: var(--parchment-200, #e2d5b8);
  background: rgba(4, 3, 6, 0.45);
  border: 1px solid rgba(217, 169, 74, 0.14);
  border-left: 2px solid rgba(217, 169, 74, 0.4);
}

.gate-reveal__glyph {
  display: inline-block;
  line-height: 1.45;
  text-align: center;
  font-size: 1rem;
}

.gate-reveal__closing {
  margin-bottom: 0.25rem;
  color: var(--spectre-400, #7fd4c1);
  font-style: italic;
  text-shadow: 0 0 18px rgba(127, 212, 193, 0.22);
}

.gate-reveal__actions {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(217, 169, 74, 0.16);
}

.gate-reveal__actions .btn {
  width: min(100%, 22rem);
}

.gate:fullscreen,
.gate:-webkit-full-screen {
  background: #000;
}

@media (max-width: 520px) {
  .gate-reveal {
    max-height: 94vh;
    padding: 1.15rem 1rem 1.25rem;
  }

  .gate-reveal__finds li {
    grid-template-columns: 1.35rem 1fr;
    gap: 0.4rem;
    padding: 0.5rem 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate {
    transition: none;
  }
}
