/* =====================================================
   voting.wiki - Styles
   Inflated 3D civic monument aesthetic
   ===================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --amber: #C8851E;
    --mahogany: #3B1A0A;
    --ivory: #F5EEDC;
    --bronze: #8B5E3C;
    --crimson: #9B2335;
    --saffron: #E8C872;
    --cream: #FAF4E6;
    --smoke: #2A2118;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background-color: var(--ivory);
    color: var(--mahogany);
    font-size: 18px;
    line-height: 1.65;
    overflow-x: hidden;
    position: relative;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Watermark Seals Background --- */
.watermark-seals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.watermark-seal {
    position: absolute;
    width: 350px;
    height: 350px;
}

.ws-1 { top: 10%; right: 5%; }
.ws-2 { top: 50%; left: 3%; }
.ws-3 { bottom: 10%; right: 15%; }

/* --- Seal Navigation --- */
.seal-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.seal-nav-trigger {
    width: 56px;
    height: 56px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.seal-nav-trigger:hover {
    transform: scale(1.12);
}

.seal-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(59, 26, 10, 0.3));
}

.seal-nav-menu {
    list-style: none;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.seal-nav.open .seal-nav-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.seal-nav-link {
    display: block;
    padding: 8px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bronze);
    background: var(--cream);
    border-radius: 20px;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(59, 26, 10, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
}

.seal-nav-link:hover,
.seal-nav-link.active {
    background: var(--crimson);
    color: var(--cream);
    box-shadow: 0 4px 16px rgba(155, 35, 53, 0.3);
}

/* --- Chambers (sections) --- */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    will-change: filter, transform, opacity;
    transition: filter 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.chamber.blur-distant {
    filter: blur(8px);
    opacity: 0.4;
    transform: scale(0.94);
}

.chamber.blur-adjacent {
    filter: blur(4px);
    opacity: 0.7;
    transform: scale(0.97);
}

.chamber.blur-focused {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
}

.chamber-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.chamber-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 60px;
}

/* --- Opening Chamber --- */
.chamber-opening {
    background: radial-gradient(ellipse at 50% 40%, var(--saffron) 0%, var(--amber) 40%, var(--ivory) 80%);
}

.chamber-opening .chamber-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.hero-3d-scene {
    width: 320px;
    height: 340px;
    margin-bottom: 40px;
    animation: floatBallot 6s ease-in-out infinite;
}

@keyframes floatBallot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

.ballot-box-svg {
    width: 100%;
    height: 100%;
}

.hero-text {
    max-width: 720px;
}

.hero-headline {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--mahogany);
    margin-bottom: 24px;
}

.gold-accent {
    color: var(--amber);
}

.crimson-accent {
    color: var(--crimson);
}

.hero-sub {
    font-family: 'Bitter', serif;
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--bronze);
    max-width: 540px;
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeInUp 1s ease 1.5s both;
}

.scroll-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bronze);
}

.scroll-arrow {
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Knowledge Chambers (broken grid) --- */
.chamber-knowledge {
    background: linear-gradient(180deg, var(--cream) 0%, var(--ivory) 100%);
}

.chamber-knowledge:nth-child(odd) {
    background: linear-gradient(180deg, var(--ivory) 0%, var(--cream) 100%);
}

.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    align-items: center;
    position: relative;
}

.grid-block {
    position: relative;
}

.block-text {
    background: var(--cream);
    border-radius: 24px;
    padding: 48px;
    box-shadow:
        0 8px 32px rgba(59, 26, 10, 0.1),
        0 2px 8px rgba(59, 26, 10, 0.06),
        inset 0 1px 0 rgba(250, 244, 230, 0.8);
}

.block-text.block-offset-left {
    grid-column: 1 / 7;
    margin-right: -60px;
    z-index: 2;
}

.block-text.block-offset-right {
    grid-column: 6 / 13;
    margin-left: -60px;
    z-index: 2;
}

.block-text.block-wide {
    grid-column: 1 / 8;
}

.block-render {
    z-index: 1;
}

