/* Color Palette */
:root {
    --color-bg-dark: #0D0A06;
    --color-bg-alt: #1A1408;
    --color-bg-light: #1E1810;
    --color-accent-gold: #C9A94E;
    --color-accent-light: #E2C872;
    --color-text-light: #E8DCC8;
    --color-teal: #4FD1C5;
    --color-magenta: #B83280;
    --color-parchment: #E8DCC8;
    --color-ember: #A0522D;
    --color-shadow: #060402;
    --color-bg-transition: #151010;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.01em;
    scroll-behavior: smooth;
}

/* Hero Section - Opening Experience */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-bg-dark);
}

.hero-bloom {
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 78, 0.6) 0%, rgba(201, 169, 78, 0.3) 30%, transparent 70%);
    animation: bloom-expand 3s ease-out forwards;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes bloom-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 800px;
        height: 800px;
        opacity: 0.4;
    }
}

.hero-title {
    position: relative;
    z-index: 10;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent-light);
    text-shadow: 0 0 20px rgba(201, 169, 78, 0.5), 0 0 40px rgba(201, 169, 78, 0.3);
    animation: fade-in 2s ease-in-out 0.8s forwards;
    opacity: 0;
    text-align: center;
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Intro Section */
.intro {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, var(--color-bg-dark), var(--color-bg-alt));
    z-index: 5;
}

.intro-text {
    max-width: 800px;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.9;
    color: var(--color-parchment);
    text-align: center;
    font-style: italic;
}

/* Logic Tree Container */
.logic-tree-container {
    position: relative;
    width: 100%;
    height: 600px;
    background-color: var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.logic-tree-svg {
    width: 100%;
    height: 100%;
    max-width: 800px;
}

.tree-branch {
    opacity: 0.6;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-line 4s ease-in-out forwards;
    animation-delay: 1s;
}

@keyframes draw-line {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.6;
    }
}

.tree-node {
    animation: pulse-glow 2s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes pulse-glow {
    0%, 100% {
        r: 8;
        opacity: 0.8;
        filter: drop-shadow(0 0 4px rgba(201, 169, 78, 0.4));
    }
    50% {
        r: 12;
        opacity: 0.5;
        filter: drop-shadow(0 0 12px rgba(201, 169, 78, 0.6));
    }
}

/* Content Sections */
.content-sections {
    position: relative;
    width: 100%;
    background-color: var(--color-bg-dark);
    padding: 6rem 2rem;
    z-index: 10;
}

.content-section {
    position: relative;
    max-width: 900px;
    margin: 8rem auto;
    z-index: 2;
}

.section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent-light);
    text-shadow: 0 0 12px rgba(201, 169, 78, 0.4);
    margin-bottom: 3rem;
    position: relative;
}

/* Candle Pool - Floating Light Motif */
.candle-pool {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 78, 0.15) 0%, rgba(201, 169, 78, 0.05) 40%, transparent 70%);
    filter: blur(40px);
    animation: pool-pulse 4s ease-in-out infinite;
    z-index: 1;
}

#pool-axioms {
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

#pool-propositions {
    top: 400px;
    right: -200px;
    animation-delay: 1s;
}

#pool-puzzles {
    top: 800px;
    left: -200px;
    animation-delay: 2s;
}

#pool-closing {
    top: 1200px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 3s;
}

@keyframes pool-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* Proof Cards */
.proof-card {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-alt) 100%);
    border-left: 3px solid var(--color-accent-gold);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(201, 169, 78, 0.1), 0 0 20px rgba(201, 169, 78, 0.15);
    position: relative;
    z-index: 3;
}

.proof-card:hover {
    border-left-color: var(--color-accent-light);
    background: linear-gradient(135deg, var(--color-bg-light) 100%, var(--color-bg-alt) 100%);
    box-shadow: inset 0 0 30px rgba(201, 169, 78, 0.15), 0 0 20px rgba(201, 169, 78, 0.2);
}

.proof-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent-light);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(201, 169, 78, 0.3);
}

.proof-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-parchment);
    margin-bottom: 1rem;
    font-style: italic;
}

.proof-notation {
    font-family: 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--color-accent-gold);
    letter-spacing: 0.05em;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(79, 209, 197, 0.2);
}

/* Hints in Puzzle Cards */
.hint {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(201, 169, 78, 0.4);
    color: var(--color-accent-gold);
    font-style: italic;
    font-size: 0.95rem;
}

/* Closing Section */
.closing-text {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--color-parchment);
    margin: 1.5rem 0;
    text-align: center;
}

/* Glitch Effect Accent - Subtle Data Corruption */
@keyframes glitch {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
        transform: translate(-2px, -2px);
    }
    20% {
        clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
        transform: translate(2px, 2px);
    }
    40% {
        clip-path: polygon(0 45%, 100% 45%, 100% 100%, 0 100%);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: polygon(0 45%, 100% 45%, 100% 100%, 0 100%);
        transform: translate(2px, -2px);
    }
    80% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        transform: translate(0, 0);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        transform: translate(0, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-bloom {
        animation: bloom-expand-mobile 3s ease-out forwards;
    }

    @keyframes bloom-expand-mobile {
        0% {
            width: 0;
            height: 0;
            opacity: 0;
        }
        50% {
            opacity: 1;
        }
        100% {
            width: 400px;
            height: 400px;
            opacity: 0.4;
        }
    }

    .candle-pool {
        width: 300px;
        height: 300px;
    }

    .proof-card {
        padding: 1.5rem;
    }

    .intro {
        padding: 2rem 1rem;
    }
}

/* Print and Accessibility */
@media print {
    .hero-bloom,
    .candle-pool {
        display: none;
    }

    body {
        background: white;
        color: black;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent-gold);
    border-radius: 6px;
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Dark Mode and High Contrast */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--color-bg-dark);
        color: var(--color-text-light);
    }
}

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