/* ══════════════════════════════════════════════════
   STORY INTRO — full screen, shown when the site opens.
   Each chapter is a full-bleed photo with the words on a
   dark fade. Scroll (or swipe up) to move; scrolling past
   the last chapter fades into the portfolio.
   Built for low-end phones: no blur, no filters, no JS
   animation — just one static gradient per panel.
══════════════════════════════════════════════════ */
.story {
  position: fixed; inset: 0; z-index: 900;
  background: #0b0b0d; color: #fff;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  transition: opacity 300ms ease;
}
.story[hidden] { display: none; }
.story.is-leaving { opacity: 0; pointer-events: none; }
html.story-open, html.story-open body { overflow: hidden !important; }

/* Header: progress bars + name + skip */
.story-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 28px;
  background: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0));
  pointer-events: none;
}
.story-progress { display: flex; gap: 4px; }
.story-progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.3); }
.story-progress i.is-on { background: #fff; }
.story-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; pointer-events: auto; }
.story-who { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; }
.story-who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255,255,255,0.7); }
.story-skip {
  font: inherit; font-size: 13px; font-weight: 600; color: #111; cursor: pointer;
  padding: 8px 14px; border-radius: 18px; border: 0; background: #fff;
}

/* Scroller */
.story-track {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; outline: none;
}
.story-track::-webkit-scrollbar { display: none; }

/* Chapter: full-bleed photo, words at the bottom */
.story-panel {
  position: relative; height: 100vh; height: 100dvh; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
  background: #141417;
}
.story-media { position: absolute; inset: 0; }
.story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,8,10,0.96) 0%, rgba(8,8,10,0.82) 30%, rgba(8,8,10,0.25) 58%, rgba(8,8,10,0) 75%);
}
.story-copy {
  position: absolute; z-index: 2; left: 20px; right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 44px);
}
.story-year { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #ffb38a; }
.story-year b { font-size: 13px; font-weight: 700; color: #111; background: #ff8a50; padding: 3px 7px; border-radius: 5px; letter-spacing: 0; }
.story-copy h2 { margin: 10px 0 8px; font-size: clamp(28px, 8.4vw, 40px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; }
.story-copy p:last-child { font-size: clamp(15px, 4.1vw, 17px); line-height: 1.55; color: rgba(255,255,255,0.86); max-width: 52ch; }

/* Last panel */
.story-end { display: flex; flex-direction: column; justify-content: center; padding: 0 24px; background: #0b0b0d; }
.story-end h2 { font-size: clamp(32px, 9vw, 54px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.story-end p { margin-top: 12px; font-size: 16px; color: rgba(255,255,255,0.75); max-width: 40ch; }
.story-enter {
  align-self: flex-start; margin-top: 28px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  height: 50px; padding: 0 24px; border-radius: 12px; border: 0; background: #ff6a2b; color: #fff;
}
.story-exit { height: 100vh; height: 100dvh; scroll-snap-align: start; }

.story-hint {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  text-align: center; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,0.7); pointer-events: none;
}
.story-hint.is-gone { visibility: hidden; }

/* Large screens: photo on the left, words on the right */
@media (min-width: 900px) {
  .story-top { padding: 18px 40px 30px; }
  .story-panel { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 56px; padding: 100px 64px 60px; }
  .story-media { position: relative; inset: auto; height: 100%; max-height: 74vh; border-radius: 14px; overflow: hidden; }
  .story-media::after { display: none; }
  .story-copy { position: static; }
  .story-copy h2 { font-size: 44px; }
  .story-end { display: flex; padding: 0 64px; }
}

@media (prefers-reduced-motion: reduce) { .story { transition: none; } }