.block-render.block-offset-right {
    grid-column: 7 / 13;
    display: flex;
    justify-content: center;
    align-items: center;
}

.block-render.block-offset-left {
    grid-column: 1 / 6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.block-timeline {
    grid-column: 8 / 13;
    z-index: 2;
}

.block-accent {
    grid-column: 1 / 13;
}

.block-overlap-top {
    margin-top: -40px;
}

/* --- Rotations --- */
.rotate-neg {
    transform: rotate(-1.5deg);
}

.rotate-neg .rotate-inner {
    transform: rotate(1.5deg);
}

.rotate-pos {
    transform: rotate(1.5deg);
}

.rotate-pos .rotate-inner {
    transform: rotate(-1.5deg);
}

.rotate-neg-sm {
    transform: rotate(-0.8deg);
}

.rotate-neg-sm .rotate-inner {
    transform: rotate(0.8deg);
}

.rotate-pos-sm {
    transform: rotate(0.8deg);
}

.rotate-pos-sm .rotate-inner {
    transform: rotate(-0.8deg);
}

/* --- Section Typography --- */
.section-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--amber);
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    background: rgba(200, 133, 30, 0.1);
    border-radius: 12px;
}

.section-headline {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--mahogany);
    margin-bottom: 20px;
}

.section-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--smoke);
    margin-bottom: 16px;
}

.section-body em {
    font-style: italic;
    color: var(--amber);
}

/* --- Embossed Divider --- */
.embossed-divider {
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--amber) 20%, var(--saffron) 50%, var(--amber) 80%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(59, 26, 10, 0.15), inset 0 1px 0 rgba(232, 200, 114, 0.5);
}

/* --- SVG Renders --- */
.render-seal,
.render-parchment,
.render-globe {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 12px 32px rgba(59, 26, 10, 0.2));
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.render-seal:hover,
.render-parchment:hover,
.render-globe:hover {
    transform: scale(1.04) rotate(-1deg);
}

/* --- Inflated Cards --- */
.inflated-cards {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.inflated-card {
    flex: 1;
    min-width: 120px;
    padding: 20px 16px;
    background: linear-gradient(145deg, var(--saffron), var(--amber));
    border-radius: 20px;
    text-align: center;
    box-shadow:
        0 6px 20px rgba(200, 133, 30, 0.25),
        0 2px 6px rgba(59, 26, 10, 0.1),
        inset 0 2px 4px rgba(250, 244, 230, 0.4),
        inset 0 -2px 4px rgba(139, 94, 60, 0.2);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s ease;
    cursor: default;
}

.inflated-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow:
        0 10px 30px rgba(200, 133, 30, 0.3),
        0 4px 10px rgba(59, 26, 10, 0.12),
        inset 0 2px 4px rgba(250, 244, 230, 0.5),
        inset 0 -2px 4px rgba(139, 94, 60, 0.15);
}

.card-label {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--mahogany);
    display: block;
    margin-bottom: 4px;
}

.card-desc {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--bronze);
    letter-spacing: 0.03em;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--saffron), var(--amber), var(--saffron));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 16px 0 16px 20px;
    border-bottom: 1px solid rgba(200, 133, 30, 0.15);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 22px;
    width: 14px;
    height: 14px;
    background: var(--crimson);
    border-radius: 50%;
    border: 3px solid var(--cream);
    box-shadow: 0 2px 8px rgba(155, 35, 53, 0.3);
}

.timeline-year {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--amber);
    display: block;
}

.timeline-event {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.95rem;
    color: var(--smoke);
}

/* --- Stat Seals --- */
.stat-seals {
    display: flex;
    gap: 24px;
    margin-top: 28px;
}

.stat-seal {
    text-align: center;
    padding: 24px 20px;
    background: radial-gradient(circle at 45% 40%, rgba(155, 35, 53, 0.1), transparent 70%);
    border: 2px solid rgba(155, 35, 53, 0.2);
    border-radius: 50%;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(155, 35, 53, 0.1);
    transition: transform 0.3s ease;
}

