:root {
  color-scheme: light;
  --paper: #f3eee4;
  --ink: #2f3a32;
  --sage: #8a9a7b;
  --sage-light: #b7c4a9;
  --accent: #b8674a;
  --accent-light: #d69a80;
  --gold: #d4b98a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #b7c4a9 transparent; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Lora", Georgia, serif; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.moment { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; min-height: 100svh; padding: clamp(28px, 5.5vw, 72px); }
.caps { font-family: "Karla", Arial, sans-serif; font-size: 12px; line-height: 1.5; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.paper { background: var(--paper); }
.photo-moment { color: #fff; }
.background { position: absolute; z-index: -2; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; filter: sepia(.1) contrast(1.02) saturate(.92); }
.photo-moment::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(28 36 30 / 15%), transparent 35%, rgb(28 36 30 / 72%)); }
.photo-moment::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgb(243 238 228 / 28%); border-radius: 22px; pointer-events: none; }
.cover { justify-content: flex-end; }
.cover .caps { font-family: "Cormorant Garamond", Georgia, serif; letter-spacing: .34em; }
.name-badge { position: absolute; left: clamp(40px, 4.6vw, 56px); top: clamp(40px, 4.6vw, 56px); display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 999px; background: rgb(26 21 18 / 42%); color: #f6f0e4; font-size: 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgb(212 185 138 / 35%); }
.name-badge::before, .name-badge::after { content: ""; flex-shrink: 0; width: 14px; height: 1px; background: var(--gold); opacity: .8; }
.cover-copy { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; padding-bottom: clamp(80px, 13vh, 130px); }
.cover h1 { font-family: "EB Garamond", Georgia, serif; font-size: clamp(2.97rem, 11.25vw, 11.25rem); font-weight: 400; line-height: .98; letter-spacing: .01em; text-shadow: 0 2px 40px rgb(0 0 0 / 25%); }
.ornament { position: relative; width: 120px; height: 2px; background: var(--gold); border-radius: 2px; }
.ornament::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%); background: var(--gold); border-radius: 50%; }
.years { color: var(--gold); }
.cover-description { max-width: 34ch; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 400; font-size: clamp(1.1rem, 4vw, 1.9rem); line-height: 1.3; text-wrap: balance; color: rgb(255 255 255 / 92%); }
.scroll-cue { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 16px; font-size: 9px; text-decoration: none; }
.scroll-cue span { font-size: 14px; }
.homecoming { text-align: center; align-items: center; }
.homecoming::before { content: ""; position: absolute; z-index: -1; width: 75%; aspect-ratio: 1; border-radius: 62% 38% 55% 45% / 48% 58% 42% 52%; background: var(--accent-light); opacity: .18; }
.homecoming p { max-width: 22ch; font-size: clamp(1.8rem, 5vw, 4.6rem); line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
em { color: var(--accent); }
.candids { gap: 24px; padding-block: 64px; }
.photo-pair { position: relative; width: 100%; max-width: 440px; padding-bottom: 12%; margin-inline: auto; }
.photo-pair img { display: block; object-fit: cover; }
.photo-pair img:first-child { width: 78%; height: auto; aspect-ratio: 4 / 5; border-radius: 54% 46% 60% 40% / 44% 52% 48% 56%; }
.photo-pair img:last-child { position: absolute; right: 0; bottom: 0; width: 48%; height: auto; aspect-ratio: 1; border: 6px solid var(--paper); border-radius: 50%; }
.candid-caption { font-size: clamp(1.6rem, 5vw, 3rem); line-height: 1.18; letter-spacing: -.01em; }
.season { color: #65755a; font-size: 11px; }
.people { justify-content: flex-end; }
.people-copy { display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.people-copy h2 { color: var(--sage-light); }
.people-copy p { font-size: clamp(1.8rem, 5vw, 3.8rem); line-height: 1.15; text-wrap: pretty; }
.people-copy em { color: var(--accent-light); }
.small-things { gap: 32px; text-align: center; padding-block: 64px; }
.small-things h2, .story h2 { color: #65755a; }
.small-things ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.small-things li { font-size: clamp(1.6rem, 5vw, 4rem); line-height: 1.2; text-wrap: balance; }
.small-things li + li::before { content: ""; display: block; width: 8px; height: 8px; margin: 0 auto 24px; border-radius: 50%; background: var(--sage-light); }
.small-things li:last-child { color: var(--accent); font-style: italic; }
.story { gap: 20px; padding-block: 56px; }
.story-photo { width: 60%; max-width: 230px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; margin: 0 auto 8px; border-radius: 48% 52% 44% 56% / 58% 42% 58% 42%; }
.story p { font-size: clamp(1.05rem, 3.4vw, 1.8rem); line-height: 1.5; text-wrap: pretty; }
.story .signature { font-style: italic; color: var(--accent); }
/* Classic-template media layouts, using the preview's paper and forest palette. */
.audio-layout { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(22px, 4vh, 40px); max-width: 820px; margin-inline: auto; width: 100%; }
.bark { align-items: center; }
.bark h2 { font-family: "EB Garamond", Georgia, serif; font-weight: 400; font-size: clamp(3.4rem, 9.5vw, 8.5rem); line-height: .95; letter-spacing: -.01em; }
.bark h2 em { color: var(--accent); }
.audio-play { position: relative; flex-shrink: 0; width: clamp(80px, 9vw, 112px); height: clamp(80px, 9vw, 112px); padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; transition: transform .4s ease; }
.audio-play:hover { transform: scale(1.04); }
.audio-play:active { transform: scale(.97); }
.audio-play svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.audio-track { fill: none; stroke: var(--sage); stroke-opacity: .65; stroke-width: 1; }
.audio-progress { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .25s linear; }
.audio-triangle, .audio-dot { position: absolute; left: 50%; top: 50%; background: currentColor; transition: opacity .3s, transform .4s ease; }
.audio-triangle { width: 22%; height: 22%; transform: translate(-46%, -50%); clip-path: polygon(8% 0, 100% 50%, 8% 100%); }
.audio-dot { width: 14%; height: 14%; border-radius: 50%; transform: translate(-50%, -50%) scale(0); opacity: 0; }
.audio-play.is-playing .audio-triangle { opacity: 0; transform: translate(-46%, -50%) scale(.6); }
.audio-play.is-playing .audio-dot { opacity: 1; transform: translate(-50%, -50%); animation: audio-pulse 1.6s ease-in-out infinite; }
@keyframes audio-pulse { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }
.audio-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: .5em 1.4em; color: #65755a; }
.audio-meta b { color: var(--accent); font-weight: 600; }
.film { padding: 0; align-items: center; background: var(--paper); color: var(--ink); }
.film-frame { position: relative; width: 100%; aspect-ratio: 2.35 / 1; max-height: 100svh; overflow: hidden; background: #000; color: var(--paper); }
.film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-grain, .film-vignette, .film-fade { position: absolute; inset: 0; pointer-events: none; }
.film-grain { opacity: .1; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"); }
.film-vignette { background: radial-gradient(ellipse at center, transparent 50%, rgb(28 36 30 / 55%) 100%); }
.film-fade { background: #000; opacity: 0; transition: opacity 1s ease; }
.film-fade.is-visible { opacity: 1; }
.film-slate { position: absolute; left: clamp(18px, 3vw, 40px); right: clamp(18px, 3vw, 40px); bottom: clamp(14px, 2.4vw, 30px); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: clamp(8px, 2.1vw, 12px); letter-spacing: .12em; text-shadow: 0 1px 4px #000; }
.film-slate p { display: flex; flex-wrap: wrap; gap: .25em 1.2em; }
.film-slate p span + span { opacity: .7; }
.film-sound { flex-shrink: 0; min-height: 44px; padding: 8px clamp(10px, 2vw, 18px); border: 1px solid var(--sage-light); border-radius: 999px; background: rgb(28 36 30 / 40%); color: var(--sage-light); font: inherit; text-transform: uppercase; letter-spacing: inherit; }
.film-toggle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border: 1px solid var(--sage-light); border-radius: 50%; background: rgb(28 36 30 / 65%); color: var(--paper); font-family: Arial, sans-serif; font-size: 16px; }
.film-frame.is-playing .film-toggle { opacity: 0; }
.film-frame:hover .film-toggle, .film-toggle:focus-visible { opacity: 1; }
.media-status { max-width: 34ch; margin: 0 auto; font-family: "Karla", Arial, sans-serif; font-size: 14px; line-height: 1.5; text-align: center; }
.film > .media-status { position: absolute; bottom: 24px; left: 24px; right: 24px; }
.closing { display: grid; grid-template-rows: minmax(min-content, 1fr) auto; gap: clamp(12px, 3vh, 24px); text-align: center; padding: clamp(20px, 5vw, 28px); }
.closing::after { background: linear-gradient(180deg, rgb(28 36 30 / 35%) 40%, rgb(28 36 30 / 82%)); }
.closing-copy { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2.8vh, 20px); }
.closing h2 { font-weight: 400; font-style: italic; font-size: clamp(2rem, 10vw, 4rem); line-height: 1.08; letter-spacing: -.025em; color: var(--gold); }
.closing-copy > p { color: var(--sage-light); font-size: clamp(9px, 2.5vw, 12px); }
.restart { min-height: 44px; display: inline-flex; align-items: center; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.closing .restart { font-size: clamp(9px, 2.5vw, 11px); }
.share-button { max-width: 100%; min-height: 44px; padding: 10px 18px; border: 1px solid var(--sage-light); border-radius: 999px; background: transparent; color: var(--sage-light); font-size: clamp(9px, 2.4vw, 11px); letter-spacing: .16em; transition: background-color .25s, color .25s; }
.share-button:hover { background: var(--sage-light); color: var(--ink); }
.share-button:disabled { cursor: wait; }
.closing .share-button { border-color: var(--gold); color: var(--gold); }
.closing .share-button:hover { background: var(--gold); color: var(--ink); }
.closing-footer { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 115px); gap: 12px; align-items: end; width: 100%; }
.dedication { min-width: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; padding-bottom: 4px; }
.dedication .caps { font-size: clamp(7px, 1.8vw, 9px); letter-spacing: .16em; color: rgb(243 238 228 / 75%); }
.family { font-family: "Pinyon Script", cursive; font-style: normal; font-weight: 400; font-size: clamp(1.25rem, 5.5vw, 1.9rem); line-height: 1.15; color: var(--gold); }
.kept { margin-top: 6px; }
.hug { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hug-button { position: relative; display: grid; place-items: center; width: clamp(48px, 12vw, 64px); height: clamp(48px, 12vw, 64px); padding: 0; border: 0; border-radius: 50%; color: var(--sage-light); background: transparent; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hug-button svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.hug-track { fill: none; stroke: var(--sage-light); stroke-opacity: .45; stroke-width: 1.5; }
.hug-progress { fill: none; stroke: var(--accent-light); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hug-initials { font-size: clamp(13px, 3.5vw, 18px); letter-spacing: .06em; transition: transform .3s; }
.hug-button.is-holding .hug-initials { transform: scale(1.12); }
.hug-button.is-complete .hug-initials { color: var(--accent-light); }
.hug-status { min-height: 2.8em; font-size: clamp(7px, 1.8vw, 9px); letter-spacing: .13em; color: rgb(243 238 228 / 80%); text-align: right; }
.hug-form { position: absolute; right: 0; bottom: calc(100% + 12px); width: min(260px, 100%); padding: 16px; border: 1px solid var(--sage-light); border-radius: 14px; background: #263429; box-shadow: 0 8px 32px rgb(0 0 0 / 25%); text-align: left; }
.hug-form label { display: block; margin-bottom: 8px; font-style: italic; font-size: 15px; }
.hug-form input { width: 100%; min-width: 0; padding: 8px 0; border: 0; border-bottom: 1px solid var(--sage); background: transparent; color: white; font-size: 16px; }
.hug-form input::placeholder { color: rgb(243 238 228 / 65%); }
.hug-form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.hug-form button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 6px; color: var(--sage-light); background: transparent; font-family: "Karla", Arial, sans-serif; font-size: 13px; }
.hug-names { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hug-names span { position: absolute; color: var(--paper); font-style: italic; font-size: clamp(14px, 3.5vw, 20px); opacity: 0; animation: hug-name 6s ease-in-out both; }
@keyframes hug-name { 0%, 100% { opacity: 0; transform: translateY(8px); } 35%, 65% { opacity: .6; transform: translateY(0); } }
.preview-toast { position: absolute; z-index: 4; left: 20px; right: 20px; top: 20px; padding: 12px 16px; border: 1px solid var(--sage-light); border-radius: 12px; color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.4; text-align: center; }
.share-dialog { width: min(360px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--sage); border-radius: 16px; background: var(--paper); color: var(--ink); }
.share-dialog::backdrop { background: rgb(28 36 30 / 65%); }
.share-dialog form { display: flex; flex-direction: column; gap: 16px; }
.share-dialog h2 { font-size: 24px; font-weight: 400; }
.share-dialog input { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--sage); border-radius: 6px; font-size: 16px; }
.share-dialog .share-button { color: var(--ink); }

/* With JavaScript, each gesture dissolves into the next moment, like the mockup.
   Without it, the same content remains readable as an ordinary scrolling page. */
.preview-progress { display: none; }
html.preview-enhanced, .preview-enhanced body { height: 100%; overflow: hidden; scroll-behavior: auto; }
.preview-enhanced main { position: relative; height: 100%; isolation: isolate; z-index: 0; }
.preview-enhanced .preview-progress { display: block; position: fixed; inset: 0 0 auto; z-index: 3; height: 3px; background: rgb(47 58 50 / 8%); pointer-events: none; }
.preview-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--accent)); transform-origin: left; transition: transform .7s ease; }
.preview-enhanced .moment { position: absolute; inset: 0; min-height: 0; height: 100%; overflow: auto; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: var(--sage-light) transparent; visibility: hidden; opacity: 0; transform: scale(1.02); justify-content: safe center; transition: opacity 1s ease, transform 1.5s cubic-bezier(.22, .8, .2, 1), visibility 0s linear 1s; }
.preview-enhanced .moment > * { flex-shrink: 0; }
/* Reserve horizontal swipes for page turns; retain passage scrolling and zoom. */
.preview-enhanced .moment { touch-action: pan-y pinch-zoom; }
@media (any-pointer: coarse) {
  /* Contain touch scrolling at both the passage and iframe document boundaries. */
  html.preview-enhanced, .preview-enhanced body, .preview-enhanced .moment { overscroll-behavior-y: contain; }
}
.preview-enhanced .moment.is-active { visibility: visible; opacity: 1; transform: none; transition: opacity 1s ease, transform 1.5s cubic-bezier(.22, .8, .2, 1); }
.preview-enhanced .moment.is-leaving { visibility: visible; opacity: 1; transform: none; transition: none; }
.preview-enhanced .moment.is-fading { visibility: visible; opacity: 0; transform: scale(1.02); transition: opacity 1s ease, transform 1.5s cubic-bezier(.22, .8, .2, 1); }
.preview-enhanced .moment:focus { outline: none; }
.preview-enhanced .cover, .preview-enhanced .people { justify-content: safe flex-end; }
.preview-enhanced .story { justify-content: flex-start; }
.preview-enhanced .photo-pair { max-width: min(440px, 56svh); }
.preview-enhanced .candids { gap: 20px; padding-block: 32px; }
.preview-enhanced .small-things { gap: 24px; padding-block: 32px; }
.preview-enhanced .closing { display: grid; align-items: stretch; justify-content: stretch; }
.preview-enhanced .film { padding: 0; }
/* The homepage iframe is short on phones; keep the quote and controls together. */
@media (max-height: 440px) {
}
@media (max-width: 480px) {
  .film-toggle { top: 26%; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Match the mockup's stagger; reset only after the outgoing page has faded. */
  .preview-enhanced .small-things li { opacity: 0; transform: translateY(20px); }
  .preview-enhanced .small-things:is(.is-active, .is-leaving, .is-fading) li {
    opacity: 1;
    transform: none;
    transition: opacity 1.2s cubic-bezier(.22, .8, .2, 1), transform 1.2s cubic-bezier(.22, .8, .2, 1);
  }
  .preview-enhanced .small-things:is(.is-active, .is-leaving, .is-fading) li:nth-child(1) { transition-delay: .2s; }
  .preview-enhanced .small-things:is(.is-active, .is-leaving, .is-fading) li:nth-child(2) { transition-delay: 1.1s; }
  .preview-enhanced .small-things:is(.is-active, .is-leaving, .is-fading) li:nth-child(3) { transition-delay: 2.1s; }
}
@media (max-width: 340px) {
  .moment { padding-inline: 24px; }
  .name-badge { top: 28px; left: 28px; }
  .cover-copy { gap: 16px; padding-bottom: 64px; }
  .scroll-cue { bottom: 14px; }
  .closing { padding: 20px; }
  .closing-footer { grid-template-columns: minmax(0, 1fr) 84px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .preview-progress span { transition: none; }
  .preview-enhanced .moment, .preview-enhanced .moment:is(.is-active, .is-leaving, .is-fading) { transition: none; }
  .hug-initials, .share-button { transition: none; }
  .hug-names span { animation: none; }
  .audio-play, .audio-triangle, .audio-dot, .audio-progress, .film-fade { transition: none; }
  .audio-play.is-playing .audio-dot { animation: none; }
}
