/* Cinematic Presentation — 5 Acts */

.presentation {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 900;
  background: #0a0a0a;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s var(--ease-out);
}

.presentation.active {
  opacity: 1;
  pointer-events: auto;
}

.presentation.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Skip button */
.pres-skip {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 950;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--warm-500);
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid var(--warm-700);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5);
  cursor: pointer;
  transition: all var(--duration-normal);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.pres-skip:hover {
  color: white;
  border-color: var(--warm-400);
}

/* Progress dots */
.pres-progress {
  position: fixed;
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pres-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warm-700);
  cursor: pointer;
  transition: all var(--duration-normal);
  position: relative;
  padding: 0;
  border: none;
  color: inherit;
  font: inherit;
}

.pres-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.pres-dot:focus-visible {
  outline: 2px solid var(--cornflower);
  outline-offset: 6px;
}

.pres-dot.active {
  background: var(--cornflower);
  box-shadow: 0 0 8px rgba(100, 149, 237, 0.5);
}

/* Slide base */
.slide {
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
}

/* ACT 1: Wayback Machine */
.slide-wayback {
  background: #0a0a0a;
  color: white;
  text-align: center;
}

.wayback-counter {
  font-family: var(--font-mono);
  font-size: clamp(5.5rem, 20vw, 10rem);
  font-weight: 700;
  color: var(--cornflower);
  line-height: 1;
  text-shadow: 0 0 60px rgba(100, 149, 237, 0.2);
}

.wayback-label {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2.5vw, 0.8rem);
  color: var(--warm-400);
  margin-top: var(--space-3);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.wayback-years {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2.2vw, 0.75rem);
  color: var(--warm-400);
  letter-spacing: 0.15em;
}

.wayback-years .bar {
  width: clamp(40px, 12vw, 120px);
  height: 1px;
  background: linear-gradient(90deg, var(--cornflower), var(--rose-600));
  opacity: 0.5;
}

.wayback-quote {
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 2.2vw, 0.75rem);
  color: var(--warm-400);
  margin-top: var(--space-2);
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.6;
}

/* Timeline slide */
.slide-timeline {
  background: #0a0a0a;
  color: white;
}

.timeline-horiz {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 900px;
  position: relative;
  padding-top: var(--space-16);
}

.timeline-horiz::before {
  content: '';
  position: absolute;
  top: calc(var(--space-16) + 6px);
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cornflower), var(--rose-gold), var(--rose-600));
}

.timeline-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.timeline-node .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cornflower);
  border: 2px solid #0a0a0a;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 10px rgba(100, 149, 237, 0.5);
}

.timeline-node .year {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--cornflower);
  margin-top: var(--space-3);
  font-weight: 600;
}

.timeline-node .desc {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--warm-400);
  margin-top: var(--space-2);
  text-align: center;
  max-width: 120px;
  line-height: 1.4;
}

/* ACT 2: The Old JAXCO */
.slide-browser {
  background: #111;
  color: white;
  cursor: pointer;
}

.browser-frame {
  width: 90%;
  max-width: 750px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--warm-700);
  cursor: pointer;
  transition: border-color var(--duration-normal);
}

.browser-frame:hover {
  border-color: var(--cornflower);
}

.browser-chrome {
  background: #2a2a2a;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-url {
  flex: 1;
  background: #1a1a1a;
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--warm-400);
}

.browser-frame iframe {
  width: 100%;
  height: 450px;
  border: none;
  background: white;
  pointer-events: none; /* Preview only — clicks pass to .browser-frame for fullscreen */
}

.slide-browser .caption {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--warm-300);
  margin-top: var(--space-6);
  font-style: italic;
}

/* Portfolio mosaic */
.slide-mosaic {
  background: #0a0a0a;
  color: white;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  max-width: 960px;
  width: 90%;
}

.mosaic-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warm-700);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform var(--duration-normal), box-shadow var(--duration-normal);
}

.mosaic-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 30px rgba(100, 149, 237, 0.35);
}

@media (min-width: 1200px) {
  .mosaic-grid {
    max-width: 1080px;
  }
  .mosaic-grid img {
    height: 240px;
  }
}

.mosaic-clients {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--cornflower);
  margin-top: var(--space-8);
  text-align: center;
  line-height: 1.6;
}

.mosaic-transition {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--warm-400);
  margin-top: var(--space-6);
}

