@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Source+Serif+4:wght@400;600&family=Fira+Code:wght@400&display=swap');

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

:root {
    --sapphire: #0B1D3A;
    --emerald: #0A3622;
    --amethyst: #2D1B4E;
    --gold: #C9A84C;
    --cream: #F2EDE4;
    --gray: #B8B0A4;
    --aurora-teal: #2ED8A3;
    --aurora-violet: #8B5CF6;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', serif;
    background-color: var(--sapphire);
    color: var(--cream);
    overflow-x: hidden;
    font-weight: 400;
    line-height: 1.8;
}

strong, b {
    font-weight: 600;
}

/* TYPOGRAPHY */
h1 {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(3.5rem, 9vw, 8rem);
    letter-spacing: 0.04em;
    font-weight: 400;
}

h2 {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: 0.04em;
    font-weight: 400;
}

/* SECTION I: THE AXIOM */
.axiom {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(46, 216, 163, 0.1) 0%, var(--sapphire) 70%);
    padding: 2rem;
}

.axiom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.domain-name {
    color: var(--aurora-teal);
    text-shadow: 0 4px 20px rgba(46, 216, 163, 0.3);
    margin-bottom: 2rem;
}

.flip-card-container {
    perspective: 1000px;
    width: 250px;
    height: 250px;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.3s;
}

.flip-card:hover {
    transform: scale(1.05);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--gold);
    border-radius: 8px;
    background: rgba(11, 29, 58, 0.8);
    font-size: 3rem;
    font-weight: 400;
}

.flip-card-back {
    transform: rotateY(180deg);
    color: var(--aurora-teal);
    border-color: var(--aurora-teal);
    background: rgba(11, 29, 58, 0.9);
}

.flip-card-front {
    color: var(--gold);
}

.sunburst-divider {
    width: 120px;
    height: 120px;
    margin: 2rem 0;
}

/* SECTION II: THE PREMISES */
.premises {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.premise-band {
    width: 100%;
    padding: 6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sapphire {
    background-color: var(--sapphire);
}

.emerald {
    background-color: var(--emerald);
}

.amethyst {
    background-color: var(--amethyst);
}

.premise-content {
    max-width: 1200px;
    margin: 0 auto;
}

.premise-text {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.8;
    color: var(--cream);
    text-align: center;
}

.divider-small {
    width: 100%;
    height: 40px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    display: block;
}

/* SECTION III: THE INFERENCE ENGINE */
.inference-engine {
    width: 100%;
    min-height: 100vh;
    background-color: var(--emerald);
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.inference-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    text-align: center;
    color: var(--gold);
    margin-bottom: 3rem;
}

.gates-container {
    display: flex;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.isometric-gate {
    width: 120px;
    height: 100px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.isometric-gate:hover {
    transform: scale(1.1);
}

.isometric-gate.illuminated {
    filter: drop-shadow(0 0 20px var(--gold));
}

.logic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.logic-card {
    perspective: 1000px;
    cursor: pointer;
}

.logic-card-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 180 / 220;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.logic-card.flipped .logic-card-inner {
    transform: rotateY(180deg);
}

.logic-card-front, .logic-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: rgba(11, 29, 58, 0.7);
}

.logic-card-back {
    transform: rotateY(180deg);
    border-color: var(--aurora-teal);
    background: rgba(11, 29, 58, 0.9);
}

.logic-card-front {
    font-family: 'Abril Fatface', serif;
    font-size: 3.5rem;
    color: var(--gold);
}

.logic-card-back {
    color: var(--aurora-teal);
    font-size: 0.9rem;
    line-height: 1.4;
}

.card-definition {
    display: block;
    color: var(--gray);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* SECTION IV: THE CONCLUSION */
.conclusion {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sapphire);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.aurora-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.aurora-element {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
}

.aurora-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--aurora-teal), transparent);
    top: -10%;
    left: 5%;
    animation: aurora-drift 12s ease-in-out infinite;
}

.aurora-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--aurora-violet), transparent);
    top: 10%;
    right: 10%;
    animation: aurora-drift 17s ease-in-out infinite;
    animation-delay: 2s;
}

.aurora-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--aurora-teal), transparent);
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    animation: aurora-drift 23s ease-in-out infinite;
    animation-delay: 4s;
}

@keyframes aurora-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 20px) scale(0.95);
    }
    75% {
        transform: translate(10px, 30px) scale(1.05);
    }
}

.conclusion-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.conclusion-text {
    font-family: 'Abril Fatface', serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--gold);
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.conclusion-subtext {
    font-family: 'Source Serif 4', serif;
    font-size: clamp(1rem, 1.1vw, 1.2rem);
    line-height: 1.8;
    color: var(--cream);
    font-weight: 400;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .axiom-content {
        gap: 2rem;
    }

    .flip-card-container {
        width: 200px;
        height: 200px;
    }

    .gates-container {
        gap: 1.5rem;
    }

    .isometric-gate {
        width: 100px;
        height: 80px;
    }

    .logic-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .premise-band {
        padding: 3rem 1.5rem;
    }

    .premise-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gates-container {
        flex-direction: column;
        gap: 1rem;
    }

    .logic-cards {
        grid-template-columns: 1fr;
    }

    .premise-band {
        padding: 2rem 1rem;
    }
}