.stat-seal:hover {
    transform: scale(1.06);
}

.stat-number {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--crimson);
    line-height: 1;
}

.stat-desc {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bronze);
    margin-top: 6px;
}

/* --- Closing Chamber --- */
.chamber-closing {
    background: radial-gradient(ellipse at 50% 50%, var(--saffron) 0%, var(--amber) 30%, var(--mahogany) 80%, var(--smoke) 100%);
    color: var(--cream);
}

.chamber-closing .chamber-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.closing-seal-scene {
    width: 340px;
    height: 340px;
    margin-bottom: 40px;
    animation: pulseSeal 4s ease-in-out infinite;
}

@keyframes pulseSeal {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

.closing-seal-svg {
    width: 100%;
    height: 100%;
}

.closing-headline {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--cream);
    margin-bottom: 16px;
}

.closing-body {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--saffron);
    max-width: 500px;
    margin: 0 auto 32px;
}

/* --- Inflated Button --- */
.inflated-button {
    position: relative;
    display: inline-block;
    padding: 18px 48px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mahogany);
    background: linear-gradient(145deg, var(--saffron), var(--amber));
    border: none;
    border-radius: 60px;
    cursor: pointer;
    box-shadow:
        0 8px 28px rgba(200, 133, 30, 0.4),
        0 2px 8px rgba(59, 26, 10, 0.15),
        inset 0 2px 4px rgba(250, 244, 230, 0.5),
        inset 0 -3px 6px rgba(139, 94, 60, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: hidden;
}

.inflated-button:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 14px 40px rgba(200, 133, 30, 0.5),
        0 4px 12px rgba(59, 26, 10, 0.2),
        inset 0 2px 4px rgba(250, 244, 230, 0.6),
        inset 0 -3px 6px rgba(139, 94, 60, 0.2);
}

.inflated-button:active {
    transform: translateY(0) scale(0.98);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(250, 244, 230, 0.4), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    pointer-events: none;
}

.inflated-button:hover .btn-glow {
    width: 200px;
    height: 200px;
}

/* --- Column Capitals --- */
.column-capital {
    position: fixed;
    bottom: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.6;
}

.capital-left {
    left: 0;
}

.capital-right {
    right: 0;
    transform: scaleX(-1);
}

.capital-svg {
    width: 60px;
    height: 180px;
}

/* --- Mobile Responsive --- */
@media (max-width: 900px) {
    .seal-nav {
        left: 12px;
    }

    .seal-nav-trigger {
        width: 44px;
        height: 44px;
    }

    .chamber-content {
        padding: 60px 24px;
    }

    .broken-grid {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .block-text {
        padding: 32px 24px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .block-text.block-offset-left,
    .block-text.block-offset-right,
    .block-text.block-wide {
        grid-column: 1 / -1;
        margin-left: 0;
        margin-right: 0;
    }

    .block-render.block-offset-right,
    .block-render.block-offset-left {
        grid-column: 1 / -1;
    }

    .block-timeline {
        grid-column: 1 / -1;
    }

    .rotate-neg,
    .rotate-pos,
    .rotate-neg-sm,
    .rotate-pos-sm {
        transform: none;
    }

    .rotate-neg .rotate-inner,
    .rotate-pos .rotate-inner,
    .rotate-neg-sm .rotate-inner,
    .rotate-pos-sm .rotate-inner {
        transform: none;
    }

    .hero-3d-scene {
        width: 240px;
        height: 260px;
    }

    .inflated-cards {
        flex-direction: column;
    }

    .stat-seals {
        justify-content: center;
    }

    .column-capital {
        display: none;
    }

    .closing-seal-scene {
        width: 260px;
        height: 260px;
    }

    .render-seal,
    .render-parchment,
    .render-globe {
        max-width: 240px;
    }
}

@media (max-width: 480px) {
    .hero-headline {
        font-size: 2.2rem;
    }

    .section-headline {
        font-size: 1.5rem;
    }

    .seal-nav {
        left: 8px;
    }

    .chamber-content {
        padding: 40px 16px;
    }
}
