/* thethird.quest - Maximalist geometric proof in pastel */

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

:root {
    --chalk-lavender: #D4C0E0;
    --soft-peach: #F0D4C8;
    --mint-cream: #C8E8D8;
    --butter-yellow: #F0E8C0;
    --blush-pink: #F0C8D0;
    --graphite-soft: #4A4050;
    --muted-plum: #7A6B7A;
    --petal-ground: #F7F0F5;
}

body {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.75;
    color: var(--graphite-soft);
    background-color: var(--petal-ground);
    overflow-x: hidden;
}

/* === Navigation === */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background-color: var(--petal-ground);
    border-bottom: 1px solid var(--chalk-lavender);
    z-index: 100;
}

.nav-item {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--muted-plum);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: var(--graphite-soft);
}

.nav-shape {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 1px solid var(--muted-plum);
    transition: background-color 0.3s ease;
}

.circle-shape { border-radius: 50%; }
.triangle-shape { clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.hex-shape { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.square-shape { border-radius: 0; }
.diamond-shape { transform: rotate(45deg); width: 14px; height: 14px; }

.nav-item.active .nav-shape {
    background-color: var(--chalk-lavender);
}

/* === Axiom Section === */
.axiom {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 64px;
}

.axiom-center {
    margin-bottom: 24px;
}

.axiom-circle {
    width: 48px;
    height: 48px;
    opacity: 0;
    animation: springIn 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.axiom-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--graphite-soft);
    letter-spacing: -0.01em;
    opacity: 0;
    animation: fadeIn 0.8s 0.5s ease forwards;
}

.axiom-tagline {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    color: var(--muted-plum);
    margin-top: 12px;
    opacity: 0;
    animation: fadeIn 0.8s 2.5s ease forwards;
}

/* Starburst shapes */
.starburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
}

.geo-shape {
    position: absolute;
    opacity: 0;
    transform: scale(0);
}

