/* ============================================================
   ELITE WEB INVITES — CINEMATIC STYLESHEET
   ============================================================ */

:root {
    --primary: #6E1423;
    --secondary: #C9A961;
    --accent: #F2CB6E;
    --background: #FBF3E3;
    --ink: #241109;
    --ink-soft: #6b6b6b;
    --ink-faint: #9a9a9a;
    /* Auto-adjusting variants: derived from --ink/--background so they stay
       readable regardless of which theme preset (light or dark) is active. */
    --ink-soft: color-mix(in srgb, var(--ink) 68%, var(--background) 32%);
    --ink-faint: color-mix(in srgb, var(--ink) 46%, var(--background) 54%);
    --white: #ffffff;
    --accent-glow: 246,197,102;

    --font-display: 'Playfair Display', 'Cormorant Garamond', serif;
    --font-script: 'Cormorant Garamond', serif;
    --font-body: 'Poppins', sans-serif;

    --ease-lux: cubic-bezier(.22,.61,.36,1);
    --dur-slow: 1400ms;
    --dur-med: 800ms;
    --dur-fast: 400ms;
}

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

html { scroll-behavior: auto; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   AMBIENT PARTICLE CANVAS
   ============================================================ */
.ambient-canvas {
    position: fixed;
    inset: 0;
    z-index: 45;
    pointer-events: none;
    width: 100vw;
    height: 100vh;
    mix-blend-mode: screen;
}

/* ============================================================
   SHIMMER TEXT — gold-foil sweep
   ============================================================ */
[data-shimmer] {
    background: linear-gradient(100deg,
        var(--primary) 30%,
        rgba(var(--accent-glow),1) 45%,
        #fff 50%,
        rgba(var(--accent-glow),1) 55%,
        var(--primary) 70%);
    background-size: 260% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    animation: shimmerSweep 5s linear infinite;
}
@keyframes shimmerSweep {
    0% { background-position: 0% 50%; }
    100% { background-position: -260% 50%; }
}

/* Letter-cascade for hero names — waits for the reveal system's .in-view */
.letters-wrap { display: inline-flex; perspective: 400px; }
.letters-wrap .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(.5em) rotateX(-40deg);
}
.in-view.letters-wrap .letter {
    animation: letterIn 700ms var(--ease-lux) forwards;
    animation-delay: calc(var(--i) * 45ms);
}
@keyframes letterIn {
    to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* ============================================================
   GATE SCENE
   ============================================================ */

.gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 30%, rgba(var(--accent-glow),.18), transparent 60%),
        var(--background);
    transition: opacity var(--dur-slow) var(--ease-lux), visibility var(--dur-slow) var(--ease-lux);
}
[data-style="cinematic"] .gate { background: radial-gradient(circle at 50% 35%, rgba(var(--accent-glow),.14), transparent 60%), var(--background); }

/* Royal — faint parchment/laid-paper texture, like traditional card stock */
[data-style="royal"] .gate {
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,.015) 0px, transparent 1px, transparent 2px, rgba(0,0,0,.015) 3px),
        radial-gradient(circle at 50% 30%, rgba(var(--accent-glow),.18), transparent 60%);
    background-color: var(--background);
}

.gate.gate-closed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Cinematic letterbox bars — pull back like a curtain opening */
.gate::before, .gate::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 0;
    background: #000;
    z-index: 2;
    transition: height 900ms var(--ease-lux);
}
[data-style="cinematic"] .gate::before { top: 0; height: 9vh; }
[data-style="cinematic"] .gate::after { bottom: 0; height: 9vh; }
[data-style="cinematic"] .gate.gate-closed::before,
[data-style="cinematic"] .gate.gate-closed::after { height: 0; }

