*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:         #f7f5f2;
  --footer-bg:  #dce3ec;
  --text:       #141210;
  --muted:      #8a8680;
  --divider:    #c0c9d4;
  --font:       system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --ease:       cubic-bezier(0.25, 0.1, 0.25, 1);
  --t:          0.35s;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

/* ── SKIP LINK ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  z-index: 999;
}

.skip-link:focus {
  top: 1rem;
}

/* ── CLOSE / BACK BUTTON ─────────────────── */
.back-link {
  position: fixed;
  top: clamp(1rem, 2.5vw, 1.75rem);
  right: clamp(1rem, 2.5vw, 1.75rem);
  z-index: 100;
  width: clamp(2.5rem, 4vw, 3.25rem);
  height: clamp(2.5rem, 4vw, 3.25rem);
  border-radius: 50%;
  border: 1.5px solid var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  opacity: 0.4;
  transition: opacity var(--t) var(--ease), background var(--t) var(--ease);
}

.back-link:hover,
.back-link:focus-visible {
  opacity: 1;
  background: var(--text);
  color: var(--bg);
}

.back-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.back-link svg {
  width: 38%;
  height: 38%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ── SCROLL CONTAINER ────────────────────── */
.scroll-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

/* ── FIXED PAGE TITLE ────────────────────── */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
  padding-bottom: clamp(0.5rem, 1.5vw, 1rem);
  background: var(--bg);
  pointer-events: none;
}

.page-title {
  font-size: clamp(2rem, 7vw, 7.5rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--text);
  max-width: 70%;
}

/* ── SLIDE ───────────────────────────────── */
.slide {
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
  overflow: hidden;
}

/* ── IMAGE AREA ──────────────────────────── */
.slide__image {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--header-h, 22vh) clamp(1.25rem, 4vw, 3rem) clamp(0.5rem, 1vw, 1rem);
  min-height: 0;
  overflow: hidden;
}

.slide__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  cursor: zoom-in;
  filter: invert(1);
  transition: filter 0.15s ease;
}

.slide.is-visible .slide__img {
  filter: invert(0);
  transition: filter 1.5s ease 0.3s;
}

.slide__img:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -3px;
}

/* ── FOOTER ──────────────────────────────── */
.slide__footer {
  background: var(--footer-bg);
  display: flex;
  align-items: center;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  min-height: clamp(64px, 10vh, 96px);
  flex-shrink: 0;
}

.footer__left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 100px;
}

.footer__num {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.footer__adventure-label {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer__divider {
  width: 1px;
  height: 36px;
  background: var(--divider);
  margin: 0 clamp(1rem, 2.5vw, 2.5rem);
  flex-shrink: 0;
}

.footer__right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}

.footer__credit-value {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ── PROGRESS TRACK ──────────────────────── */
.progress-track {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 2px;
  height: 80px;
  background: rgba(20, 18, 16, 0.12);
  border-radius: 2px;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}

.progress-track.is-visible {
  opacity: 1;
}

.progress-thumb {
  position: absolute;
  left: 0;
  width: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: top var(--t) var(--ease), height var(--t) var(--ease);
}

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 600px) {
  .progress-track {
    right: 0.75rem;
  }

  .slide__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    min-height: 0;
    padding: 0.75rem clamp(1.25rem, 4vw, 3rem);
  }

  .footer__left {
    min-width: 0;
  }

  .footer__divider {
    display: none;
  }

  .footer__right {
    max-height: 3.5rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: max-height 0.3s ease;
  }

  .footer__right::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5rem;
    background: linear-gradient(transparent, var(--footer-bg));
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .footer__right.is-expanded {
    max-height: 20rem;
  }

  .footer__right.is-expanded::after {
    opacity: 0;
  }

  .slide__title {
    max-width: 85%;
  }
}

/* ── VISUALLY HIDDEN (accessible h1) ────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── REDUCED MOTION ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
