:root {
  --paper: #f8f7f2;
  --paper-soft: #eeece4;
  --ink: #141414;
  --muted: #77736a;
  --line: rgba(20, 20, 20, 0.16);
  --white: #fffdfa;
  --shadow: rgba(40, 36, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.52) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 65%, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px);
  background-size: 34px 34px, 41px 41px;
  mix-blend-mode: soft-light;
}

.panel {
  position: relative;
  min-height: 100svh;
}

.opening {
  display: grid;
  place-items: center;
  padding: 8vw;
  background:
    linear-gradient(90deg, rgba(248, 247, 242, 0.98) 0%, rgba(248, 247, 242, 0.72) 46%, rgba(248, 247, 242, 0.2) 100%),
    url("../assets/placeholders/top-hero-9321.JPEG") center / cover no-repeat;
}

.opening__inner {
  width: min(1120px, 100%);
}

.opening__label {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3.4rem, 8vw, 8.8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0;
}

.opening__mobile {
  display: none;
}

.opening h1 {
  margin: clamp(28px, 4vw, 52px) 0 0;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(28px, 5vw, 56px);
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  transform: translateX(-50%);
}

.scroll-cue i {
  width: 1px;
  height: 52px;
  background: linear-gradient(var(--muted), transparent);
}

.year-nav {
  position: fixed;
  left: clamp(18px, 3vw, 54px);
  bottom: clamp(22px, 6vw, 78px);
  z-index: 30;
}

.year-nav ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.year-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  color: rgba(20, 20, 20, 0.42);
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease;
}

.year-nav a::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 10px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.year-nav a.is-active {
  color: var(--ink);
  transform: translateX(4px);
}

.year-nav a.is-active::before {
  opacity: 1;
}

.story-scene {
  display: grid;
  grid-template-columns: minmax(0, 1040px) minmax(320px, 430px);
  justify-content: center;
  align-items: center;
  gap: clamp(46px, 5vw, 82px);
  min-height: 124svh;
  padding: clamp(84px, 9vw, 136px) clamp(42px, 5vw, 96px);
}

.story-scene:nth-child(even) {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1040px);
}

.story-scene:nth-child(even) .story-scene__media {
  order: 2;
}

.story-scene__media {
  position: relative;
  overflow: visible;
  width: min(100%, 1040px);
  aspect-ratio: 1.5 / 1;
  background: var(--paper-soft);
  box-shadow: 0 34px 90px var(--shadow);
  will-change: opacity;
}

.story-scene__media::before,
.story-scene__media::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.story-scene__media::before {
  inset: 16px;
  z-index: 2;
  border: 1px solid rgba(255, 253, 250, 0.42);
  mix-blend-mode: screen;
}

.story-scene__media::after {
  left: clamp(20px, 3vw, 46px);
  right: clamp(20px, 3vw, 46px);
  bottom: -28px;
  z-index: -1;
  height: 42px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 253, 250, 0.54);
}

.story-scene:nth-child(even) .story-scene__media {
  justify-self: end;
  aspect-ratio: 1.5 / 1;
}

.story-scene:nth-child(odd) .story-scene__media {
  justify-self: start;
}

.story-scene__track {
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 100%;
  scroll-snap-type: x mandatory;
}

.story-scene__track.is-scrollable {
  gap: clamp(14px, 1.5vw, 22px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 clamp(16px, 2vw, 28px) 18px 0;
  scrollbar-color: rgba(20, 20, 20, 0.28) transparent;
  scrollbar-width: thin;
}

.story-scene__frame {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--paper-soft);
}

.story-scene__track.is-scrollable .story-scene__frame {
  flex-basis: min(84%, 900px);
}

.story-scene__track.is-scrollable .story-scene__frame:first-child {
  margin-left: 0;
}

.story-scene__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--media-position, center);
}

.story-scene__frame figcaption {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 3;
  padding: 4px 8px;
  color: rgba(255, 253, 250, 0.88);
  font-size: 0.72rem;
  background: rgba(20, 20, 20, 0.22);
  backdrop-filter: blur(10px);
}

.story-scene__copy {
  position: relative;
  z-index: 2;
  max-width: 430px;
  padding-top: 6vh;
  will-change: transform, opacity;
}