.gate-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(var(--accent-glow),.3), transparent 55%);
    animation: gateGlow 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gateGlow {
    0%, 100% { opacity: .6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.gate-frame {
    position: relative;
    width: min(90vw, 420px);
    padding: 64px 32px;
    text-align: center;
    border: 1px solid rgba(var(--accent-glow),.4);
    box-shadow: 0 0 0 1px rgba(var(--accent-glow),.08), 0 30px 80px -20px rgba(var(--accent-glow),.35);
    animation: gateIn 1200ms var(--ease-lux) both;
    z-index: 3;
}
[data-style="editorial"] .gate-frame { border: 3px solid var(--ink); box-shadow: 10px 10px 0 0 rgba(var(--accent-glow),1); }
[data-style="cinematic"] .gate-frame { border-color: rgba(var(--accent-glow),.28); }

@keyframes gateIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.gate-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--accent);
    transition: width 900ms var(--ease-lux), height 900ms var(--ease-lux);
}
.gate-corner.tl { top:-8px; left:-8px; border-right:none; border-bottom:none; }
.gate-corner.tr { top:-8px; right:-8px; border-left:none; border-bottom:none; }
.gate-corner.bl { bottom:-8px; left:-8px; border-right:none; border-top:none; }
.gate-corner.br { bottom:-8px; right:-8px; border-left:none; border-top:none; }
[data-style="royal"] .gate-frame:hover .gate-corner,
[data-style="royal"] .gate-corner { width: 38px; height: 38px; }
[data-style="editorial"] .gate-corner { display: none; }

/* Wax seal — small emblem above the eyebrow, like a traditional envelope seal */
.gate-seal {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 32% 28%, rgba(var(--accent-glow),.9), var(--primary) 70%);
    box-shadow:
        0 6px 16px -4px rgba(0,0,0,.35),
        inset 0 2px 3px rgba(255,255,255,.35),
        inset 0 -3px 5px rgba(0,0,0,.25);
    position: relative;
}
.gate-seal::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-glow),.35);
}
.gate-seal span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,.4);
    letter-spacing: .5px;
}
[data-style="editorial"] .gate-seal { border-radius: 4px; background: var(--ink); box-shadow: 4px 4px 0 0 rgba(var(--accent-glow),1); }
[data-style="editorial"] .gate-seal::before { display: none; }

.gate-eyebrow {
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 18px;
    font-weight: 600;
}
[data-style="cinematic"] .gate-eyebrow { color: rgba(244,241,233,.55); }

.gate-names {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(34px, 9vw, 46px);
    letter-spacing: .2px;
    margin-bottom: 24px;
    line-height: 1.15;
    color: var(--primary);
}
[data-style="cinematic"] .gate-names { color: var(--ink); }

.gate-amp {
    color: var(--accent);
    font-style: italic;
    margin: 0 10px;
    font-size: .7em;
    vertical-align: middle;
}

.gate-line {
    position: relative;
    width: 70px;
    height: 2px;
    background: rgba(var(--accent-glow),.25);
    margin: 0 auto 22px;
    overflow: hidden;
}
.gate-line-fill {
    position: absolute; inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    animation: lineFill 1200ms var(--ease-lux) 300ms both;
}
@keyframes lineFill { to { transform: scaleX(1); } }

.gate-date {
    font-size: 15px;
    letter-spacing: 2px;
    color: var(--ink-soft);
    margin-bottom: 38px;
    font-weight: 500;
}
[data-style="cinematic"] .gate-date { color: rgba(244,241,233,.65); }

.gate-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 17px 36px;
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 26px -10px rgba(var(--accent-glow),.55);
    transition: background var(--dur-fast) var(--ease-lux), color var(--dur-fast) var(--ease-lux), transform var(--dur-fast) var(--ease-lux), box-shadow var(--dur-fast) var(--ease-lux);
}
[data-style="editorial"] .gate-button { border-radius: 0; background: var(--ink); border-color: var(--ink); }
[data-style="cinematic"] .gate-button { background: var(--accent); border-color: var(--accent); color: #171208; }
[data-style="cinematic"] .gate-button:hover { background: transparent; color: var(--accent); }
.gate-button:active { transform: scale(.97); }
.gate-button:hover { background: transparent; color: var(--primary); transform: translateY(-2px); }
[data-style="cinematic"] .gate-button:hover { color: var(--accent); }

/* ============================================================
   EXPERIENCE — SCENE CONTAINER
   ============================================================ */

.experience {
    height: 100vh;
    height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y proximity;
    scrollbar-width: none;
}
.experience::-webkit-scrollbar { display:none; }

.scene {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    overflow: hidden;
}

/* Subtle per-scene warmth so the page reads as a sequence of distinct
   "rooms" rather than one long flat-white scroll. Kept very light —
   hero/final are full-bleed photos (no tint needed), countdown/gallery
   stay closer to flat background for contrast against the warmer scenes. */
.scene-invitation { background: linear-gradient(180deg, rgba(var(--accent-glow),.05) 0%, var(--background) 100%); }
.scene-story { background: linear-gradient(180deg, var(--background) 0%, rgba(var(--accent-glow),.06) 50%, var(--background) 100%); }
.scene-venue { background: linear-gradient(180deg, rgba(var(--accent-glow),.04) 0%, var(--background) 100%); }
.scene-events { background: linear-gradient(180deg, var(--background) 0%, rgba(var(--accent-glow),.03) 100%); }

.scene-kicker {
    position: relative;
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 32px;
    text-align: center;
    padding-bottom: 14px;
}
.scene-kicker::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 2px;
    background: var(--accent);
}
[data-style="editorial"] .scene-kicker { color: var(--ink); background: rgba(var(--accent-glow),1); padding: 6px 16px 6px; }
[data-style="editorial"] .scene-kicker::after { display: none; }

