/* ── Overlay ──────────────────────────────────────────────────────────── */

.i3-overlay {
  position: fixed;
  inset: 0;
  z-index: 9300;
  background: #03050a;
  overflow-y: scroll;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-behavior: smooth;
}

.i3-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* Only allow button clicks when the overlay is actually open */
.i3-overlay.is-active .i3-close {
  pointer-events: all;
}

/* ── Sticky close button ──────────────────────────────────────────────── */

.i3-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  padding: 1.1rem 1.25rem;
  pointer-events: none;
  margin-bottom: -3.5rem;
}

.i3-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.i3-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
}

/* ── Each full-screen section ─────────────────────────────────────────── */

.i3-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Ambient glow (blurred color blob behind the frame) ───────────────── */

.i3-ambient {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.i3-ambient::before {
  content: '';
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: var(--i3-accent, rgba(99, 179, 237, 0.18));
  filter: blur(90px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.i3-section.is-visible .i3-ambient::before {
  opacity: 1;
  transform: scale(1);
}

/* ── Image frame ──────────────────────────────────────────────────────── */

.i3-frame {
  position: relative;
  z-index: 1;
  width: min(82vw, 1120px);
  height: min(70vh, 720px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 40px 100px rgba(0, 0, 0, 0.85),
    0 8px 24px rgba(0, 0, 0, 0.6);
  transform: translateZ(0); /* GPU layer */
}

/* ── Image (zoom target) ──────────────────────────────────────────────── */

.i3-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transform: scale(0.9);
  filter: brightness(0.65);
  /* JS drives the transform and filter — no CSS transition here */
  will-change: transform, filter;
}

.i3-img--contain {
  object-fit: contain;
  background: #05080f;
  padding: 1.25rem;
}

/* ── Gradient overlays (for text readability) ─────────────────────────── */

.i3-grad-top {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(3, 5, 10, 0.88) 0%,
    rgba(3, 5, 10, 0.55) 28%,
    transparent 52%
  );
  pointer-events: none;
  z-index: 2;
}

.i3-grad-bottom {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(3, 5, 10, 0.82) 0%,
    rgba(3, 5, 10, 0.4) 22%,
    transparent 44%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Text: top (eyebrow + headline) ──────────────────────────────────── */

.i3-text-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  padding: 2rem 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.i3-eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--i3-accent-text, rgba(99, 179, 237, 0.75));
  opacity: 0;
  transform: translateY(-16px);
  transition:
    opacity 0.6s 0.15s ease,
    transform 0.6s 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.i3-headline {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #fff;
  opacity: 0;
  transform: translateY(-18px);
  transition:
    opacity 0.65s 0.3s ease,
    transform 0.65s 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.i3-section.is-visible .i3-eyebrow,
.i3-section.is-visible .i3-headline {
  opacity: 1;
  transform: translateY(0);
}

/* ── Text: bottom (body) ──────────────────────────────────────────────── */

.i3-text-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  padding: 0 3rem 1.75rem;
}

.i3-body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.52);
  line-height: 1.65;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.65s 0.48s ease,
    transform 0.65s 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.i3-section.is-visible .i3-body {
  opacity: 1;
  transform: translateY(0);
}

/* ── Slide counter (top-left of frame) ────────────────────────────────── */

.i3-counter {
  position: absolute;
  bottom: 1.75rem;
  left: 2rem;
  z-index: 3;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s 0.6s ease;
}

.i3-section.is-visible .i3-counter {
  opacity: 1;
}

/* ── Navigation dots ──────────────────────────────────────────────────── */

.i3-dots {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  gap: 7px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s 0.2s;
}

.i3-overlay.is-active .i3-dots {
  opacity: 1;
}

.i3-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.i3-dot.is-active {
  background: #fff;
  transform: scale(1.6);
}

/* ── Subtle vignette on the frame edges ───────────────────────────────── */

.i3-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 4;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .i3-frame {
    width: 96vw;
    height: 65vh;
    border-radius: 10px;
  }

  .i3-text-top { padding: 1.25rem 1.25rem 0; }
  .i3-text-bottom { padding: 0 1.25rem 1.25rem; }
}
