:root {
    --sand-100: #f7ecd8;
    --sand-200: #ecd7b2;
    --gold-400: #c79a43;
    --terracotta-500: #a74e2a;
    --jade-700: #1f5a4f;
    --obsidian-900: #23170f;
    --ink: #2e1d13;
    --card-shadow: 0 18px 34px rgba(44, 24, 12, 0.2);
    --radius-xl: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Vollkorn', serif;
    color: var(--ink);
    background:
        linear-gradient(45deg, rgba(199, 154, 67, 0.07) 25%, transparent 25%) 0 0 / 22px 22px,
        linear-gradient(-45deg, rgba(199, 154, 67, 0.07) 25%, transparent 25%) 0 0 / 22px 22px,
        radial-gradient(circle at 10% 18%, rgba(167, 78, 42, 0.14), transparent 30%),
        radial-gradient(circle at 86% 8%, rgba(31, 90, 79, 0.14), transparent 24%),
        linear-gradient(170deg, #fbf2e2 0%, #f3e3c8 52%, #faefd9 100%);
    overflow-x: hidden;
}

body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -70px;
    background: radial-gradient(circle, rgba(167, 78, 42, 0.24), rgba(167, 78, 42, 0));
    animation: floatBlob 8s ease-in-out infinite;
}

body::after {
    width: 340px;
    height: 340px;
    bottom: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(31, 90, 79, 0.22), rgba(31, 90, 79, 0));
    animation: floatBlob 10s ease-in-out infinite reverse;
}

.yt-music-host {
    position: fixed;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
}

.yt-music-btn {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 51;
    border: 1px solid rgba(239, 203, 129, 0.8);
    border-radius: 999px;
    background: rgba(40, 22, 13, 0.9);
    color: #ffe5b0;
    padding: 0.42rem 0.78rem;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.yt-music-btn:hover {
    background: rgba(67, 35, 19, 0.95);
}

.cinematic-intro {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(199, 154, 67, 0.08) 20%, transparent 20%) 0 0 / 28px 28px,
        linear-gradient(-135deg, rgba(199, 154, 67, 0.08) 20%, transparent 20%) 0 0 / 28px 28px,
        radial-gradient(circle at 25% 20%, rgba(167, 78, 42, 0.25), transparent 38%),
        radial-gradient(circle at 70% 75%, rgba(31, 90, 79, 0.3), transparent 40%),
        linear-gradient(145deg, rgba(38, 22, 13, 0.96), rgba(74, 35, 19, 0.95));
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.cinematic-intro.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-glow {
    position: absolute;
    width: min(55vw, 520px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(231, 189, 104, 0.3), transparent 62%);
    filter: blur(12px);
    animation: pulseGlow 2.2s ease-in-out infinite;
}

.intro-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff6e6;
    padding: 1.4rem;
}

.intro-eyebrow {
    margin: 0;
    letter-spacing: 0.18rem;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.9;
}

.cinematic-intro h2 {
    margin: 0.4rem 0 0.6rem;
    color: #fff4dc;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.intro-text {
    margin: 0;
    opacity: 0.95;
}

.countdown-number {
    margin: 0.6rem 0 0.9rem;
    font-family: 'Cinzel', serif;
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 1;
    color: #f0ce8e;
    text-shadow: 0 0 24px rgba(199, 154, 67, 0.4);
}

.intro-skip-btn {
    border: 1px solid rgba(239, 203, 129, 0.65);
    background: rgba(198, 145, 63, 0.14);
    color: #fff4db;
    border-radius: 999px;
    padding: 0.52rem 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.intro-skip-btn:hover {
    background: rgba(198, 145, 63, 0.28);
}

.swal2-popup.welcome-popup {
    position: relative;
    overflow: hidden;
    width: min(92vw, 1120px) !important;
    min-height: min(88vh, 980px) !important;
    padding: 2.2rem 2rem 1.7rem !important;
    border: 2px solid rgba(238, 195, 121, 0.58);
    box-shadow: 0 22px 54px rgba(34, 18, 10, 0.45);
    background:
        linear-gradient(rgba(18, 10, 6, 0.52), rgba(18, 10, 6, 0.68)),
        url('img/welcome-bg.png') center center / contain no-repeat !important;
    background-color: #1f120c !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

.swal2-popup.welcome-popup::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(35, 20, 11, 0.15), rgba(35, 20, 11, 0.55));
    pointer-events: none;
}