/* Reveal system — driven by JS adding .in-view */
[data-reveal] { opacity: 0; }
.in-view[data-reveal="fade"] {
    animation: revealFade var(--dur-med) var(--ease-lux) forwards;
}
.in-view[data-reveal="rise"] {
    animation: revealRise var(--dur-med) var(--ease-lux) forwards;
}
.in-view[data-reveal="scale"] {
    animation: revealScale var(--dur-med) var(--ease-lux) forwards;
}
.in-view[data-reveal="crossfade"] {
    animation: revealFade var(--dur-slow) var(--ease-lux) forwards;
}
.in-view[data-reveal="mask"] {
    animation: revealMask var(--dur-slow) var(--ease-lux) forwards;
}
.in-view[data-reveal="zoom"] {
    animation: revealZoom 2600ms var(--ease-lux) forwards;
}

@keyframes revealFade { from{opacity:0;} to{opacity:1;} }
@keyframes revealRise { from{opacity:0; transform:translateY(24px);} to{opacity:1; transform:translateY(0);} }
@keyframes revealScale { from{opacity:0; transform:scale(.85);} to{opacity:1; transform:scale(1);} }
@keyframes revealMask {
    from { opacity:0; clip-path: inset(0 0 100% 0); }
    to   { opacity:1; clip-path: inset(0 0 0% 0); }
}
@keyframes revealZoom {
    from { opacity:0; transform: scale(1.15); }
    to   { opacity:1; transform: scale(1); }
}

[data-reveal] { animation-delay: var(--delay, 0ms); }

/* ============================================================
   SCENE NAV
   ============================================================ */

.scene-nav {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.scene-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--accent-glow),.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background var(--dur-fast), transform var(--dur-fast);
}
.scene-nav-dot.active {
    background: var(--accent);
    transform: scale(1.5);
}

/* ============================================================
   PROGRESS THREAD — thin gold line, left edge, reflects position
   from ANY navigation method. Purely reflective, never interactive,
   never drives anything itself.
   ============================================================ */

.progress-thread {
    position: fixed;
    left: 14px;
    top: 18%;
    bottom: 18%;
    width: 2px;
    background: rgba(var(--accent-glow), .12);
    border-radius: 2px;
    overflow: hidden;
    z-index: 55;
    opacity: 0;
    transition: opacity 600ms ease;
}
.progress-thread.visible { opacity: 1; }
.progress-thread-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--accent), rgba(var(--accent-glow), .5));
    transition: height 150ms linear;
}

/* ============================================================
   RESUME PILL — appears only after the guest interacts once and
   then goes idle. Tapping it is the ONLY way auto-progress resumes;
   it never resumes on its own.
   ============================================================ */

.resume-pill {
    position: fixed;
    left: 50%;
    bottom: 84px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: rgba(20, 14, 10, .82);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-glow), .45);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 500ms ease, transform 500ms ease;
}
.resume-pill.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.resume-pill span { font-size: 11px; }

/* ============================================================
   MUSIC CONTROL
   ============================================================ */

.music-control {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 60;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-glow),.5);
    background: rgba(var(--accent-glow),.12);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px -8px rgba(var(--accent-glow),.5);
}
.music-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: musicPulse 1.6s ease-in-out infinite;
}
.music-control.paused .music-dot { animation: none; opacity: .4; }
@keyframes musicPulse {
    0%,100% { transform: scale(1); opacity:1; }
    50% { transform: scale(1.5); opacity:.5; }
}

/* ============================================================
   HERO SCENE
   ============================================================ */

.scene-hero { padding: 0; }

.hero-photo-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.15);
    filter: sepia(.05) saturate(1.1) contrast(1.03);
    transition: transform 3000ms var(--ease-lux);
    will-change: transform;
}
.hero-photo.in-view { transform: scale(1); }
.hero-photo-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.1) 35%, rgba(0,0,0,.55) 100%);
}
/* Very subtle film-grain texture — filmic/editorial quality rather than
   a flat phone-screenshot look. Kept near-invisible (opacity .04). */
