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

:root {
    --deep-wine: #3a0d1e;
    --blush: #e8d5cc;
    --mauve: #8a4a5e;
    --crimson: #6b1d3a;
    --cream: #faf5ef;
    --abyss: #2a0a14;
    --parchment: #f0e6d8;
    --ghost: #fdf9f4;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--cream);
    color: var(--deep-wine);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SECTION: THE VEIL ===== */
.section-veil {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--ghost) 0%, var(--cream) 60%, var(--parchment) 100%);
    overflow: hidden;
}

.veil-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    will-change: transform;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--crimson), transparent 70%);
    top: 10%;
    left: 15%;
    animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--mauve), transparent 70%);
    top: 50%;
    right: 10%;
    animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--blush), transparent 70%);
    bottom: 15%;
    left: 40%;
    animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -40px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40px, 30px) scale(1.05); }
    66% { transform: translate(50px, -20px) scale(0.9); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -50px) scale(1.15); }
}

.veil-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 10rem);
    letter-spacing: -0.03em;
    color: var(--abyss);
    line-height: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 2s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--mauve);
    margin-top: 1.5rem;
    opacity: 0;
    animation: subtitleReveal 1.5s ease 1.8s forwards;
}

@keyframes heroReveal {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes subtitleReveal {
    to { opacity: 0.7; }
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--mauve));
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ===== SECTION: ORACLE GRID ===== */
.section-oracle {
    position: relative;
    padding: 8rem 2rem;
    min-height: 100vh;
    background: var(--cream);
}

.oracle-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.glass-card {
    position: relative;
    background: rgba(240, 230, 216, 0.12);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(255, 245, 235, 0.18);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(42, 10, 20, 0.06), inset 0 1px 0 rgba(253, 249, 244, 0.3);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.6s ease;
    cursor: default;
    opacity: 0;
    transform: translateY(40px);
}

.glass-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 48px rgba(42, 10, 20, 0.1), inset 0 1px 0 rgba(253, 249, 244, 0.4);
}

.glass-card--tall {
    grid-row: span 2;
    min-height: 400px;
}

.glass-card--medium {
    min-height: 250px;
}

.glass-card--short {
    min-height: 180px;
}

.card-index {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--mauve);
    opacity: 0.6;
}

.card-title {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--abyss);
    margin: 1rem 0;
    line-height: 1.3;
}

.card-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--deep-wine);
    opacity: 0.8;
    flex: 1;
    margin-bottom: 1.5rem;
}

.card-glyph {
    font-size: 1.5rem;
    color: var(--crimson);
    opacity: 0.3;
    align-self: flex-end;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.glass-card:hover .card-glyph {
    opacity: 0.7;
    transform: scale(1.2);
}

/* ===== SECTION: THRESHOLD ===== */
.section-threshold {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--cream) 0%, var(--parchment) 40%, var(--blush) 100%);
    overflow: hidden;
}

.threshold-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.threshold-line {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    line-height: 1.6;
    color: var(--abyss);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.threshold-line.visible {
    opacity: 0.9;
    transform: translateY(0);
}

.threshold-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 29, 58, 0.15), transparent 70%);
    filter: blur(60px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: thresholdPulse 8s ease-in-out infinite;
}

@keyframes thresholdPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.8; }
}

/* ===== SECTION: CODEX ===== */
.section-codex {
    position: relative;
    padding: 8rem 2rem;
    background: var(--abyss);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codex-entries {
    max-width: 700px;
    width: 100%;
}

.codex-entry {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(232, 213, 204, 0.08);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.codex-entry.visible {
    opacity: 1;
    transform: translateX(0);
}

.codex-key {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--mauve);
    flex-shrink: 0;
    margin-right: 2rem;
}

.codex-value {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--blush);
    text-align: right;
    opacity: 0.8;
}

/* ===== SECTION: DISSOLUTION ===== */
.section-dissolution {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--abyss) 0%, var(--deep-wine) 50%, var(--abyss) 100%);
    overflow: hidden;
}

.dissolution-content {
    text-align: center;
    z-index: 2;
}

.dissolution-text {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 8rem);
    color: var(--ghost);
    opacity: 0.1;
    letter-spacing: -0.03em;
    transition: opacity 2s ease;
}

.dissolution-text.visible {
    opacity: 0.3;
}

.dissolution-subtext {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--mauve);
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 2s ease 0.5s;
}

.dissolution-text.visible ~ .dissolution-subtext,
.dissolution-subtext.visible {
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .oracle-grid {
        grid-template-columns: 1fr;
    }
    .glass-card--tall {
        grid-row: span 1;
    }
    .codex-entry {
        flex-direction: column;
        gap: 0.5rem;
    }
    .codex-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .section-oracle {
        padding: 4rem 1rem;
    }
}