/* Split screen — Full-bleed diptych */
.slide-split {
  background: #0a0a0a;
  color: white;
  padding: 0;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.split-half {
  position: relative;
  overflow: hidden;
}

.split-bg {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.split-bg-future {
  animation: kenBurns 20s ease-in-out infinite alternate;
}

.split-collage {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1;
}

.collage-img {
  position: absolute;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(100, 149, 237, 0.2);
  filter: grayscale(0.4) brightness(0.7);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.collage-img:nth-child(1) { width: 55%; top: 5%; left: 5%; transform: rotate(-3deg); z-index: 2; }
.collage-img:nth-child(2) { width: 45%; top: 10%; right: 5%; transform: rotate(2deg); z-index: 3; }
.collage-img:nth-child(3) { width: 40%; top: 40%; left: 15%; transform: rotate(-6deg); z-index: 1; }
.collage-img:nth-child(4) { width: 50%; bottom: 10%; left: 0%; transform: rotate(1deg); z-index: 4; }
.collage-img:nth-child(5) { width: 45%; bottom: 5%; right: 0%; transform: rotate(3deg); z-index: 2; }

.split-overlay-past {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.2) 0%, rgba(10, 10, 10, 0.5) 60%, rgba(10, 10, 10, 0.85) 100%);
  pointer-events: none;
}

.split-content {
  position: absolute;
  bottom: 15%;
  z-index: 10;
  padding: 0 var(--space-8);
  opacity: 0;
}

.split-content-left {
  left: 0;
  text-align: left;
}

.split-content-left.visible {
  animation: fadeInLeft 1s var(--ease-out) forwards;
}

.split-content-right {
  right: 0;
  text-align: right;
}

.split-content-right.visible {
  animation: fadeInRight 1s var(--ease-out) forwards;
}

.split-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  color: white;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  margin-bottom: var(--space-2);
}

.split-subtitle {
  font-family: var(--font-body);
  font-size: clamp(var(--text-sm), 1.2vw, var(--text-base));
  color: var(--warm-300);
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  z-index: 10;
  background: linear-gradient(180deg, var(--rose-gold), white, var(--rose-gold));
  box-shadow: 0 0 15px rgba(183, 110, 121, 0.4), 0 0 30px rgba(183, 110, 121, 0.2);
  clip-path: inset(100% 0 0 0);
}

.split-divider.visible {
  animation: dividerReveal 1.2s var(--ease-out) forwards;
}

.split-turned {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 20;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-2xl));
  color: var(--rose-gold-light);
  background: rgba(10, 10, 10, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid rgba(183, 110, 121, 0.3);
  opacity: 0;
  -webkit-filter: blur(8px);
  filter: blur(8px);
  white-space: nowrap;
}

.split-turned.visible {
  animation: turnedReveal 1s 0.8s var(--ease-out) forwards;
}

/* Split screen CTA — frosted glass invitation */
.split-cta {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-3) var(--space-7);
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--rose-gold-light);
  border-radius: var(--radius-full);
  border: 1px solid rgba(183, 110, 121, 0.35);
  box-shadow:
    0 0 0 0 rgba(183, 110, 121, 0),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  /* Hidden by default — JS adds .visible after 2.5s */
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    box-shadow var(--duration-normal),
    border-color var(--duration-normal),
    color var(--duration-normal);
}

.split-cta.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  animation: ctaGlow 3.5s 0.8s ease-in-out infinite;
}

.split-cta-chevron {
  width: 10px;
  height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
  transition: transform var(--duration-normal), opacity var(--duration-normal);
}

.split-cta:hover {
  color: white;
  border-color: rgba(212, 160, 168, 0.6);
  box-shadow:
    0 0 18px rgba(183, 110, 121, 0.25),
    0 4px 20px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateX(-50%) translateY(-2px);
  background: rgba(20, 10, 12, 0.65);
}

.split-cta:hover .split-cta-chevron {
  transform: translateX(3px);
  opacity: 0.9;
}

/* Reveal transition */
.slide-reveal {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

@media (max-width: 768px) {
  /* Slide base — force exact viewport height so scroll-snap is reliable */
  .slide {
    height: 100dvh;
    min-height: 0;
    padding: var(--space-6) calc(var(--space-6) + 32px) var(--space-6) var(--space-6);
  }


  /* Timeline slide — tighter spacing */
  .timeline-horiz {
    flex-direction: column;
    align-items: flex-start;
    padding-left: var(--space-8);
    gap: var(--space-6);
    padding-top: 0;
  }

  .timeline-horiz::before {
    top: 0;
    bottom: 0;
    left: calc(var(--space-8) + 6px);
    width: 2px;
    height: auto;
    right: auto;
  }

  .timeline-node {
    flex-direction: row;
    gap: var(--space-4);
    align-items: flex-start;
  }

  .timeline-node .desc {
    font-size: 0.7rem;
    text-align: left;
    max-width: none;
  }

  /* Browser frame slide — maximize content area on mobile */
  .slide-browser {
    padding-right: var(--space-6);
  }

  .browser-frame {
    width: 95%;
  }

  .browser-frame iframe {
    height: 300px;
  }

  .slide-browser .caption {
    font-size: var(--text-base);
    margin-top: var(--space-4);
  }

  /* Mosaic slide — 2-col grid, hide last 2 to fit viewport height */
  .mosaic-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .mosaic-grid img {
    height: 120px;
  }

  .mosaic-grid img:nth-child(n+5) {
    display: none;
  }

  .mosaic-clients {
    font-size: var(--text-base);
    margin-top: var(--space-3);
  }

  .mosaic-transition {
    font-size: var(--text-sm);
    margin-top: var(--space-3);
  }

  /* Split screen slide */
  .split-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .split-title {
    font-size: var(--text-xl);
  }

  .split-subtitle {
    font-size: var(--text-xs);
  }

  /* Navigation controls — pull dots inward away from edge */
  .pres-progress {
    right: var(--space-6);
    gap: var(--space-4);
  }

  .pres-dot::before {
    width: 36px;
    height: 36px;
  }

  .pres-skip {
    top: var(--space-3);
    right: var(--space-3);
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
  }

}