.hero-photo-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
[data-style="editorial"] .hero-photo-veil { background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, transparent 40%, rgba(0,0,0,.7) 100%); }
[data-style="cinematic"] .hero-photo-veil { background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.2) 30%, rgba(0,0,0,.8) 100%); }

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: auto;
    margin-bottom: 8vh;
}

.hero-subtitle {
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    margin-bottom: 18px;
    font-weight: 500;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.hero-names {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(52px, 17vw, 118px);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    filter: drop-shadow(0 4px 30px rgba(0,0,0,.45));
}
.hero-name { color: #fff; }
.hero-amp {
    color: var(--accent);
    font-style: italic;
    font-size: .55em;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.hero-date {
    margin-top: 20px;
    font-size: 15px;
    letter-spacing: 3px;
    color: rgba(255,255,255,.85);
    font-weight: 500;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.scroll-hint {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.scroll-hint span {
    display: block;
    width: 1px;
    height: 34px;
    background: linear-gradient(180deg, var(--accent), transparent);
    animation: hintMove 2s ease-in-out infinite;
}
@keyframes hintMove {
    0% { transform: translateY(-6px); opacity:0; }
    40% { opacity:1; }
    100% { transform: translateY(10px); opacity:0; }
}

/* ============================================================
   INVITATION (STATIONERY) SCENE
   ============================================================ */

.stationery {
    max-width: 580px;
    text-align: center;
    padding: 56px 40px;
    border: 1px solid rgba(var(--accent-glow),.4);
    box-shadow: 0 40px 90px -40px rgba(var(--accent-glow),.5), 0 0 0 1px rgba(var(--accent-glow),.06);
    background: rgba(255,255,255,.4);
    backdrop-filter: blur(2px);
    position: relative;
}
[data-style="cinematic"] .stationery { background: rgba(255,255,255,.03); border-color: rgba(var(--accent-glow),.3); }
[data-style="editorial"] .stationery { border: 3px solid var(--ink); box-shadow: 12px 12px 0 0 rgba(var(--accent-glow),1); background: var(--background); backdrop-filter: none; }
.stationery-kicker {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: clamp(28px, 6vw, 38px);
    color: var(--primary);
    margin-bottom: 18px;
}
[data-style="cinematic"] .stationery-kicker { color: var(--accent); }
.stationery-rule {
    width: 50px;
    height: 2px;
    background: var(--accent);
    margin: 20px auto;
}
.stationery-text p {
    font-size: 17px;
    line-height: 2;
    color: var(--ink);
    margin-bottom: 14px;
}
.stationery-text p:last-child { margin-bottom: 0; }

/* ============================================================
   COUNTDOWN SCENE
   ============================================================ */

.countdown-grid {
    display: flex;
    gap: clamp(16px, 5vw, 40px);
    flex-wrap: wrap;
    justify-content: center;
}
.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 64px;
}
.countdown-unit {
    padding: 18px 6px 14px;
    border-bottom: 2px solid rgba(var(--accent-glow),.4);
}
.countdown-number {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(48px, 13vw, 84px);
    color: var(--primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: opacity 250ms ease, transform 250ms ease;
    text-shadow: 0 0 30px rgba(var(--accent-glow),.35);
}
[data-style="cinematic"] .countdown-number { color: var(--accent); }
.countdown-number.tick {
    animation: tickPulse 420ms var(--ease-lux);
}
@keyframes tickPulse {
    0% { opacity:.4; transform: translateY(-4px); }
    100% { opacity:1; transform: translateY(0); }
}
.countdown-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ============================================================
   EVENTS TIMELINE
   ============================================================ */

.events-timeline {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.event-item {
    text-align: center;
    padding: 20px 0;
}
.event-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}
[data-style="cinematic"] .event-name { color: var(--accent); }
.event-meta {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--ink-soft);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.event-venue {
    font-size: 13px;
    color: var(--ink-faint);
    margin-bottom: 4px;
}
.event-desc {
    font-size: 13px;
    font-style: italic;
    color: var(--ink-soft);
    max-width: 340px;
    margin: 6px auto 0;
}
.event-divider {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 6px 0;
}
.event-divider svg { display:block; }
.event-divider path {
    stroke: var(--accent);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: stroke-dashoffset 900ms var(--ease-lux);
}
.event-divider.in-view path { stroke-dashoffset: 0; }

/* ============================================================
   STORY SCENE
   ============================================================ */

.story-intro {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
    color: var(--ink-soft);
    text-align: center;
    max-width: 440px;
    margin-bottom: 40px;
}
.story-milestones {
    display: flex;
    flex-direction: column;
    gap: 48px;
    width: 100%;
    max-width: 420px;
}
.milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.milestone-photo {
    width: 220px;
    height: 280px;
    object-fit: cover;
    margin-bottom: 18px;
    border-radius: 6px;
    clip-path: inset(0 0 100% 0);
    box-shadow: 0 24px 54px -26px rgba(var(--accent-glow), .55);
    filter: sepia(.06) saturate(1.08) contrast(1.03);
    transition: clip-path 1100ms var(--ease-lux);
}
.in-view .milestone-photo { clip-path: inset(0 0 0% 0); }

/* Break centered symmetry on wider screens: photo + text sit side by
   side, alternating which side the photo is on. Mobile (the primary
   target) stays exactly as before — safe, no risk to small screens. */
@media (min-width: 640px) {
    .story-milestones { max-width: 620px; }
    .milestone {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 32px;
    }
    .milestone-reverse { flex-direction: row-reverse; text-align: right; }
    .milestone-photo { margin-bottom: 0; flex-shrink: 0; }
    .milestone-text-block { flex: 1; }
}
.milestone-date {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 8px;
}
.milestone-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink);
    max-width: 320px;
}
.story-closing {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    color: var(--primary);
    text-align: center;
    margin-top: 40px;
}

/* ============================================================
   VENUE SCENE
   ============================================================ */

.venue-photo-wrap {
    width: 100%;
    max-width: 480px;
    height: 280px;
    overflow: hidden;
    margin-bottom: 28px;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1200ms var(--ease-lux);
    box-shadow: 0 30px 70px -30px rgba(var(--accent-glow),.6);
}
.venue-photo-wrap.in-view { clip-path: inset(0 0 0% 0); }
.venue-photo { width:100%; height:100%; object-fit:cover; filter: sepia(.06) saturate(1.08) contrast(1.03); }

/* Full-bleed on small phones — one more edge-to-edge photo moment,
   breaking out of the scene's normal side padding. */
@media (max-width: 639px) {
    .venue-photo-wrap {
        max-width: none;
        width: calc(100% + 48px);
        margin-left: -24px;
        margin-right: -24px;
        height: 240px;
    }
}

.venue-info { text-align: center; max-width: 420px; }
.venue-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(30px, 6vw, 42px);
    margin: 6px 0 10px;
    position: relative;
    display: inline-block;
}
.venue-name::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: width 900ms var(--ease-lux) 200ms;
}
.in-view .venue-name::after { width: 44px; }
.venue-address {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.7;
    margin-bottom: 22px;
}
.venue-button {
    display: inline-block;
    padding: 12px 26px;
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: background var(--dur-fast), color var(--dur-fast);
}
.venue-button:hover { background: var(--primary); color: var(--white); }
[data-style="cinematic"] .venue-button { border-color: var(--accent); color: var(--accent); }
[data-style="cinematic"] .venue-button:hover { background: var(--accent); color: #171208; }

/* Break centered symmetry on wider screens, mirroring the story
   milestones treatment — text shifts left-aligned, underline follows.
   Mobile (360-430px, the primary target) is untouched. */
@media (min-width: 640px) {
    .venue-info { text-align: left; }
    .venue-name::after { left: 0; transform: none; }
}

/* Always visible — kept visually secondary (compact height, quiet
   border) so the photo/name/address stay the focus of the scene,
   per the original "map should be secondary, not a giant iframe" intent. */
.venue-map-frame {
    margin-top: 28px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 2px;
    overflow: hidden;
    opacity: .92;
}
.venue-map-frame iframe { display: block; }

/* ============================================================
   GALLERY — editorial asymmetric grid
   ============================================================ */

.gallery-grid {
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 90px;
    gap: 8px;
}
.gallery-item {
    overflow: hidden;
    cursor: pointer;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 900ms var(--ease-lux), transform 150ms var(--ease-lux);
}
.gallery-item.in-view { clip-path: inset(0 0 0% 0); }
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(.05) saturate(1.06) contrast(1.02);
    transition: transform 700ms var(--ease-lux);
}
.gallery-item { position: relative; box-shadow: 0 18px 40px -22px rgba(var(--accent-glow),.5), 0 0 0 1px rgba(var(--accent-glow),.15); }
.gallery-item::after {
    content: '';
    position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgba(var(--accent-glow),.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 300ms ease;
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item:active { transform: scale(.97); }

.gallery-item:nth-child(6n+1) { grid-column: span 4; grid-row: span 3; }
.gallery-item:nth-child(6n+2) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(6n+3) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(6n+4) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(6n+5) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(6n+0) { grid-column: span 4; grid-row: span 2; }

/* ============================================================
   FINAL SCENE
   ============================================================ */

.scene-final { padding: 0; }
.final-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(.05) saturate(1.1) contrast(1.03);
}
.final-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.65) 100%);
}
.scene-final::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.final-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 0 24px;
}
.final-names {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 9vw, 56px);
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-shadow: 0 4px 30px rgba(0,0,0,.5);
}
/* Always sits over a dark photo veil regardless of theme — force a white-based shimmer */
.final-names[data-shimmer] {
    background: linear-gradient(100deg, #fff 30%, rgba(var(--accent-glow),1) 45%, #fff 50%, rgba(var(--accent-glow),1) 55%, #fff 70%);
    background-size: 260% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: shimmerSweep 5s linear infinite;
}
.final-message {
    font-size: 16px;
    letter-spacing: .5px;
    opacity: .95;
    margin-bottom: 10px;
}
.final-date {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: .75;
}
.final-mark {
    margin-top: 20px;
    color: var(--accent);
    font-size: 18px;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-image { max-width: 92vw; max-height: 88vh; object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.lightbox-close {
    position: absolute; top: 18px; right: 18px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(var(--accent-glow),.35);
    border-radius: 50%;
    color: var(--accent);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}
.lightbox-close:hover { background: rgba(var(--accent-glow),.18); transform: rotate(90deg); }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(var(--accent-glow),.3);
    border-radius: 50%;
    color: var(--accent);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}
.lightbox-nav:hover { background: rgba(var(--accent-glow),.18); }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox-nav.next { right: 12px; }
.lightbox-nav.next:hover { transform: translateY(-50%) translateX(2px); }

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
    .experience { scroll-behavior: auto; }
    .hero-photo { transform: none !important; }
}

/* ============================================================
   MOBILE REFINEMENT
   ============================================================ */

@media (max-width: 480px) {
    .gate-frame { padding: 44px 20px; }
    .scene { padding: 48px 18px; }
    .gallery-grid { grid-auto-rows: 76px; }
    .stationery { padding: 36px 22px; }
}

/* ============================================================
   DESKTOP PRESENTATION
   This is an invite guests open on their phone — so above ~860px
   we stop stretching the mobile layout thin and instead present it
   as a framed, boutique object floating on a rich atmosphere.
   Applying the transform to #experience/#gate also re-anchors their
   position:fixed children (scene-nav dots, music toggle) to the
   frame instead of the browser viewport — no extra work needed.
   ============================================================ */

@media (min-width: 860px) {
    body {
        min-height: 100vh;
        background:
            radial-gradient(circle at 20% 15%, rgba(var(--accent-glow),.16), transparent 55%),
            radial-gradient(circle at 85% 85%, rgba(var(--accent-glow),.13), transparent 55%),
            var(--background);
    }
    [data-style="cinematic"] body {
        background:
            radial-gradient(circle at 20% 15%, rgba(var(--accent-glow),.1), transparent 55%),
            radial-gradient(circle at 85% 85%, rgba(var(--accent-glow),.08), transparent 55%),
            var(--background);
    }

    #gate, #experience {
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(560px, 92vw);
        height: min(920px, 92vh);
        border-radius: 22px;
        box-shadow:
            0 70px 160px -50px rgba(0,0,0,.5),
            0 0 0 1px rgba(var(--accent-glow),.3),
            0 0 90px -20px rgba(var(--accent-glow),.35);
    }
    #gate { overflow: hidden; z-index: 1000; }
    #experience { overflow-y: auto; overflow-x: hidden; }

    .scene-nav { right: 20px; }
    .music-control { bottom: 24px; right: 24px; }
    .progress-thread { left: 10px; }
    .resume-pill { bottom: 92px; }
}

.scene-final .final-content { padding-bottom: env(safe-area-inset-bottom); }
.gate-frame { margin-top: env(safe-area-inset-top); }
