/* bada.moe - Fairycore Haute Couture */
/* Fonts: Space Grotesk (headings), Inter (body) */
/* Palette: #0A0A0A void, #151515 depth, #D4A843 gold, #F0D68A hover, #E8DCC8 parchment, #B8A88A taupe, #FAF8F2 frost, #C47D5A rose gold */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

html {
    scroll-behavior: smooth;
    background-color: #0A0A0A;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #E8DCC8;
    background-color: #0A0A0A;
    overflow-x: hidden;
    letter-spacing: 0.005em;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: #D4A843;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

h1 {
    font-weight: 700;
    font-size: clamp(40px, 6vw, 88px);
}

h2 {
    font-weight: 500;
    font-size: clamp(28px, 3.5vw, 52px);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 400;
    font-size: clamp(20px, 2.5vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.accent-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4A843;
    opacity: 0.7;
}

.body-text {
    color: #E8DCC8;
    font-size: 17px;
    line-height: 1.75;
    font-weight: 400;
    max-width: 600px;
}

/* Golden Thread SVG - fixed behind content */
#golden-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#thread-path {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* Section base styles */
.section-full {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.section-narrative {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 80px 32px;
}

.section-void {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* ===== HERO VAULT ===== */
#hero-vault {
    background-color: #0A0A0A;
    overflow: hidden;
}

.hex-border {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(80vw, 600px);
    height: min(70vw, 520px);
    opacity: 0;
    transition: opacity 1200ms cubic-bezier(0.23, 1, 0.32, 1);
}

.hex-border.visible {
    opacity: 1;
}

.hex-frame {
    width: 100%;
    height: 100%;
}

.hex-stroke {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.hex-border.visible .hex-stroke {
    stroke-dashoffset: 0;
}

.hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

/* Crowned Moth */
.moth-illustration {
    width: min(55vw, 400px);
    height: auto;
    margin-bottom: 20px;
}

.moth-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.moth-drawing .moth-path {
    stroke-dashoffset: 0;
}

.hero-title {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.23, 1, 0.32, 1), transform 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.hero-title.visible .word {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1), transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-title.visible .word:nth-child(1) {
    transition-delay: 0ms;
}

.hero-title.visible .word:nth-child(2) {
    transition-delay: 120ms;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 600ms ease, transform 600ms ease;
    transition-delay: 400ms;
}

.hero-title.visible ~ .hero-subtitle {
    opacity: 0.7;
    transform: translateY(0);
}

/* ===== NARRATIVE SECTIONS ===== */
.narrative-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 64px;
    max-width: 1200px;
    width: 100%;
    align-items: center;
}

.narrative-text {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-heading {
    margin-bottom: 8px;
}

.narrative-accent {
    display: flex;
    align-items: center;
    justify-content: center;
}

.accent-shape {
    width: min(300px, 40vw);
    height: auto;
}

/* Reveal animations */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms cubic-bezier(0.23, 1, 0.32, 1), transform 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Stagger reveal delays for siblings */
.narrative-text .reveal-element:nth-child(1) { transition-delay: 0ms; }
.narrative-text .reveal-element:nth-child(2) { transition-delay: 150ms; }
.narrative-text .reveal-element:nth-child(3) { transition-delay: 300ms; }
.narrative-text .reveal-element:nth-child(4) { transition-delay: 450ms; }

/* ===== ROTATING SHAPES ===== */
.rotating-shape {
    animation: slow-rotate 45s linear infinite;
}

@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scroll-linked scale for accent shapes */
.scroll-scale {
    transition: transform 0.3s ease-out;
}

/* ===== INTERSTITIAL VOIDS ===== */
.void-shape {
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-shape svg {
    width: min(250px, 50vw);
    height: auto;
}

.geode-svg {
    width: min(300px, 60vw);
    height: auto;
}

/* Pulsing glow animation */
.pulsing-glow {
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 0px rgba(212, 168, 67, 0));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
    }
}

/* Inline slow rotate for single elements */
.slow-rotate-inline {
    transform-origin: center;
    animation: slow-rotate 60s linear infinite;
}

/* ===== GOLD HAIRLINE DIVIDERS ===== */
.section-narrative::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(80%, 1000px);
    height: 0.5px;
    background: linear-gradient(90deg, transparent, #D4A843 40%, #D4A843 60%, transparent);
    opacity: 0.3;
}

/* ===== TERMINAL CODA ===== */
#terminal-coda {
    background-color: #0A0A0A;
    min-height: 100vh;
    gap: 40px;
}

.mandala-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mandala-svg {
    width: min(420px, 75vw);
    height: auto;
}

.mandala-piece {
    opacity: 0;
    transform-origin: 250px 250px;
    transform: scale(0) rotate(-30deg);
    transition: opacity 500ms cubic-bezier(0.23, 1, 0.32, 1), transform 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.mandala-piece.assembled {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.mandala-rose.assembled {
    opacity: 0.8;
}

/* Mandala glow after full assembly */
.mandala-svg.complete {
    animation: mandala-glow 2s ease-in-out 1 forwards;
}

@keyframes mandala-glow {
    0% {
        filter: drop-shadow(0 0 0px rgba(212, 168, 67, 0));
    }
    40% {
        filter: drop-shadow(0 0 20px rgba(212, 168, 67, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
    }
}

.coda-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(16px, 2vw, 24px);
    color: #D4A843;
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 800ms ease, transform 800ms ease;
    letter-spacing: -0.01em;
}

.coda-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .narrative-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .narrative-accent {
        order: -1;
    }

    .accent-shape {
        width: min(200px, 50vw);
    }

    .section-narrative {
        padding: 60px 20px;
    }

    .body-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .moth-illustration {
        width: 70vw;
    }

    .hex-border {
        width: 90vw;
        height: 78vw;
    }
}