.swal2-popup.welcome-popup .swal2-title,
.swal2-popup.welcome-popup .swal2-html-container {
    position: relative;
    z-index: 1;
    color: #fff2db;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.swal2-popup.welcome-popup .swal2-title {
    margin-bottom: 0.4rem;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.swal2-popup.welcome-popup .swal2-html-container {
    margin: 0 0 1rem;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
}

.swal2-popup.welcome-popup .swal2-html-container,
.swal2-popup.welcome-popup .swal2-title,
.swal2-popup.welcome-popup .swal2-actions {
    position: relative;
    z-index: 1;
}

.swal2-popup.welcome-popup .swal2-actions {
    margin-top: 0.2rem;
}

.swal2-popup.welcome-popup .swal2-icon {
    position: relative;
    z-index: 1;
}

.swal2-popup.welcome-popup .swal2-confirm {
    position: relative;
    z-index: 1;
}

.hero {
    min-height: 100vh;
    position: relative;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    background:
        url('img/header-bg.png') center 14% / contain no-repeat;
    background-color: #20140e;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(1460px, 98%);
    min-height: 78vh;
    padding: 2rem 2.4rem;
    color: #fffefc;
    animation: riseIn 0.9s ease-out;
    display: grid;
    grid-template-columns: 1fr minmax(300px, 0.72fr) 1fr;
    align-items: center;
    gap: 3rem;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.hero-side-left {
    align-items: flex-start;
    text-align: left;
    padding-left: 4rem;
}

.hero-side-right {
    align-items: flex-end;
    text-align: right;
    padding-right: 4rem;
}

.hero-center-spacer {
    min-height: 1px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    font-weight: 800;
    opacity: 0.9;
}

.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin: 0.2rem 0 0.8rem;
}

.hero-text {
    font-size: 1.15rem;
    line-height: 1.65;
}

.hero-text-left {
    max-width: 22rem;
}

.primary-btn {
    margin-top: 1.1rem;
    border: none;
    border-radius: 999px;
    background: #f2dfb9;
    color: #5a2e18;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(71, 36, 14, 0.28);
}

main {
    width: min(1120px, 92%);
    margin: 0 auto;
    padding: 2.4rem 0 4.2rem;
}

.timeline-section {
    margin-top: 2rem;
    padding: 1.6rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(130deg, rgba(248, 237, 214, 0.93), rgba(240, 221, 182, 0.9));
    border: 1px solid rgba(130, 77, 35, 0.25);
    box-shadow: var(--card-shadow);
}

.timeline-subtitle {
    margin-top: 0.45rem;
    margin-bottom: 1rem;
}

.timeline-track {
    display: grid;
    gap: 0.9rem;
}

.timeline-card {
    position: relative;
    padding: 1rem 1rem 1rem 2.1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(129, 77, 35, 0.25);
    transform: translateX(14px);
    opacity: 0;
    animation: slideMemory 0.6s ease-out forwards;
    animation-delay: calc(var(--delay) * 120ms);
}

.timeline-card h3 {
    margin: 0.3rem 0 0.35rem;
    font-family: 'Cinzel', serif;
    color: #5f2e1a;
}

.timeline-card p {
    margin: 0;
}

.timeline-dot {
    position: absolute;
    left: 0.75rem;
    top: 1.18rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--terracotta-500);
    box-shadow: 0 0 0 5px rgba(167, 78, 42, 0.2);
}

.memory-section,
.final-stop {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: rgba(255, 247, 230, 0.78);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(125, 70, 31, 0.24);
    box-shadow: var(--card-shadow);
    position: relative;
}

.memory-section::before,
.final-stop::before,
.timeline-section::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    top: 0.55rem;
    height: 10px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(167, 78, 42, 0.86) 0 10px,
            rgba(224, 179, 93, 0.95) 10px 20px,
            rgba(31, 90, 79, 0.85) 20px 30px,
            rgba(224, 179, 93, 0.95) 30px 40px
        );
}

.section-head {
    margin-bottom: 1.2rem;
}

h2 {
    margin: 0;
    font-family: 'Cinzel', serif;
    color: #5a2c18;
}

.section-head p {
    margin: 0.4rem 0;
}

.deity-tribute {
    margin-top: 0.65rem;
    display: grid;
    grid-template-columns: 66px 1fr;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(117, 66, 31, 0.3);
    border-radius: 12px;
    background: linear-gradient(110deg, rgba(255, 244, 219, 0.8), rgba(246, 226, 188, 0.72));
}

