/*
 * style.css — Animation-specific styles only
 */

/* ── Loading overlay ──────────────────────────────────────── */
#loadingOverlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background:
    radial-gradient(ellipse at top left,     #c0bebf 0%, transparent 60%),
    radial-gradient(ellipse at bottom right, #d6d6d8 0%, transparent 60%),
    radial-gradient(ellipse at bottom left,  #e1e2e4 0%, transparent 60%),
    #d0d0d2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}
.load-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}
.load-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  font-weight: 500;
}
.load-track {
  width: 200px;
  height: 2px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.load-bar {
  height: 100%;
  width: 0%;
  background: #1a1a1a;
  border-radius: 2px;
  transition: width 0.15s linear;
}

/* ── Animation outer wrapper ──────────────────────────────── */
.anim-sticky-outer {
  height: 500vh;
  background: var(--bg-dark);
  position: relative;
}

/* Mobile: reduce scroll distance — portrait phones need less travel */
@media (max-width: 680px) {
  .anim-sticky-outer { height: 350vh; }
}

/* ── Sticky inner frame ───────────────────────────────────── */
/*
 * Height must be explicit for position:sticky to work correctly
 * and for children with height:100% to resolve.
 * Background matches outer dark bg — if any sliver shows, it's dark not grey.
 */
.anim-sticky-inner {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-dark);
}

/* Vignette on sticky-inner: covers only visible viewport area */
.anim-sticky-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(21,20,18,0.52) 0%,  transparent 18%),
    linear-gradient(to top,    rgba(21,20,18,0.68) 0%,  transparent 22%),
    linear-gradient(to right,  rgba(21,20,18,0.22) 0%,  transparent 12%),
    linear-gradient(to left,   rgba(21,20,18,0.22) 0%,  transparent 12%);
}

/* ── Stage ───────────────────────────────────────────────── */
.scroll-stage {
  width: 100%;
  height: 100%;   /* resolves because sticky-inner has explicit height */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
 * sticky-canvas: fills 100% of the stage.
 * No aspect-ratio here — height is driven by the parent (100vh - navH).
 * drawFrame uses cover-mode (Math.max) so the image fills edge-to-edge
 * and the grey frame borders of the source JPEGs are cropped away.
 */
.sticky-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  container-type: size;
  overflow: hidden;
}

#vanCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* ── Scene overlays ───────────────────────────────────────── */
.scene-overlay {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 45cqw;
}

.scene-left {
  top: 50%;
  left: 5cqw;
  transform: translateY(calc(-50% + 1.5cqh));
}
.scene-left.visible {
  opacity: 1;
  transform: translateY(-50%);
}

.scene-right {
  top: 50%;
  right: 5cqw;
  text-align: right;
  transform: translateY(calc(-50% + 1.5cqh));
}
.scene-right.visible {
  opacity: 1;
  transform: translateY(-50%);
}

.scene-center {
  top: 50%;
  left: 50%;
  text-align: center;
  transform: translate(-50%, calc(-50% + 1.5cqh));
  max-width: 70cqw;
}
.scene-center.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* ── Typography ───────────────────────────────────────────── */
.scene-label {
  display: block;
  font-size: clamp(0.55rem, 1.3cqw, 0.85rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  margin-bottom: 0.4em;
}

.scene-headline {
  font-size: clamp(1.1rem, 5cqw, 3.5rem);
  font-weight: 900;
  line-height: 1.08;
  color: #fff;
  text-shadow:
    0 2px 8px rgba(0,0,0,0.3),
    0 6px 32px rgba(0,0,0,0.18);
  letter-spacing: -0.02em;
}

/* ── CTA button ───────────────────────────────────────────── */
.cta-block {
  margin-top: 1.5em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
  pointer-events: none;
}
.cta-block.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cta-btn {
  display: inline-block;
  padding: 0.8em 2em;
  background: #fff;
  color: #111;
  font-family: 'Satoshi', system-ui, sans-serif;
  font-size: clamp(0.75rem, 1.4cqw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transition: background 0.18s ease, color 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}
.cta-btn:hover {
  background: #111;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.cta-btn:active { transform: translateY(0); }

/* ── Scroll hint ──────────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 2.5cqh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
  white-space: nowrap;
}
.scroll-hint.hidden { opacity: 0; }
.scroll-hint-arrow {
  font-size: clamp(1rem, 2.5cqw, 1.6rem);
  color: rgba(255,255,255,0.65);
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  animation: bounce 1.6s ease-in-out infinite;
}
.scroll-hint-label {
  font-size: clamp(0.55rem, 1cqw, 0.72rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar {
  position: absolute;
  bottom: 1.2cqh;
  right: 2cqw;
  width: 10cqw;
  max-width: 120px;
  height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  z-index: 10;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: width 0.08s linear;
}
