:root {
  --ink: #24372f;
  --paper: #f8eed7;
  --cream: #fff9e9;
  --sage: #78947a;
  --deep-sage: #31584a;
  --rust: #bd6d4f;
  --sky: #8fbac9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: Georgia, 'Times New Roman', serif; }
body.dialog-open { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }
img, video { max-width: 100%; }

.page-progress { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 4px; transform: scaleX(0); transform-origin: left; background: #f1c47c; box-shadow: 0 1px 5px #17352a55; }
.eyebrow, .chapter-count { font-family: Arial, sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .23em; text-transform: uppercase; }
.eyebrow { margin: 0 0 15px; }
.chapter-count { margin: 0 0 48px; opacity: .65; }

.music-control { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid #29483f77; border-radius: 999px; background: #fff8e9ee; color: var(--ink); box-shadow: 0 8px 30px #1e332b33; backdrop-filter: blur(8px); cursor: pointer; }
.music-control span { font-size: 20px; line-height: 1; }
.music-control b { font-family: Arial, sans-serif; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.music-control[aria-pressed='true'] span { animation: musicPulse 1.6s ease-in-out infinite; }
.music-control:disabled { opacity: .58; cursor: default; }
.music-control:focus-visible, .ticket:focus-visible, .photo-button:focus-visible, .dialog-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.hero { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #8ebdce 0%, #c5ddd8 42%, #f7d69c 73%, #dca66e 100%); }
.hero::after { content: ''; position: absolute; inset: 0; z-index: 10; pointer-events: none; opacity: .1; background: repeating-radial-gradient(circle at 32% 23%, #fff 0 1px, transparent 1px 4px); background-size: 8px 10px; mix-blend-mode: soft-light; }
.sun-glow { position: absolute; width: 48vw; aspect-ratio: 1; right: -11vw; top: -18vw; border-radius: 50%; background: radial-gradient(circle, #fffbd9 0 9%, #f8cf8444 38%, transparent 69%); }
.cloud { position: absolute; width: 210px; height: 34px; border-radius: 50%; background: #fff8e7b0; filter: blur(1px); animation: drift 17s ease-in-out infinite alternate; }
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 92px; height: 67px; left: 28px; bottom: 5px; }
.cloud::after { width: 112px; height: 82px; right: 24px; bottom: 2px; }
.cloud-one { top: 18%; left: 8%; }
.cloud-two { top: 27%; right: 18%; transform: scale(.68); animation-delay: -7s; }
.far-hills, .near-hills, .grass { position: absolute; left: -10%; width: 120%; border-radius: 50% 50% 0 0; }
.far-hills { height: 39%; bottom: 4%; background: radial-gradient(ellipse at 12% 100%, #71977b 0 34%, transparent 35%), radial-gradient(ellipse at 41% 100%, #89a980 0 43%, transparent 44%), radial-gradient(ellipse at 77% 100%, #6f9273 0 46%, transparent 47%); opacity: .92; }
.near-hills { height: 29%; bottom: -4%; background: radial-gradient(ellipse at 25% 100%, #426957 0 51%, transparent 52%), radial-gradient(ellipse at 73% 100%, #50755d 0 52%, transparent 53%); }
.grass { height: 13%; bottom: 0; background: linear-gradient(#31594c, #28483e); }
.flowers { position: absolute; inset: auto 0 2% 0; height: 12%; z-index: 3; }
.flowers i { position: absolute; left: var(--x); bottom: 4px; width: 3px; height: var(--height); background: #76916e; transform-origin: bottom; animation: sway 3s ease-in-out var(--delay) infinite alternate; }
.flowers i:nth-child(3n) { bottom: 18px; }
.flowers i::before { content: ''; position: absolute; width: 10px; aspect-ratio: 1; left: -3px; top: -5px; border-radius: 50%; background: #f5c678; box-shadow: 5px 2px #f9ead2, -4px 3px #f9ead2, 1px -4px #f9ead2; }
.topline { position: relative; z-index: 4; display: flex; justify-content: space-between; padding: 29px clamp(24px, 5vw, 76px); color: #29483f; font-family: Arial, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.hero-copy { position: relative; z-index: 4; width: min(850px, calc(100% - 48px)); margin: clamp(65px, 10vh, 125px) auto 0; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(54px, 8.3vw, 116px); font-weight: 400; letter-spacing: -.06em; line-height: .84; text-shadow: 0 2px 0 #fff4d555; }
.hero h1 em { font-weight: 400; }
.intro { width: min(590px, 100%); margin: 30px auto 34px; font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }
.ticket { display: inline-flex; align-items: center; gap: 34px; min-width: 285px; padding: 13px 16px 13px 23px; border: 1px solid #24342f99; border-radius: 3px; background: #fff8e9e8; color: var(--ink); text-align: left; text-decoration: none; box-shadow: 5px 6px 0 #29483f22; transition: transform .2s ease, box-shadow .2s ease; }
.ticket:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 8px 10px 0 #29483f22; }
.ticket span { flex: 1; font-size: 17px; }
.ticket small { display: block; margin-bottom: 4px; font-family: Arial, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ticket b { display: grid; width: 38px; height: 38px; place-items: center; border-left: 1px dashed #24342f99; font-family: Arial, sans-serif; }
.train-track { position: absolute; z-index: 3; left: 0; right: 0; bottom: 14%; height: 3px; background: #243c36aa; box-shadow: 0 7px 0 #243c3655; }
.train-track::after { content: ''; position: absolute; inset: 2px 0 auto; height: 8px; background: repeating-linear-gradient(90deg, transparent 0 28px, #243c3677 29px 33px); }
.train-car { position: absolute; right: 10%; bottom: 9px; width: 126px; height: 54px; border: 3px solid #243c36; border-radius: 18px 28px 5px 5px; background: #d98653; box-shadow: inset 0 -8px #a8553d; }
.train-car i { display: inline-block; width: 22px; height: 21px; margin: 10px 0 0 10px; border: 2px solid #243c36; border-radius: 7px 7px 2px 2px; background: #a9d2db; }
.train-car::before, .train-car::after { content: ''; position: absolute; bottom: -13px; width: 17px; aspect-ratio: 1; border-radius: 50%; background: #24342f; }
.train-car::before { left: 20px; }
.train-car::after { right: 19px; }
.scroll-note { position: absolute; z-index: 4; bottom: 25px; left: 50%; transform: translateX(-50%); font-family: Arial, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.scroll-note span { display: inline-block; margin-left: 8px; animation: bounce 1.4s ease-in-out infinite; }

.story-intro { position: relative; display: grid; min-height: 82vh; place-items: center; overflow: hidden; padding: 110px 24px; background: linear-gradient(#f8eed7eb, #f8eed7eb), repeating-linear-gradient(0deg, #7f684012 0 1px, transparent 1px 6px); }
.intro-number { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%); color: #b77b5130; font-size: min(72vw, 720px); font-style: italic; line-height: .8; }
.story-intro-copy { position: relative; width: min(820px, 100%); text-align: center; }
.story-intro h2 { margin: 0 0 30px; font-size: clamp(52px, 8vw, 104px); font-weight: 400; letter-spacing: -.055em; line-height: .9; }
.story-intro-copy > p:last-child { width: min(680px, 100%); margin: 0 auto; font-size: clamp(18px, 2.3vw, 24px); line-height: 1.7; }

.story-era { position: relative; min-height: 100vh; overflow: hidden; padding: 120px clamp(24px, 7vw, 110px) 135px; }
.era-heading { width: min(740px, 100%); margin-bottom: 70px; }
.era-heading h2 { margin: 0 0 24px; font-size: clamp(50px, 7vw, 98px); font-weight: 400; letter-spacing: -.06em; line-height: .87; }
.era-text { width: min(590px, 100%); margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.65; }
.era-quote { width: min(810px, 100%); margin: 90px auto 0; padding: 0; border: 0; font-size: clamp(34px, 5vw, 68px); font-style: italic; line-height: 1.08; text-align: center; text-wrap: balance; }
.media-layout { width: min(1240px, 100%); margin: 0 auto; }
.story-media { position: relative; margin: 0; background: var(--cream); box-shadow: 0 22px 55px #3f342122; transform: rotate(var(--tilt)); }
.story-media img, .story-media video { display: block; width: 100%; height: 100%; object-fit: cover; background: #264439; }
.photo-button { display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: transparent; cursor: zoom-in; }
.photo-button img { transition: transform .55s ease; }
.photo-button:hover img { transform: scale(1.025); }

.era-1 { background: #f7ecd2; }
.opening { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 120px; gap: 24px; }
.opening .story-media { border: 11px solid #fff9e9; }
.opening .media-1 { grid-column: 1 / 8; grid-row: 1 / 5; }
.opening .media-2 { grid-column: 8 / 13; grid-row: 1 / 3; }
.opening .media-3 { grid-column: 8 / 13; grid-row: 3 / 6; }
.opening .media-4 { grid-column: 2 / 6; grid-row: 5 / 8; }
.opening .media-5 { grid-column: 6 / 11; grid-row: 5 / 8; }
.opening .media-6 { grid-column: 1 / 5; grid-row: 8 / 11; }
.opening .media-7 { grid-column: 5 / 9; grid-row: 8 / 11; }
.opening .media-8 { grid-column: 9 / 13; grid-row: 7 / 11; }

.era-2 { background: linear-gradient(145deg, #d9e6de, #f0dfbd 76%); }
.era-2 .era-heading { margin-left: auto; text-align: right; }
.era-2 .era-text { margin-left: auto; }
.wandering { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 95px; gap: 22px; }
.wandering .story-media { border: 9px solid #fffaf0; }
.wandering .media-1 { grid-column: 1 / 6; grid-row: 1 / 5; }
.wandering .media-2 { grid-column: 7 / 13; grid-row: 1 / 4; }
.wandering .media-3 { grid-column: 5 / 10; grid-row: 4 / 8; z-index: 2; }
.wandering .media-4 { grid-column: 1 / 5; grid-row: 5 / 8; }
.wandering .media-5 { grid-column: 10 / 13; grid-row: 4 / 7; }
.wandering .media-6 { grid-column: 1 / 7; grid-row: 8 / 12; }
.wandering .media-7 { grid-column: 7 / 13; grid-row: 7 / 11; }
.wandering .media-8 { grid-column: 3 / 8; grid-row: 12 / 15; }
.wandering .media-9 { grid-column: 8 / 13; grid-row: 11 / 15; }
.wandering .media-10 { grid-column: 1 / 4; grid-row: 11 / 14; }

.era-3 { background: linear-gradient(180deg, #6f8d73, #4f705f); color: #fff8e3; }
.era-3::before { content: ''; position: absolute; left: -10%; right: -10%; bottom: -23%; height: 48%; border-radius: 50% 50% 0 0; background: #375b4d; opacity: .65; }
.family { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start; }
.family .story-media { border: 10px solid #fff9e8; }
.family .story-media:nth-child(1) { grid-column: span 2; aspect-ratio: 16 / 10; }
.family .story-media:nth-child(2) { aspect-ratio: 4 / 5; margin-top: 80px; }
.family .story-media:nth-child(3n + 3) { aspect-ratio: 4 / 5; }
.family .story-media:nth-child(3n + 4) { aspect-ratio: 1; margin-top: 45px; }
.family .story-media:nth-child(3n + 5) { aspect-ratio: 3 / 4; }

.era-4 { background: #f4dfbd; }
.era-4 .era-heading { margin-left: auto; margin-right: auto; text-align: center; }
.era-4 .era-text { margin: 0 auto; }
.scrapbook-paragraph { width: min(820px, 100%); margin: -18px auto 50px; color: #463a2f; font-size: clamp(20px, 2.2vw, 30px); font-style: italic; line-height: 1.55; text-align: center; text-wrap: balance; }
.scrapbook { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: start; }
.scrapbook .story-media { width: 100%; padding: 8px; background: #fffaf0; }
.scrapbook .story-media:nth-child(7n + 1) { grid-column: span 2; }
.scrapbook .story-media img, .scrapbook .story-media video { height: auto; max-height: 520px; object-fit: cover; }

.era-5 { background: linear-gradient(180deg, #d2e0dc, #e9d7b6); }
.pair-grid { display: grid; gap: 100px; width: min(1120px, 100%); margin: 0 auto; }
.memory-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.memory-pair:nth-child(even) { transform: translateX(4vw); }
.memory-pair .story-media { aspect-ratio: 4 / 5; padding: 10px; background: #fff9ea; }
.time-tag { position: absolute; left: 18px; bottom: 18px; padding: 7px 11px; background: #fff9e7e6; color: var(--ink); font-family: Arial, sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.era-6 { background: #f7ecd2; }
.era-6 .era-heading { margin-left: auto; margin-right: auto; text-align: center; }
.era-6 .era-text { margin: 0 auto; }
.portraits { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 250px; gap: 22px; }
.portraits .story-media { border: 9px solid #fffaf0; }
.portraits .media-1 { grid-column: 1 / 3; grid-row: 1 / 4; }
.portraits .media-2 { grid-column: 3; grid-row: 1 / 3; }
.portraits .media-3 { grid-column: 3; grid-row: 3 / 5; }
.portraits .media-4 { grid-column: 1; grid-row: 4 / 6; }
.portraits .media-5 { grid-column: 2; grid-row: 4 / 6; }
.portraits .media-6 { grid-column: 3; grid-row: 5 / 7; }

.era-7 { background: radial-gradient(circle at 75% 25%, #d88e6755, transparent 28%), linear-gradient(180deg, #223947, #284a4c 70%, #213b35); color: #fff8e3; }
.era-7::after { content: ''; position: absolute; left: -10%; right: -10%; bottom: -22%; height: 46%; border-radius: 50% 50% 0 0; background: #172f31; }
.brave { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 100px; gap: 22px; }
.brave .story-media { border: 8px solid #f8ecd6; }
.brave .media-1 { grid-column: 1 / 9; grid-row: 1 / 7; }
.brave .media-2 { grid-column: 9 / 13; grid-row: 2 / 5; }
.brave .media-3 { grid-column: 9 / 13; grid-row: 5 / 8; }
.brave .media-4 { grid-column: 2 / 6; grid-row: 7 / 11; }
.brave .media-5 { grid-column: 6 / 10; grid-row: 7 / 11; }
.brave .media-6 { grid-column: 10 / 13; grid-row: 8 / 11; }
.brave .media-7 { grid-column: 1 / 5; grid-row: 11 / 14; }
.brave .media-8 { grid-column: 5 / 9; grid-row: 11 / 15; }
.brave .media-9 { grid-column: 9 / 13; grid-row: 11 / 14; }
.brave .media-10 { grid-column: 3 / 9; grid-row: 15 / 19; }

.thirty { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 90px 24px; color: #fff9e9; text-align: center; background: #172d2d; }
.thirty > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.thirty-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #1029203d, #1029208f 55%, #102920df); }
.thirty-copy { position: relative; z-index: 2; width: min(850px, 100%); }
.thirty .chapter-count { margin-bottom: 0; }
.big-thirty { margin: 0; font-size: clamp(180px, 32vw, 470px); font-style: italic; letter-spacing: -.12em; line-height: .75; opacity: .92; text-shadow: 0 7px 40px #172c2488; }
.thirty h2 { margin: 0 auto 25px; font-size: clamp(42px, 6vw, 78px); font-weight: 400; letter-spacing: -.05em; line-height: .95; }
.thirty-copy > p:last-child { width: min(650px, 100%); margin: 0 auto; font-size: clamp(18px, 2.3vw, 24px); line-height: 1.6; }

.finale { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 110px 24px; background: radial-gradient(circle at 50% 75%, #d7956760, transparent 32%), linear-gradient(#182f3e, #223b47 55%, #1b3334); color: #fff7df; text-align: center; }
.finale::before { content: ''; position: absolute; inset: 0; opacity: .45; background-image: radial-gradient(#fff8da 0 1px, transparent 1.5px), radial-gradient(#fff8da 0 1px, transparent 1.5px); background-position: 0 0, 32px 31px; background-size: 73px 83px, 91px 71px; }
.finale::after { content: ''; position: absolute; left: -10%; right: -10%; bottom: -22%; height: 48%; border-radius: 50% 50% 0 0; background: #152d2d; }
.letter { position: relative; z-index: 2; width: min(820px, 100%); }
.letter h2 { margin: 0 auto 35px; font-size: clamp(48px, 7vw, 94px); font-weight: 400; letter-spacing: -.05em; line-height: .92; }
.final-message { width: min(680px, 100%); margin: 0 auto; font-size: clamp(17px, 2vw, 21px); line-height: 1.7; }
.final-message p { margin: 0 0 18px; }
.final-message p:first-child, .final-message p:last-child { font-size: 1.12em; font-style: italic; }
.signature { margin-top: 50px; font-size: 25px; font-style: italic; }

.photo-dialog { width: min(1150px, calc(100% - 30px)); max-height: calc(100svh - 30px); padding: 0; overflow: visible; border: 0; background: transparent; color: #fff; }
.photo-dialog::backdrop { background: #10211ce8; backdrop-filter: blur(10px); }
.dialog-close { position: fixed; z-index: 4; top: 24px; right: 24px; display: grid; width: 48px; aspect-ratio: 1; place-items: center; border: 1px solid #fff8; border-radius: 50%; background: #fff9e8e8; color: var(--ink); cursor: pointer; font-family: Arial, sans-serif; font-size: 30px; line-height: 1; }
.viewer { display: grid; min-height: 60vh; place-items: center; }
.viewer img, .viewer video { display: block; max-width: 100%; max-height: calc(100svh - 55px); border: 10px solid #fff9e8; object-fit: contain; box-shadow: 0 30px 100px #0009; }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes drift { to { transform: translateX(38px) translateY(-8px); } }
@keyframes sway { to { transform: rotate(7deg); } }
@keyframes bounce { 50% { transform: translateY(5px); } }
@keyframes musicPulse { 50% { transform: scale(1.18) rotate(-8deg); } }

@media (max-width: 900px) {
  .topline span:first-child { display: none; }
  .topline { justify-content: flex-end; }
  .hero-copy { margin-top: 14vh; }
  .train-car { right: 4%; transform: scale(.8); transform-origin: right bottom; }
  .story-era { padding: 95px 24px 110px; }
  .opening, .wandering, .brave { grid-auto-rows: 75px; gap: 15px; }
  .family { grid-template-columns: repeat(2, 1fr); }
  .family .story-media:nth-child(1) { grid-column: 1 / -1; }
  .scrapbook { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portraits { grid-auto-rows: 190px; }
}

@media (max-width: 650px) {
  .hero-copy { margin-top: 11vh; }
  .hero h1 { font-size: clamp(49px, 15vw, 76px); }
  .intro { margin-top: 23px; }
  .scroll-note { bottom: 18px; }
  .story-intro { min-height: 72vh; padding: 90px 22px; }
  .chapter-count { margin-bottom: 30px; }
  .era-heading { margin-bottom: 50px; }
  .era-heading h2 { font-size: clamp(46px, 14vw, 69px); }
  .opening, .wandering, .brave { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: 13px; }
  .opening .story-media, .wandering .story-media, .brave .story-media { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 4 / 5; border-width: 6px; }
  .opening .story-media:first-child, .wandering .story-media:first-child, .brave .story-media:first-child { grid-column: 1 / -1 !important; aspect-ratio: 4 / 3; }
  .family { grid-template-columns: 1fr 1fr; gap: 13px; }
  .family .story-media { margin-top: 0 !important; border-width: 6px; }
  .scrapbook { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .scrapbook .story-media { padding: 5px; }
  .scrapbook-paragraph { margin-top: -8px; margin-bottom: 34px; font-size: 18px; }
  .pair-grid { gap: 54px; }
  .memory-pair { gap: 12px; }
  .memory-pair:nth-child(even) { transform: none; }
  .memory-pair .story-media { padding: 5px; }
  .time-tag { left: 8px; bottom: 8px; padding: 5px 7px; font-size: 7px; }
  .portraits { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: 12px; }
  .portraits .story-media { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 4 / 5; border-width: 6px; }
  .portraits .media-1 { grid-column: 1 / -1 !important; aspect-ratio: 4 / 3; }
  .era-quote { margin-top: 65px; font-size: clamp(32px, 10vw, 48px); }
  .big-thirty { font-size: 54vw; }
  .music-control { right: 12px; bottom: 12px; padding: 10px 13px; }
  .dialog-close { top: 12px; right: 12px; }
  .viewer img, .viewer video { border-width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