.story-scene__copy::before {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  margin-bottom: 30px;
  background: rgba(20, 20, 20, 0.24);
}

.story-scene__ghost-year {
  position: absolute;
  top: clamp(46px, 7vw, 96px);
  right: clamp(22px, 5vw, 82px);
  z-index: 0;
  margin: 0;
  color: rgba(20, 20, 20, 0.045);
  font-size: clamp(8rem, 18vw, 18rem);
  font-weight: 300;
  line-height: 0.8;
  pointer-events: none;
}

.story-scene__year {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.88rem;
}

.story-scene__scene {
  margin: 0 0 18px;
  font-size: clamp(1.5rem, 2.6vw, 2.65rem);
  font-weight: 300;
  line-height: 1.2;
}

.story-scene h2 {
  margin: 0 0 26px;
  font-size: clamp(1.22rem, 1.9vw, 1.75rem);
  font-weight: 400;
  line-height: 1.7;
}

.story-scene__copy.is-rich-copy {
  max-width: 520px;
}

.story-scene__copy.is-rich-copy h2 {
  margin-bottom: 22px;
  font-size: clamp(1.75rem, 3vw, 3.15rem);
  font-weight: 300;
  line-height: 1.35;
}

.story-scene__lead {
  margin: 0 0 28px;
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  font-weight: 400;
  line-height: 1.9;
}

.story-scene__text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 2.05;
}

.story-scene__copy.is-rich-copy .story-scene__text {
  font-size: clamp(0.82rem, 0.95vw, 0.94rem);
  line-height: 2.1;
}

.story-scene.story-scene--turning-point,
.story-scene.story-scene--turning-point:nth-child(even) {
  grid-template-columns: minmax(380px, 600px) minmax(0, 720px);
  gap: clamp(58px, 6vw, 104px);
  align-items: start;
  min-height: 176svh;
  padding-top: clamp(120px, 12vw, 190px);
  padding-bottom: clamp(130px, 13vw, 210px);
  background:
    linear-gradient(180deg, rgba(238, 236, 228, 0.76), rgba(248, 247, 242, 0.96) 34%, rgba(238, 236, 228, 0.84));
}

.story-scene--turning-point .story-scene__media {
  align-self: start;
  position: sticky;
  top: clamp(84px, 10vh, 118px);
  order: 0;
  justify-self: end;
  aspect-ratio: 0.74 / 1;
  width: min(100%, 520px);
  box-shadow: 0 42px 120px rgba(40, 36, 28, 0.2);
}

.story-scene.story-scene--turning-point:nth-child(even) .story-scene__media {
  order: 0;
  justify-self: end;
  aspect-ratio: 0.74 / 1;
}

.story-scene--turning-point .story-scene__track.is-scrollable .story-scene__frame {
  flex-basis: min(90%, 470px);
}

.story-scene--turning-point .story-scene__copy {
  max-width: 720px;
  padding: clamp(34px, 4vw, 56px);
  background: rgba(255, 253, 250, 0.5);
  border-top: 1px solid rgba(20, 20, 20, 0.16);
  border-bottom: 1px solid rgba(20, 20, 20, 0.12);
  backdrop-filter: blur(10px);
}

.story-scene--turning-point .story-scene__copy::before {
  width: 88px;
  margin-bottom: 34px;
  background: rgba(20, 20, 20, 0.46);
}

.story-scene--turning-point .story-scene__scene {
  font-size: clamp(1.7rem, 3.2vw, 3.45rem);
}

.story-scene--turning-point h2 {
  margin-bottom: 40px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.48;
}

.story-scene--turning-point .story-scene__text {
  color: rgba(20, 20, 20, 0.74);
  font-size: clamp(0.95rem, 1.08vw, 1.08rem);
  line-height: 2.25;
}

.story-scene--turning-point .story-scene__ghost-year {
  color: rgba(20, 20, 20, 0.065);
  font-size: clamp(10rem, 20vw, 21rem);
}

.story-scene__link {
  display: inline-flex;
  margin-top: 28px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.next-scene {
  display: grid;
  place-items: center;
  min-height: 108svh;
  padding: 10vw;
  background:
    linear-gradient(180deg, rgba(248, 247, 242, 0.92), rgba(255, 253, 250, 0.98)),
    var(--white);
}

.next-scene__canvas {
  position: absolute;
  width: min(58vw, 760px);
  aspect-ratio: 1.6 / 1;
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(229, 227, 218, 0.5));
  opacity: 0.62;
}

