/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    background-color: #FDF6EC;
    color: #3D2B1F;
    overflow-x: hidden;
    line-height: 1.75;
    letter-spacing: 0.01em;
    /* Paper texture */
    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='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* === PROGRESS BAR === */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #F5A623, #E8614D, #F5A623);
    z-index: 9999;
    transition: width 50ms linear;
}

/* === TYPOGRAPHY === */
.hero-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(5rem, 16vw, 14rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3D2B1F;
    text-align: center;
    line-height: 1;
}

.hero-subtitle {
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-weight: 400;
    font-style: italic;
    color: #5C3A21;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.75;
}

.section-heading {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3D2B1F;
    text-align: center;
    margin-bottom: clamp(24px, 4vw, 48px);
}

.module-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3D2B1F;
    margin-bottom: 12px;
}

.module-text {
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-weight: 400;
    line-height: 1.75;
    color: #3D2B1F;
    margin-bottom: 12px;
}

.module-text:last-child {
    margin-bottom: 0;
}

/* === CHEVRON DIVIDER === */
.chevron-divider {
    width: 120px;
    margin: 20px auto;
}

.chevron-divider svg {
    width: 100%;
    height: auto;
}

/* === MODULE DIVIDER === */
.module-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #F5A623, transparent);
    margin-bottom: 16px;
}

/* === GRAND VESTIBULE === */
#vestibule {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(232,97,77,0.2) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 60%, rgba(245,166,35,0.18) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 80%, rgba(212,144,138,0.12) 0%, transparent 60%);
}

.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 0;
}

.sunburst span {
    position: absolute;
    width: 1px;
    height: 50vh;
    bottom: 0;
    left: 0;
    transform-origin: bottom center;
    background: linear-gradient(to top, rgba(245,166,35,0.3), transparent);
    transform: scaleY(0);
    animation: sunburst-bloom 1.2s ease-out forwards;
}

@keyframes sunburst-bloom {
    to { transform: scaleY(1); }
}

.vestibule-frame {
    position: relative;
    z-index: 1;
    padding: clamp(30px, 6vw, 80px);
    border: 4px solid rgba(245,166,35,0.8);
}

.vestibule-frame::before,
.vestibule-frame::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-color: #C9A84C;
    border-style: solid;
}

.vestibule-frame::before {
    top: -4px;
    left: -4px;
    border-width: 4px 0 0 4px;
    box-shadow:
        inset 6px 6px 0 -4px #C9A84C,
        inset 12px 12px 0 -10px #C9A84C;
}

.vestibule-frame::after {
    bottom: -4px;
    right: -4px;
    border-width: 0 4px 4px 0;
    box-shadow:
        inset -6px -6px 0 -4px #C9A84C,
        inset -12px -12px 0 -10px #C9A84C;
}

.vestibule-content {
    text-align: center;
}

/* === BUBBLES === */
.bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    opacity: 0;
    animation: bubble-float var(--duration) ease-in-out var(--delay) infinite;
}

@keyframes bubble-float {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    25% { transform: translateY(-15vh) scale(1.05); opacity: 0.8; }
    50% { transform: translateY(-30vh) scale(0.95); opacity: 0.7; }
    75% { transform: translateY(-45vh) scale(1.02); opacity: 0.5; }
    100% { transform: translateY(-60vh) scale(1); opacity: 0; }
}

/* === SECTION CONTAINERS === */
.section-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 40px);
}

/* === MOSAIC FIELD === */
#mosaic-field {
    position: relative;
    overflow: hidden;
}

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(12px, 2vw, 24px);
}

.module {
    position: relative;
    border: 4px solid rgba(201,168,76,0.8);
    padding: 0;
    opacity: 0;
    transform: scaleY(0.85);
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.module.revealed {
    opacity: 1;
    transform: scaleY(1);
}

/* Corner ornaments for modules */
.module::before,
.module::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    z-index: 2;
    opacity: 0;
    transition: opacity 300ms ease-out 100ms;
}

.module.revealed::before,
.module.revealed::after {
    opacity: 1;
}