.deity-glyph {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    position: relative;
    background: linear-gradient(145deg, #5b2d18, #1f5a4f);
    border: 2px solid rgba(243, 201, 121, 0.95);
    box-shadow: inset 0 0 0 2px rgba(255, 237, 193, 0.75), 0 5px 12px rgba(49, 25, 12, 0.35);
    overflow: hidden;
}

.deity-glyph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.deity-title {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #5d2c16;
}

.deity-text {
    margin: 0.15rem 0 0;
    font-size: 0.92rem;
    color: #3a2418;
}

.floating-deities {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
}

.floating-deity {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 999px;
    background: rgba(58, 33, 18, 0.82);
    border: 1px solid rgba(229, 185, 100, 0.45);
    color: #ffecbf;
    font-size: 0.75rem;
    animation: deityFloat 7s ease-in-out infinite;
}

.floating-deity .deity-glyph {
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.floating-deity.left {
    left: 0.8rem;
    top: 38%;
}

.floating-deity.right {
    right: 0.8rem;
    top: 62%;
    animation-delay: 1.2s;
}

.card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.uncategorized-carousel {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}

.carousel-viewport {
    overflow: hidden;
    border-radius: 18px;
    border: 2px solid rgba(125, 70, 31, 0.35);
    background: rgba(66, 36, 18, 0.18);
    min-height: 62vh;
}

.carousel-track {
    display: flex;
    transition: transform 0.45s ease;
}

.carousel-slide {
    min-width: 100%;
    margin: 0;
    padding: 0.8rem;
    display: grid;
    place-items: center;
}

.uncategorized-photo {
    width: min(980px, 96%);
    height: 58vh;
    object-fit: contain;
    border-radius: 16px;
    background: #f2dfb8;
    box-shadow: 0 12px 28px rgba(43, 21, 10, 0.25);
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(239, 203, 129, 0.8);
    background: rgba(40, 22, 13, 0.9);
    color: #ffe5b0;
    font-size: 1.3rem;
    cursor: pointer;
}

.carousel-btn:hover {
    background: rgba(67, 35, 19, 0.95);
}

.memory-section[data-section='Alice'] .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 190px));
    justify-content: center;
}

.memory-section[data-section='Alice'] .flip-card-inner {
    aspect-ratio: 4 / 5;
}

.scroll-phrase {
    position: fixed;
    left: 50%;
    bottom: 1.1rem;
    transform: translateX(-50%) translateY(18px);
    width: min(860px, calc(100% - 2rem));
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    background: rgba(40, 22, 13, 0.88);
    border: 1px solid rgba(224, 179, 93, 0.48);
    box-shadow: 0 14px 28px rgba(36, 18, 8, 0.34);
    color: #fff1d7;
    text-align: center;
    z-index: 95;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.scroll-phrase.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.scroll-phrase p {
    margin: 0;
    font-weight: 700;
    line-height: 1.45;
    font-size: clamp(0.96rem, 2.2vw, 1.08rem);
}

.flip-card {
    perspective: 1200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(125, 70, 31, 0.26);
}

.flip-card:hover .flip-card-inner,
.flip-card-inner:focus,
.flip-card-inner.flipped {
    transform: rotateY(180deg) translateY(-3px);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    overflow: hidden;
    backface-visibility: hidden;
}

.flip-card-front {
    background: #fff;
}

.flip-card-back {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(145deg, #1f5a4f, #4d2615);
    color: #fff;
    transform: rotateY(180deg);
}

.memory-photo,
.final-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.final-image {
    max-height: 70vh;
    border-radius: 16px;
    margin-top: 1rem;
    object-fit: contain;
    background: #f7e7c6;
}

.rotate-180 {
    transform: rotate(180deg);
}

.rotate-90-left {
    transform: rotate(-90deg);
}

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatBlob {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(14px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.96);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(0.96);
        opacity: 0.85;
    }
}

@keyframes slideMemory {
    from {
        opacity: 0;
        transform: translateX(14px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes deityFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-9px);
    }
    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 760px) {
    .hero {
        min-height: 100vh;
        background-position: center 10%;
    }

    .hero-content {
        min-height: 100vh;
        grid-template-columns: 1fr;
        padding: 1.2rem;
        gap: 0.9rem;
    }

    .hero-side-left,
    .hero-side-right {
        align-items: center;
        text-align: center;
        padding: 0;
    }

    .hero-center-spacer {
        display: none;
    }

    .yt-music-btn {
        right: 0.6rem;
        bottom: 0.6rem;
        font-size: 0.8rem;
        padding: 0.36rem 0.65rem;
    }

    .scroll-phrase {
        bottom: 0.7rem;
        width: calc(100% - 1rem);
        padding: 0.75rem 0.8rem;
    }

    .floating-deity {
        display: none;
    }

    .deity-tribute {
        grid-template-columns: 44px 1fr;
    }

    .uncategorized-carousel {
        grid-template-columns: 1fr;
    }

    .carousel-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 3;
    }

    .carousel-btn.prev {
        left: 0.4rem;
    }

    .carousel-btn.next {
        right: 0.4rem;
    }

    .carousel-viewport {
        min-height: 46vh;
    }

    .uncategorized-photo {
        width: 100%;
        height: 42vh;
    }
}
