/* ==============================================
   rational.quest - MCBling Editorial Styles
   ============================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.8;
    color: #4A3828;
    background-color: #F5F0E5;
    overflow-x: hidden;
    /* Palette: Deep Forest #1A3D2E, Emerald #2D6B4F, Gold #D4A855,
       Sage #8BAF8B, Cream #F5F0E5, Brown #4A3828, Diamond White #F8F5F0 */
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- GLAMOUR GATE (100vh) --- */
#glamour-gate {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: #1A3D2E;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Retro-pattern borders on gate */
.gate-pattern-border {
    position: absolute;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 9px,
            rgba(212, 168, 85, 0.3) 9px,
            rgba(212, 168, 85, 0.3) 10px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 9px,
            rgba(212, 168, 85, 0.3) 9px,
            rgba(212, 168, 85, 0.3) 10px
        );
    z-index: 2;
}

.gate-pattern-top {
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
}

.gate-pattern-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
}

.gate-pattern-left {
    top: 0;
    left: 0;
    bottom: 0;
    width: 28px;
}

.gate-pattern-right {
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
}

/* Watercolor washes */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    filter: url(#watercolor-blur);
    opacity: 0;
    transition: opacity 1.5s ease;
}

.watercolor-wash.visible {
    opacity: 1;
}

.wash-tl {
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse at center, rgba(139, 175, 139, 0.35) 0%, transparent 70%);
}

.wash-br {
    bottom: -10%;
    right: -10%;
    width: 55%;
    height: 55%;
    background: radial-gradient(ellipse at center, rgba(45, 107, 79, 0.4) 0%, transparent 70%);
}

.wash-center {
    top: 30%;
    left: 25%;
    width: 50%;
    height: 40%;
    background: radial-gradient(ellipse at center, rgba(212, 168, 85, 0.12) 0%, transparent 70%);
}

/* Gate content */
.gate-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.wordmark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #D4A855;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.2s ease, transform 1.2s ease;
    text-shadow: 0 0 60px rgba(212, 168, 85, 0.25);
}

.wordmark.visible {
    opacity: 1;
    transform: scale(1);
}

.gate-tagline {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(14px, 1.8vw, 20px);
    color: #8BAF8B;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.gate-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0;
    transition: opacity 1s ease 1.4s;
}

.scroll-indicator.visible {
    opacity: 0.6;
}

.scroll-arrow {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid #D4A855;
    border-bottom: 2px solid #D4A855;
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

/* --- EDITORIAL STREAM --- */
#editorial-stream {
    max-width: 700px;
    margin: 0 auto;
    padding: 80px 24px;
}

/* Reveal animation base */
.reveal-block {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children within blocks */
.reveal-block .section-label {
    transition-delay: 0ms;
}

.reveal-block .editorial-heading {
    transition-delay: 150ms;
}

.reveal-block .editorial-body {
    transition-delay: 300ms;
}

.reveal-block .pull-quote {
    transition-delay: 450ms;
}

/* Editorial block */
.editorial-block {
    margin-bottom: 80px;
}

.section-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8BAF8B;
    display: block;
    margin-bottom: 12px;
}

.editorial-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1A3D2E;
    line-height: 1.1;
    margin-bottom: 24px;
    position: relative;
    text-shadow: 0 1px 0 #F8F5F0;
}

.editorial-body {
    color: #4A3828;
    margin-bottom: 20px;
}

.pull-quote {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.5;
    color: #2D6B4F;
    border-left: 3px solid #D4A855;
    padding-left: 24px;
    margin: 40px 0;
}

/* Watercolor illustration moments */
.watercolor-moment {
    margin: 60px 0;
    display: flex;
    justify-content: center;
}

.watercolor-illustration {
    width: 100%;
    max-width: 500px;
    height: 120px;
    border-radius: 50% / 40%;
    position: relative;
    overflow: hidden;
}

.wc-1 {
    background:
        radial-gradient(ellipse at 30% 50%, rgba(139, 175, 139, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 40%, rgba(45, 107, 79, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 60%, rgba(212, 168, 85, 0.15) 0%, transparent 50%);
    filter: url(#watercolor-blur-sm);
}

.wc-2 {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(45, 107, 79, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 25% 60%, rgba(139, 175, 139, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 70%, rgba(212, 168, 85, 0.2) 0%, transparent 50%);
    filter: url(#watercolor-blur-sm);
}

/* Pattern dividers */
.pattern-divider {
    margin: 60px 0;
    overflow: hidden;
    border-radius: 2px;
}

.divider-svg {
    display: block;
    width: 100%;
    height: 40px;
}

/* --- PATTERN GALLERY --- */
#pattern-gallery {
    background-color: #1A3D2E;
    padding: 100px 24px;
}

.gallery-header {
    max-width: 700px;
    margin: 0 auto 60px;
    text-align: center;
}

.gallery-header .section-label {
    color: #D4A855;
}

.gallery-header .editorial-heading {
    color: #D4A855;
}

.gallery-header .editorial-body {
    color: #8BAF8B;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.pattern-tile {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.pattern-tile:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 40px rgba(212, 168, 85, 0.2);
}

.tile-svg {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.tile-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(26, 61, 46, 0.9));
    font-family: 'Inconsolata', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #D4A855;
    text-align: center;
}

/* Responsive pattern grid */
@media (max-width: 600px) {
    .pattern-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
}

/* --- ARCHIVE FOOTER --- */
#archive-footer {
    background-color: #1A3D2E;
    position: relative;
    padding: 60px 24px 40px;
}

.footer-pattern-border {
    width: 100%;
    height: 28px;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 9px,
            rgba(212, 168, 85, 0.3) 9px,
            rgba(212, 168, 85, 0.3) 10px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 9px,
            rgba(212, 168, 85, 0.3) 9px,
            rgba(212, 168, 85, 0.3) 10px
        );
    margin-bottom: 40px;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.footer-wordmark {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 28px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #D4A855;
    margin-bottom: 8px;
}

.footer-note {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #8BAF8B;
    margin-bottom: 24px;
}

.footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-link {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8BAF8B;
    cursor: pointer;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #D4A855;
}

.footer-separator {
    color: #D4A855;
    font-size: 10px;
}

/* --- SPARKLE EFFECTS --- */
#sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    clip-path: polygon(
        50% 0%, 60% 35%, 100% 50%, 60% 65%,
        50% 100%, 40% 65%, 0% 50%, 40% 35%
    );
    background-color: #D4A855;
    opacity: 0;
    animation: sparkleFlash 0.6s ease-in-out forwards;
    pointer-events: none;
}

@keyframes sparkleFlash {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    40% {
        opacity: 1;
        transform: scale(1) rotate(20deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(45deg);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    #editorial-stream {
        padding: 60px 20px;
    }

    .editorial-block {
        margin-bottom: 60px;
    }

    .pull-quote {
        margin: 30px 0;
        padding-left: 18px;
    }

    .gate-pattern-top,
    .gate-pattern-bottom {
        height: 18px;
    }

    .gate-pattern-left,
    .gate-pattern-right {
        width: 18px;
    }
}

@media (max-width: 480px) {
    .wordmark {
        font-size: clamp(36px, 12vw, 60px);
    }

    #editorial-stream {
        padding: 40px 16px;
    }

    .editorial-block {
        margin-bottom: 48px;
    }
}
