/* Extracted styles from index.html */
/* Make the page background black and remove default spacing */
html, body { height: 100%; margin: 0; background: #000; }
/* Center the video in the viewport (vertical + horizontal) */
body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

/* Make the video cover the viewport and crop horizontally so there are no black bars */
.video-wrap {
  position: fixed;
  inset: 0; /* fill viewport */
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
#end-overlay {
  position: absolute;
  inset: 0;
  display: none; /* shown on video end */
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: rgba(0,0,0,0.25);
  z-index: 10001;
}
#end-overlay .end-inner {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
}
#end-overlay .end-item {
  flex: 1 1 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
/* Right item content placeholder (container for the posturing dialog) */
#posturing-main-content {
  width: 100%;
  height: 100%;
  position: relative; /* anchor dialog to top */
  padding: 0.5rem;
  box-sizing: border-box;
}

/* Posturing dialog inside the end-overlay right column */
.posturing-dialog {
  /* center dialog in its container */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92%, 820px);
  max-width: 820px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  /* liquid glass: bluish translucent gradient + subtle border and blur */
  background: linear-gradient(135deg, rgba(20,60,140,0.10), rgba(255,255,255,0.04));
  color: #0b1724;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 8px 22px rgba(6,18,36,0.28);
  min-height: 220px; /* make the box a lot taller */
}
/* top tip (rounded pill) above the dialog */
.posturing-dialog::before {
  content: '';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 28px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* allow specific dialogs to hide the top tip */
.posturing-dialog.no-tip::before { display: none; }

/* CTA dialog in scene 4: make it narrower (60% of its container) and slightly taller */
.scene[data-index="4"] .posturing-dialog,
.posturing-dialog.scene-cta {
  width: 80%; /* allow the dialog to take up more space for the CTA */
  max-width: none;
  min-height: 260px;
}
.posturing-dialog .camera-rect {
  /* occupy 80% of the dialog's height and show hunched.png centered */
  flex: 0 0 auto;
  width: 180px;
  height: 80%;
  /* Gradient background; actual image is an <img> in the HTML for clarity and accessibility */
  background: linear-gradient(135deg,#dfe7ff,#b8d0ff);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.posturing-dialog .camera-rect img {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}
.posturing-dialog .dialog-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 24px; /* increased spacing between members */
  align-items: center; /* center align content horizontally */
  text-align: center;  /* center text */
}

/* add horizontal padding inside the dialog body to give breathing room */
.posturing-dialog .dialog-body { padding: 0 36px; }
.posturing-dialog .dialog-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 400; /* serif should not be bold */
  font-family: Palatino, "Georgia", serif;
}
  
/* Reduce scene text size on small screens for better fit */
@media (max-width:800px) {
  .scene-text h2 {
    font-size: 1.5rem !important;
    line-height: 1.25;
  }

  .scene:not([data-index="4"]) .scene-text { padding: 0 3% !important; }
}

.posturing-dialog .dialog-sub {
  margin: 0;
  color: #333;
  font-size: 1rem;
  opacity: 0.95;
  font-family: Palatino, "Georgia", serif;
  font-weight: 400;
}
.posturing-dialog .dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-direction: column; /* stack vertically */
  align-items: center; /* center buttons horizontally */
}
.posturing-dialog .pill {
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 400; /* not bold */
  font-size: 1rem;
  width: auto; /* content-size width */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Palatino, "Georgia", serif; /* ensure pill matches dialog serif */
}
.posturing-dialog .pill.primary { background:#1677ff; color:#fff; }
.posturing-dialog .pill.secondary { background:#f1f3f5; color:#111; }

/* For the Scene 4 CTA, use a sans-serif system font and increase padding */
.posturing-dialog.scene-cta .pill.primary {
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 14px 22px;
  font-weight: 500;
  text-decoration: none; /* remove underline */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive: reduce dialog-body padding on medium widths */
@media (max-width:1200px) {
  .posturing-dialog .dialog-body { padding: 0 24px; }
}

/* Responsive: stack vertically on narrow viewports */
@media (max-width:800px) {
  .posturing-dialog { flex-direction: column; align-items: stretch; min-height: auto; }
  .posturing-dialog .camera-rect { width: 100%; height: 180px; flex: none; }
  .posturing-dialog .dialog-actions { justify-content: stretch; }
  .posturing-dialog .dialog-actions .pill { flex: 0 0 auto; }
  .posturing-dialog::before { top: -14px; width: 64px; height: 26px; }
  /* For the final CTA scene on narrow viewports, remove the camera-rect to avoid layout issues */
  .scene[data-index="4"] .posturing-dialog .camera-rect { display: none; }
  /* Reduce horizontal padding when stacked so content doesn't feel cramped */
  .posturing-dialog .dialog-body { padding: 12px 18px; }
}


/* dialog top: calendar icon and infinity circle */
.dialog-top { display:flex; justify-content:space-between; align-items:center; width:100%; padding: 0 16px; }

.posturing-dialog .dialog-text { padding: 0 16px; }
.dialog-top i { font-size: 1.2rem; color: #111; }
.infty-circle { width:36px; height:36px; border-radius:50%; border:3px solid #1677ff; display:flex; align-items:center; justify-content:center; color:#1677ff; font-weight:700; font-size:18px; }

/* Rotation overlay for mobile portrait orientation */
#rotate-overlay {
  position: fixed;
  inset: 0;
  display: none; /* shown via JS when needed */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 1.5rem;
  box-sizing: border-box;
  text-align: center;
}
#rotate-overlay .content { max-width: 90%; }
#rotate-overlay .message {
  color: #000;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.125rem;
  line-height: 1.2;
  margin-top: 0.75rem;
  font-weight: 600;
}
#rotate-overlay svg { width: 64px; height: 64px; fill: none; stroke: #000; stroke-width: 2.5; }
/* Font Awesome rotate icon sizing */
#rotate-overlay i { font-size: 64px; color: #000; display: block; }
/* Scenes (full-viewport section replacement for video) */
.scenes-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
  overflow: hidden;
}
.scene {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  align-items: stretch;
}
.scene.active { display: flex; }
.scene { flex-direction: row; }
.scene.reverse { flex-direction: row-reverse; }
.scene-side {
  width: 50%;
  height: 100%;
  box-sizing: border-box;
}
.scene-image {
  /* center an actual <img> inside this half so we can constrain max-width/height
     and preserve aspect ratio (avoids squishing). */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff; /* ensure white background behind image */
  position: relative;
  overflow: hidden;
}
.scene-image img {
  max-width: 50%;
  max-height: 50%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Scanner reveal band inside scene-image (Option A)
   - .scanner-bg shows scene3.png inside the band
   - .scanner-overlay displays the scanner.png art on top
   The scanner is absolutely positioned and animated via JS. */
.scene-image .scanner {
  position: absolute;
  left: 0;
  top: 0; /* we'll animate via translateY */
  transform: translateY(0);
  width: 100%; /* full width of the scene-image (no horizontal padding) */
  height: 18%; /* increased relative height of the scanning band; JS will compute px values */
  pointer-events: none;
  will-change: transform;
  display: block;
  z-index: 6;
}
/* Scanner overlay should only display the artwork (with transparent center).
   Keep the scanner transparent background and show only the overlay artwork. */
.scene-image .scanner { background: transparent; -webkit-mask-image: none; mask-image: none; box-sizing: border-box; }
.scene-image .scanner {
  /* rounded rectangle stroke to act as the scanning window */
  box-sizing: border-box;
  border-radius: 14px;
  /* Use a higher-contrast stroke so the scanner is visible against the white
     scene-image background. Keep the fill transparent and no outer shadow. */
  /* Make the left/right sides thicker than the top/bottom to emphasize the band.
     Use border-width shorthand: top right bottom left. */
  border-style: solid;
  border-color: rgba(6,18,36,0.75);
  border-width: 3px 10px 3px 10px; /* top/right/bottom/left */
  background: transparent;
  box-shadow: none;
  /* subtle inner highlight to give the stroke a bit of depth without a drop shadow */
  -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Debug helper: disable mask and reveal the scanner-bg rectangle when ?scanDebug=1 is present */
.scanner-debug .scene-image .scanner {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}
.scanner-debug .scene-image .scanner .scanner-bg {
  opacity: 1 !important;
}

.scene-text {
  display: flex;
  background: #fff;
  /* increase line-height for better readability */
  line-height: 1.35;
}
.scene-text h2 { 
  font-family: Palatino, "Georgia", serif; 
  font-size: 2rem; 
  margin: 0; 
  color:#111; 
  max-width: 100%; 
  font-weight: 400; /* serif should not be bold */
  line-height: 1.35;
}

/* Center-align scene text for all scenes except the final CTA scene */
.scene:not([data-index="4"]) .scene-text {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 15%; /* content occupies ~70% of the side */
}

/* Last scene contains the dialog; don't apply the text padding so the dialog
   can size independently and use more horizontal space. */
.scene[data-index="4"] .scene-text {
  padding: 0;
  align-items: center;
  justify-content: center;
}

/* Full-screen blink overlay used between scene transitions */
.blink-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  /* gentler fade: slightly slower and eased */
  transition: opacity 360ms ease-in-out;
  z-index: 99999;
}

/* Bottom progress bar showing time until next scene */
.scene-progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.8vh; /* reduced by additional ~20% */
  background: rgba(255,255,255,0.04);
  z-index: 99998;
}
.scene-progress .bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg,#1677ff,#54a0ff);
  transition: width linear;
}
