:root {
  --paper: var(--white);
  --paper-2: #f2efe9;
  --ink: var(--black);
  --ink-soft: #404040;
  --ink-faint: var(--primary);
  --rule: rgba(139, 90, 43, 0.35);
  --serif: var(--font-serif);
  --body: var(--font-sans);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

#wotc-fullscreen-container {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

#wotc-fullscreen-container * {
  box-sizing: border-box;
}

#wotc-close-btn {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  z-index: 100;
  background: rgba(253, 251, 247, 0.9);
  border: 1px solid var(--secondary);
  color: var(--primary-dark);
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#wotc-close-btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: scale(1.1);
  border-color: var(--primary-dark);
}

/* ---------- aged paper ground ---------- */
#wotc-fullscreen-container .paper,
#wotc-fullscreen-container .vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#wotc-fullscreen-container .paper {
  background:
    radial-gradient(120% 90% at 18% 12%, #ffffff 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(90% 80% at 82% 78%, #f8f6f0 0%, rgba(248, 246, 240, 0) 60%),
    linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 55%, #eae4d3 100%);
}

#wotc-fullscreen-container .paper::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='300' height='300' filter='url(%23n)' opacity='0.35'/></svg>");
}

#wotc-fullscreen-container .vignette {
  background: radial-gradient(115% 95% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(100, 70, 30, 0.12) 100%);
  z-index: 6;
}

/* ---------- stage ---------- */
#wotc-fullscreen-container .stage {
  position: relative;
  z-index: 2;
  height: 100%;
  cursor: pointer;
}

#wotc-fullscreen-container .scene {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: clamp(1rem, 3vw, 4rem);
  padding: clamp(2rem, 4vw, 4rem) clamp(1.5rem, 5vw, 6rem) 5rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

#wotc-fullscreen-container .scene.flip {
  grid-template-columns: 1fr 1fr;
}

#wotc-fullscreen-container .scene.flip .plate {
  order: 2;
}

#wotc-fullscreen-container .scene.flip .copy {
  order: 1;
}

/* enter / exit motion — slow drift out of and back into the haze */
@keyframes sceneIn {
  from {
    opacity: 0;
    transform: scale(1.06) translateY(14px);
    filter: blur(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes sceneOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: scale(1.1) translateY(-22px);
    filter: blur(14px);
  }
}

@keyframes drift {
  from {
    transform: scale(1) translateY(0);
  }

  to {
    transform: scale(1.045) translateY(-10px);
  }
}

#wotc-fullscreen-container .scene.enter {
  animation: sceneIn 1.5s var(--ease) both;
}

#wotc-fullscreen-container .scene.leave {
  animation: sceneOut 1.15s var(--ease) both;
}

#wotc-fullscreen-container .scene .inner-drift {
  animation: drift 22s linear both;
}

/* ---------- engraving plate ---------- */
#wotc-fullscreen-container .plate {
  position: sticky;
  top: clamp(2rem, 4vw, 4rem);
  height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

#wotc-fullscreen-container .plate img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.95;
  filter: sepia(0.2) contrast(1.05) saturate(0.85);
  -webkit-mask-image: radial-gradient(72% 72% at 50% 50%, #000 65%, transparent 100%);
  mask-image: radial-gradient(72% 72% at 50% 50%, #000 65%, transparent 100%);
  animation: plateIn 2.2s var(--ease) both;
}

@keyframes plateIn {
  from {
    opacity: 0;
    transform: scale(1.08);
    filter: sepia(0.2) blur(8px);
  }

  to {
    opacity: 0.95;
    transform: scale(1);
    filter: sepia(0.2) contrast(1.05) saturate(0.85);
  }
}

/* ---------- copy block ---------- */
#wotc-fullscreen-container .copy {
  max-width: 38rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 8rem);
  padding: 0;
}

#wotc-fullscreen-container .copy>* {
  opacity: 0;
  animation: riseIn 1.1s var(--ease) forwards;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

#wotc-fullscreen-container .eyebrow {
  font-family: var(--serif);
  font-size: clamp(0.9rem, 1.2vw, 1.2rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.4rem;
  animation-delay: 0.25s;
}

#wotc-fullscreen-container .title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: 0.012em;
  margin: 0;
  color: var(--primary-dark);
  animation-delay: 0.4s;
}

#wotc-fullscreen-container .title b {
  font-weight: 700;
  color: var(--primary);
}

#wotc-fullscreen-container .subtitle {
  font-family: var(--body);
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
  animation-delay: 0.55s;
}

#wotc-fullscreen-container .rule {
  display: block;
  height: 14px;
  margin: 1rem 0;
  animation-delay: 0.65s;
  color: var(--rule);
}

#wotc-fullscreen-container .rule svg {
  width: 160px;
  max-width: 60%;
  height: 14px;
  display: block;
}

#wotc-fullscreen-container .text {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  text-align: left;
  color: var(--ink);
  margin: 0 0 0.9rem;
  animation-delay: 0.8s;
}

#wotc-fullscreen-container .quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  color: var(--primary-dark);
  border-left: 2px solid var(--secondary);
  padding-left: 1rem;
  margin: 0 0 1rem;
  animation-delay: 0.95s;
}

#wotc-fullscreen-container .devotion {
  font-family: var(--body);
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 1.2rem;
  animation-delay: 1.05s;
}