.module::before {
    top: 4px;
    left: 4px;
    border-top: 2px solid #F5A623;
    border-left: 2px solid #F5A623;
    box-shadow:
        inset 4px 4px 0 -2px rgba(245,166,35,0.6),
        inset 8px 8px 0 -6px rgba(245,166,35,0.3);
}

.module::after {
    bottom: 4px;
    right: 4px;
    border-bottom: 2px solid #F5A623;
    border-right: 2px solid #F5A623;
    box-shadow:
        inset -4px -4px 0 -2px rgba(245,166,35,0.6),
        inset -8px -8px 0 -6px rgba(245,166,35,0.3);
}

.module-inner {
    padding: clamp(20px, 3vw, 36px);
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(16px);
    transition: transform 500ms ease-out 200ms, opacity 500ms ease-out 200ms;
}

.module.revealed .module-inner {
    opacity: 1;
    transform: translateY(0);
}

.module-span2col {
    grid-column: span 2;
}

.module-span2row {
    grid-row: span 2;
}

/* Watercolor washes */
.module[data-wash="coral"] {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(232,97,77,0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 70%, rgba(232,97,77,0.08) 0%, transparent 60%);
}

.module[data-wash="gold"] {
    background:
        radial-gradient(ellipse at 40% 30%, rgba(245,166,35,0.15) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 80%, rgba(201,168,76,0.1) 0%, transparent 60%);
}

.module[data-wash="rose"] {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(212,144,138,0.14) 0%, transparent 70%),
        radial-gradient(ellipse at 20% 70%, rgba(212,144,138,0.08) 0%, transparent 60%);
}

.module[data-wash="violet"] {
    background:
        radial-gradient(ellipse at 30% 60%, rgba(139,94,131,0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 30%, rgba(139,94,131,0.08) 0%, transparent 60%);
}

.module[data-wash="amber"] {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(245,166,35,0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 30% 80%, rgba(245,215,142,0.1) 0%, transparent 60%);
}

.module[data-wash="blush"] {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(212,144,138,0.12) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 20%, rgba(232,97,77,0.08) 0%, transparent 60%);
}

/* Module hover */
.module:hover {
    border-color: #E8614D;
    transition: border-color 400ms ease-out;
}

/* === GALLERY CORRIDOR === */
#gallery-corridor {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(245,166,35,0.08) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 50%, rgba(139,94,131,0.08) 0%, transparent 70%);
}

.corridor-panels {
    display: flex;
    gap: clamp(12px, 2vw, 24px);
}

.panel {
    flex: 1;
    aspect-ratio: 2/5;
    border: 3px solid rgba(201,168,76,0.8);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0.85);
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.panel.revealed {
    opacity: 1;
    transform: scaleY(1);
}

.panel[data-wash="coral"] {
    background: radial-gradient(ellipse at 50% 30%, rgba(232,97,77,0.12) 0%, transparent 70%);
}

.panel[data-wash="gold"] {
    background: radial-gradient(ellipse at 50% 50%, rgba(245,166,35,0.15) 0%, transparent 70%);
}

.panel[data-wash="violet"] {
    background: radial-gradient(ellipse at 40% 60%, rgba(139,94,131,0.12) 0%, transparent 70%);
}

.panel[data-wash="rose"] {
    background: radial-gradient(ellipse at 60% 40%, rgba(212,144,138,0.14) 0%, transparent 70%);
}

.panel[data-wash="amber"] {
    background: radial-gradient(ellipse at 50% 50%, rgba(245,166,35,0.12) 0%, transparent 70%);
}

.panel-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 12px;
    opacity: 0;
    transform: translateY(16px);
    transition: transform 500ms ease-out 200ms, opacity 500ms ease-out 200ms;
}

.panel.revealed .panel-inner {
    opacity: 1;
    transform: translateY(0);
}