.next-scene__copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.next-scene__copy p,
.contact__inner p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.next-scene h2,
.contact h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.6;
}

.contact {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 10vw;
  color: var(--white);
  background: #151515;
}

.contact__inner {
  width: min(760px, 100%);
  text-align: center;
}

.contact__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 54px;
  padding: 0 30px;
  border: 1px solid rgba(255, 253, 250, 0.38);
  color: var(--white);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.contact__button:hover,
.contact__button:focus-visible {
  background: var(--white);
  color: var(--ink);
}

.no-motion .story-scene__copy {
  opacity: 1;
}

@media (max-width: 820px) {
  .opening {
    min-height: 96svh;
    padding: 24px;
    align-items: end;
    background:
      linear-gradient(180deg, rgba(248, 247, 242, 0.28) 0%, rgba(248, 247, 242, 0.92) 72%),
      url("../assets/placeholders/top-hero-9321.JPEG") center / cover no-repeat;
  }

  .opening__inner {
    padding-bottom: 17vh;
  }

  .opening__label {
    max-width: 100%;
    font-size: clamp(2.55rem, 10vw, 4.1rem);
    overflow-wrap: normal;
  }

  .opening__desktop {
    display: none;
  }

  .opening__mobile {
    display: inline;
  }

  .year-nav {
    left: 8px;
    right: auto;
    bottom: 12px;
    width: min(374px, calc(100vw - 16px));
    padding: 9px 6px;
    background: rgba(248, 247, 242, 0.76);
    backdrop-filter: blur(14px);
  }

  .year-nav ul {
    display: grid;
    grid-template-columns: repeat(var(--year-count, 7), minmax(0, 1fr));
    gap: 0;
  }

  .year-nav a {
    justify-content: center;
    min-width: auto;
    padding: 4px 2px;
    font-size: 0.68rem;
  }

  .year-nav a::before {
    display: none;
  }

  .story-scene,
  .story-scene:nth-child(even) {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 28px;
    min-height: 112svh;
    padding: 92px 22px 126px;
  }

  .story-scene:nth-child(even) .story-scene__media {
    order: 0;
  }

  .story-scene__media,
  .story-scene:nth-child(even) .story-scene__media {
    width: 100%;
    aspect-ratio: 0.84 / 1;
  }

  .story-scene__media::before {
    inset: 10px;
  }

  .story-scene__media::after,
  .story-scene__copy::before {
    display: none;
  }

  .story-scene__track.is-scrollable {
    gap: 12px;
    padding: 0 18px 14px 0;
  }

  .story-scene__track.is-scrollable .story-scene__frame {
    flex-basis: 88%;
  }

  .story-scene--turning-point,
  .story-scene--turning-point:nth-child(even) {
    min-height: auto;
    padding-top: 96px;
    background:
      linear-gradient(180deg, rgba(238, 236, 228, 0.72), rgba(248, 247, 242, 0.98) 30%, rgba(238, 236, 228, 0.72));
  }

  .story-scene--turning-point .story-scene__media {
    position: relative;
    top: auto;
    aspect-ratio: 0.84 / 1;
    width: 100%;
  }

  .story-scene--turning-point .story-scene__copy {
    max-width: 100%;
    padding: 26px 0 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }

  .story-scene--turning-point h2 {
    font-size: clamp(1.34rem, 6vw, 1.95rem);
  }

  .story-scene--turning-point .story-scene__text {
    font-size: 0.9rem;
    line-height: 2.08;
  }

  .story-scene__ghost-year {
    top: 36px;
    right: 18px;
    font-size: clamp(5rem, 24vw, 8rem);
  }

  .story-scene__copy {
    max-width: none;
    padding-top: 0;
    padding-right: 8px;
  }

  .story-scene__year {
    margin-bottom: 10px;
  }

  .story-scene__scene {
    margin-bottom: 12px;
  }

  .next-scene,
  .contact {
    min-height: 92svh;
    padding: 22px 22px 88px;
  }

  .next-scene__canvas {
    width: 86vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