#wotc-next-btn {
  position: absolute;
  bottom: 20px;
  right: clamp(1.5rem, 3vw, 3rem);
  z-index: 100;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0);
  /* Subtle Gold */
  color: var(--primary-dark);
  padding: 12px 30px;
  border-radius: 50px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#wotc-next-btn span {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1.2rem;
}

#wotc-next-btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(100, 70, 30, 0.25);
}

#wotc-next-btn:hover span {
  transform: translateX(6px);
}

#wotc-fullscreen-container .stationmark {
  position: absolute;
  top: clamp(1.6rem, 4vw, 3.2rem);
  right: clamp(1.5rem, 6vw, 6rem);
  font-family: var(--serif);
  font-size: clamp(3.5rem, 11vw, 9rem);
  line-height: 1;
  color: rgba(92, 76, 59, 0.1);
  letter-spacing: 0.04em;
  pointer-events: none;
  animation: riseIn 2s var(--ease) both;
}

/* ---------- haze transition wash ---------- */
#wotc-fullscreen-container .haze {
  position: absolute;
  inset: -12%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}

#wotc-fullscreen-container .haze .wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  background: radial-gradient(circle, rgba(255, 253, 246, 0.98) 0%, rgba(250, 245, 232, 0.55) 55%, rgba(250, 245, 232, 0) 75%);
}

#wotc-fullscreen-container .haze .w1 {
  inset: -10% 20% 10% -25%;
}

#wotc-fullscreen-container .haze .w2 {
  inset: 5% -25% -15% 25%;
}

#wotc-fullscreen-container .haze .w3 {
  inset: -20% -10% 20% 10%;
}

@keyframes hazeSweep {
  0% {
    opacity: 0;
    transform: scale(1.15);
  }

  38% {
    opacity: 1;
    transform: scale(1);
  }

  62% {
    opacity: 1;
    transform: scale(0.99);
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

#wotc-fullscreen-container .haze.sweep {
  animation: hazeSweep 2.1s var(--ease) both;
}

/* ---------- hud ---------- */
#wotc-fullscreen-container .hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem clamp(1.5rem, 7vw, 9rem) 1.4rem;
  pointer-events: none;
  font-family: var(--serif);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #8b5a2b;
  width: 80%;
}

#wotc-fullscreen-container .hud-track {
  flex: 1;
  height: 1px;
  background: rgba(94, 74, 51, 0.18);
  position: relative;
  overflow: hidden;
}

#wotc-fullscreen-container .hud-track::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: rgba(94, 74, 51, 0.6);
  transition: width 1.2s var(--ease);
}

#wotc-next-btn:focus {
  outline: none !important;
}

/* ---------- Outro Slide Layout ---------- */
#wotc-fullscreen-container .scene.scene-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  overflow: hidden;
}

#wotc-fullscreen-container .scene.scene-outro .copy {
  max-width: 900px;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 4rem 5rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(139, 90, 43, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  z-index: 2;
  margin: 0 auto;
  min-height: auto;
}

#wotc-fullscreen-container .scene.scene-outro .title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 0.5rem;
}

#wotc-fullscreen-container .scene.scene-outro .text {
  text-align: center;
  font-size: 1.15rem;
}

#wotc-fullscreen-container .scene.scene-outro .text:first-of-type::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
}

#wotc-fullscreen-container .scene.scene-outro .rule {
  margin: 2rem auto;
}

#wotc-fullscreen-container .scene.scene-outro .quote {
  border-left: none;
  padding-left: 0;
  margin-top: 2rem;
  font-size: 1.25rem;
}

#wotc-fullscreen-container .scene.scene-outro .plate {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  z-index: 1;
  opacity: 0.15;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wotc-fullscreen-container .scene.scene-outro .plate img {
  width: 140%;
  height: 140%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: blur(4px) sepia(0.5);
  animation: scaleBreath 30s infinite alternate;
  -webkit-mask-image: none;
  mask-image: none;
}

#wotc-fullscreen-container .scene.scene-outro .watermark {
  display: none;
}

@keyframes scaleBreath {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.1);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {

  #wotc-fullscreen-container .scene,
  #wotc-fullscreen-container .scene.flip {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: clamp(1.5rem, 6vw, 3rem) 1.35rem 6rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #wotc-fullscreen-container .plate {
    position: relative;
    top: 0;
    height: auto;
  }

  #wotc-fullscreen-container .plate img {
    max-height: 40vh;
  }

  #wotc-fullscreen-container .copy {
    max-width: none;
    min-height: auto;
    padding: 0;
  }

  #wotc-fullscreen-container .text {
    text-align: left;
  }

  #wotc-fullscreen-container .stationmark {
    font-size: 4.5rem;
    top: 0.6rem;
    right: 1rem;
  }

  #wotc-fullscreen-container .hud {
    padding: 0.8rem 1.35rem 1rem;
    font-size: 0.6rem;
  }

  #wotc-fullscreen-container .hud-mark {
    display: none;
  }

  #wotc-fullscreen-container .scene.scene-outro {
    padding: 2rem 1.5rem;
    overflow-y: auto;
    justify-content: flex-start;
  }

  #wotc-fullscreen-container .scene.scene-outro .copy {
    padding: 2.5rem 1.5rem;
    background: rgba(253, 251, 247, 0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  #wotc-fullscreen-container * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}