.shape-0 { width: 40px; top: 10%; left: 60%; animation: springIn 0.4s 0.58s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-1 { width: 32px; top: 5%; left: 40%; animation: springIn 0.4s 0.66s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-2 { width: 28px; top: 20%; left: 80%; animation: springIn 0.4s 0.74s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-3 { width: 36px; top: 35%; left: 85%; animation: springIn 0.4s 0.82s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-4 { width: 24px; top: 55%; left: 82%; animation: springIn 0.4s 0.90s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-5 { width: 30px; top: 70%; left: 70%; animation: springIn 0.4s 0.98s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-6 { width: 26px; top: 80%; left: 50%; animation: springIn 0.4s 1.06s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-7 { width: 34px; top: 75%; left: 25%; animation: springIn 0.4s 1.14s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-8 { width: 22px; top: 60%; left: 12%; animation: springIn 0.4s 1.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-9 { width: 38px; top: 40%; left: 8%; animation: springIn 0.4s 1.30s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-10 { width: 28px; top: 22%; left: 15%; animation: springIn 0.4s 1.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.shape-11 { width: 32px; top: 8%; left: 30%; animation: springIn 0.4s 1.46s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes springIn {
    0% { opacity: 0; transform: scale(0); }
    70% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Tessellation Bands === */
.tess-band {
    height: 64px;
    width: 100%;
    position: relative;
}

.tess-hex {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0-100L0-16v-34L28-66l28 16v34L28-34z' fill='%23D4C0E0' stroke='%23C8E8D8' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}

.tess-tri {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpolygon points='20,0 40,40 0,40' fill='%23F0D4C8' stroke='%23F0E8C0' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 40px 40px;
}

.tess-diamond {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect x='6' y='6' width='28' height='28' fill='%23F0C8D0' stroke='%23D4C0E0' stroke-width='1' transform='rotate(45 20 20)'/%3E%3C/svg%3E");
    background-size: 40px 40px;
}

/* === Content Sections === */
.content-section {
    display: flex;
    padding: clamp(48px, 8vh, 96px) 32px;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.watermark-number {
    position: absolute;
    top: 0;
    left: 24px;
    font-family: 'Albert Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--chalk-lavender);
    opacity: 0.12;
    pointer-events: none;
    line-height: 1;
    z-index: 0;
}

.content-column {
    width: 60%;
    position: relative;
    z-index: 10;
}

.section-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--muted-plum);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--graphite-soft);
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

.section-body {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.75;
    color: var(--graphite-soft);
    margin-bottom: 16px;
    max-width: 65ch;
}

/* === Pattern Margins === */
.pattern-margin {
    width: 35%;
    position: relative;
    min-height: 300px;
}

.margin-shape {
    position: absolute;
    opacity: 0;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.margin-shape.visible {
    opacity: 1;
    transform: scale(1);
}

/* Sparse layout (section 1) */
.margin-sparse .ms-0 { top: 5%; left: 10%; }
.margin-sparse .ms-1 { top: 15%; left: 55%; }
.margin-sparse .ms-2 { top: 30%; left: 25%; }
.margin-sparse .ms-3 { top: 45%; left: 60%; }
.margin-sparse .ms-4 { top: 55%; left: 15%; }
.margin-sparse .ms-5 { top: 65%; left: 50%; }
.margin-sparse .ms-6 { top: 78%; left: 30%; }
.margin-sparse .ms-7 { top: 85%; left: 65%; }

/* Moderate layout (section 2) */
.margin-moderate .ms-0 { top: 0%; left: 5%; }
.margin-moderate .ms-1 { top: 5%; left: 50%; }
.margin-moderate .ms-2 { top: 12%; left: 25%; }
.margin-moderate .ms-3 { top: 18%; left: 65%; }
.margin-moderate .ms-4 { top: 28%; left: 10%; }
.margin-moderate .ms-5 { top: 32%; left: 48%; }
.margin-moderate .ms-6 { top: 40%; left: 70%; }
.margin-moderate .ms-7 { top: 48%; left: 20%; }
.margin-moderate .ms-8 { top: 52%; left: 55%; }
.margin-moderate .ms-9 { top: 60%; left: 8%; }
.margin-moderate .ms-10 { top: 65%; left: 42%; }
.margin-moderate .ms-11 { top: 72%; left: 68%; }
.margin-moderate .ms-12 { top: 78%; left: 15%; }
.margin-moderate .ms-13 { top: 82%; left: 52%; }
.margin-moderate .ms-14 { top: 90%; left: 35%; }

/* Dense layout (section 3) */
.margin-dense .ms-0 { top: 0%; left: 2%; }
.margin-dense .ms-1 { top: 2%; left: 45%; }
.margin-dense .ms-2 { top: 6%; left: 22%; }
.margin-dense .ms-3 { top: 8%; left: 62%; }
.margin-dense .ms-4 { top: 15%; left: 8%; }
.margin-dense .ms-5 { top: 18%; left: 40%; }
.margin-dense .ms-6 { top: 22%; left: 65%; }
.margin-dense .ms-7 { top: 28%; left: 15%; }
.margin-dense .ms-8 { top: 32%; left: 50%; }
.margin-dense .ms-9 { top: 36%; left: 5%; }
.margin-dense .ms-10 { top: 40%; left: 35%; }
.margin-dense .ms-11 { top: 44%; left: 62%; }
.margin-dense .ms-12 { top: 50%; left: 18%; }
.margin-dense .ms-13 { top: 55%; left: 48%; }
.margin-dense .ms-14 { top: 60%; left: 70%; }
.margin-dense .ms-15 { top: 65%; left: 10%; }
.margin-dense .ms-16 { top: 70%; left: 42%; }
.margin-dense .ms-17 { top: 75%; left: 58%; }
.margin-dense .ms-18 { top: 80%; left: 25%; }
.margin-dense .ms-19 { top: 88%; left: 50%; }

/* === Q.E.D. Section === */
.qed-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qed-field {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.qed-clearing {
    position: relative;
    z-index: 10;
    background-color: var(--petal-ground);
    padding: 60px 48px;
    width: 50%;
    text-align: center;
    border: 1px solid var(--chalk-lavender);
}

.qed-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--graphite-soft);
    line-height: 2.0;
    opacity: 0;
    transition: opacity 1s ease;
}

.qed-text.visible {
    opacity: 1;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .axiom-circle, .geo-shape {
        animation: none;
        opacity: 1;
        transform: scale(1);
    }
    .axiom-title, .axiom-tagline {
        animation: none;
        opacity: 1;
    }
    .margin-shape {
        opacity: 1;
        transform: scale(1);
        transition: none;
    }
    .qed-text {
        opacity: 1;
        transition: none;
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .content-section {
        flex-direction: column;
    }
    .content-column {
        width: 100%;
    }
    .pattern-margin {
        width: 100%;
        min-height: 200px;
        margin-top: 32px;
    }
    .qed-clearing {
        width: 85%;
    }
    .top-nav {
        gap: 12px;
        padding: 0 12px;
    }
    .starburst {
        width: 300px;
        height: 300px;
    }
}