.panel-motif {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.panel-svg {
    width: 60%;
    height: auto;
    max-height: 80%;
}

.panel-typography {
    display: flex;
    align-items: center;
    justify-content: center;
}

.deco-letter {
    font-family: 'Poiret One', cursive;
    font-size: clamp(4rem, 10vw, 8rem);
    color: rgba(245,166,35,0.3);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.panel-label {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #5C3A21;
    text-align: center;
    padding-top: 12px;
}

.panel:hover {
    border-color: #E8614D;
    transition: border-color 400ms ease-out;
}

/* === ARCHIVE CHAMBER === */
#archive-chamber {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(139,94,131,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(74,111,165,0.08) 0%, transparent 60%);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: clamp(10px, 1.5vw, 18px);
}

.archive-module {
    border: 3px solid rgba(139,94,131,0.6);
    padding: clamp(14px, 2vw, 24px);
    position: relative;
    opacity: 0;
    transform: scaleY(0.85);
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-module.revealed {
    opacity: 1;
    transform: scaleY(1);
}

.archive-module[data-wash="twilight"] {
    background: radial-gradient(ellipse at 50% 50%, rgba(139,94,131,0.1) 0%, transparent 70%);
}

.archive-module[data-wash="deep-violet"] {
    background: radial-gradient(ellipse at 40% 40%, rgba(139,94,131,0.14) 0%, transparent 70%);
}

.archive-module[data-wash="twilight-blue"] {
    background: radial-gradient(ellipse at 60% 40%, rgba(74,111,165,0.12) 0%, transparent 70%);
}

.archive-module[data-wash="dusk"] {
    background: radial-gradient(ellipse at 50% 60%, rgba(92,58,33,0.08) 0%, transparent 70%);
}

.archive-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3D2B1F;
    margin-bottom: 8px;
}

.archive-text {
    font-family: 'Lora', serif;
    font-size: clamp(0.85rem, 1.4vw, 0.95rem);
    font-weight: 400;
    line-height: 1.7;
    color: #3D2B1F;
}

.archive-module:hover {
    border-color: #8B5E83;
    transition: border-color 400ms ease-out;
}

/* Corner ornaments for archive modules */
.archive-module::before,
.archive-module::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity 300ms ease-out 100ms;
}

.archive-module.revealed::before,
.archive-module.revealed::after {
    opacity: 1;
}

.archive-module::before {
    top: 3px;
    left: 3px;
    border-top: 2px solid #8B5E83;
    border-left: 2px solid #8B5E83;
}

.archive-module::after {
    bottom: 3px;
    right: 3px;
    border-bottom: 2px solid #8B5E83;
    border-right: 2px solid #8B5E83;
}

/* === FOOTER === */
#footer {
    position: relative;
    text-align: center;
    padding: clamp(40px, 6vw, 80px) 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(92,58,33,0.06) 100%);
}

.footer-ornament {
    width: 120px;
    margin: 0 auto 20px;
}

.footer-chevron {
    width: 100%;
    height: auto;
}

.footer-text {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #3D2B1F;
    margin-bottom: 8px;
}

.footer-sub {
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #5C3A21;
}

/* === GOLD SHIMMER === */
@keyframes gold-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Color reference: #4A6FA5 #D4908A #F5D78E #FFE066 */
.gold-leaf-accent {
    background: linear-gradient(135deg, #C9A84C, #F5D78E, #C9A84C);
    background-size: 200% 200%;
    animation: gold-shimmer 4s ease-in-out infinite;
}

.archive-module:nth-child(odd):hover {
    box-shadow: 0 0 12px rgba(255,224,102,0.3);
    border-color: #FFE066;
}

.module[data-wash="violet"] .module-title {
    color: #4A6FA5;
}

.panel[data-wash="rose"] .panel-label {
    color: #D4908A;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .module-span2col {
        grid-column: span 1;
    }

    .module-span2row {
        grid-row: span 1;
    }

    .mosaic-grid {
        grid-template-columns: 1fr;
    }

    .archive-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .corridor-panels {
        flex-direction: column;
    }

    .panel {
        aspect-ratio: auto;
        min-height: 200px;
    }

    .archive-grid {
        grid-template-columns: 1fr;
    }
}
