/* ============================================
   political.wiki - Seapunk Political Knowledge
   ============================================ */

/* Color Palette:
   Deep kelp:       #0A2818
   Ocean teal:      #208868
   Bubble cyan:     #40D8C8
   Bioluminescent:  #80F0D0
   Sand cream:      #E8E0C8
   HUD green:       #30C870
   Coral warm:      #D08060
*/

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.85;
    color: #E8E0C8;
    background-color: #0A2818;
    overflow-x: hidden;
}

/* ---- Seapunk Bubbles ---- */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    animation: bubbleRise linear infinite;
    opacity: 0;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--bubble-opacity, 0.3);
    }
    90% {
        opacity: var(--bubble-opacity, 0.3);
    }
    100% {
        transform: translateY(calc(-100vh - 50px)) translateX(var(--bubble-drift, 20px));
        opacity: 0;
    }
}

/* ---- HUD Frame Elements ---- */
.hud-frame {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: 2;
    opacity: 0;
}

.hud-frame-tl { top: 24px; left: 24px; }
.hud-frame-tr { top: 24px; right: 24px; }
.hud-frame-bl { bottom: 100px; left: 24px; }
.hud-frame-br { bottom: 100px; right: 24px; }

.hud-draw {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: hudDraw 1000ms ease-out forwards;
    animation-delay: 400ms;
}

@keyframes hudDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.hud-dot {
    opacity: 0;
    animation: hudDotAppear 300ms ease-out forwards;
    animation-delay: 1200ms;
}

@keyframes hudDotAppear {
    to {
        opacity: 1;
    }
}

.hud-gauge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    opacity: 0.15;
    z-index: 0;
    animation: gaugeAppear 1500ms ease-out forwards;
    animation-delay: 200ms;
}

@keyframes gaugeAppear {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8) rotate(-10deg); }
    to { opacity: 0.15; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

/* ---- Ocean Surface Hero ---- */
#ocean-surface {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0A2818;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(32, 136, 104, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(64, 216, 200, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(48, 200, 112, 0.06) 0%, transparent 40%);
    overflow: hidden;
    z-index: 2;
}

.hero-content {
    text-align: center;
    z-index: 3;
    opacity: 0;
    animation: heroFadeIn 800ms ease-out forwards;
    animation-delay: 200ms;
    padding: 0 24px;
    max-width: 800px;
}

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

.site-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    letter-spacing: 0.01em;
    color: #E8E0C8;
    margin-bottom: 8px;
}

.site-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: clamp(16px, 1.8vw, 24px);
    color: #40D8C8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.site-description {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.85;
    color: #E8E0C8;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- HUD Metadata Bars ---- */
.hud-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hud-meta-top {
    margin-bottom: 32px;
}

.hud-meta-bottom {
    margin-top: 32px;
}

.hud-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #30C870;
}

.hud-separator {
    color: #208868;
    font-size: 12px;
}

/* ---- Wave Dividers ---- */
.wave-divider {
    width: 100%;
    height: 60px;
    position: relative;
    z-index: 2;
}

.wave-divider-hero {
    position: absolute;
    bottom: 0;
    left: 0;
    clip-path: polygon(
        0% 100%,
        0% 60%,
        2% 58%, 4% 55%, 6% 50%, 8% 44%, 10% 40%, 12% 38%,
        14% 38%, 16% 40%, 18% 44%, 20% 48%, 22% 50%, 24% 50%,
        26% 48%, 28% 44%, 30% 38%, 32% 34%, 34% 32%, 36% 32%,
        38% 34%, 40% 38%, 42% 44%, 44% 48%, 46% 50%, 48% 50%,
        50% 48%, 52% 44%, 54% 38%, 56% 34%, 58% 32%, 60% 32%,
        62% 34%, 64% 38%, 66% 44%, 68% 48%, 70% 50%, 72% 50%,
        74% 48%, 76% 44%, 78% 38%, 80% 34%, 82% 32%, 84% 32%,
        86% 34%, 88% 38%, 90% 44%, 92% 48%, 94% 50%, 96% 50%,
        98% 48%, 100% 44%,
        100% 100%
    );
    background: linear-gradient(180deg, #208868 0%, #0A2818 100%);
    opacity: 0.6;
}

.wave-divider-top {
    clip-path: polygon(
        0% 0%,
        0% 50%,
        3% 48%, 6% 42%, 9% 35%, 12% 30%, 15% 28%, 18% 30%,
        21% 35%, 24% 42%, 27% 48%, 30% 50%, 33% 48%, 36% 42%,
        39% 35%, 42% 30%, 45% 28%, 48% 30%, 51% 35%, 54% 42%,
        57% 48%, 60% 50%, 63% 48%, 66% 42%, 69% 35%, 72% 30%,
        75% 28%, 78% 30%, 81% 35%, 84% 42%, 87% 48%, 90% 50%,
        93% 48%, 96% 42%, 100% 35%,
        100% 0%
    );
    background: linear-gradient(0deg, #208868 0%, #0A2818 100%);
    opacity: 0.5;
}

.wave-divider-bottom {
    clip-path: polygon(
        0% 100%,
        0% 50%,
        3% 52%, 6% 58%, 9% 65%, 12% 70%, 15% 72%, 18% 70%,
        21% 65%, 24% 58%, 27% 52%, 30% 50%, 33% 52%, 36% 58%,
        39% 65%, 42% 70%, 45% 72%, 48% 70%, 51% 65%, 54% 58%,
        57% 52%, 60% 50%, 63% 52%, 66% 58%, 69% 65%, 72% 70%,
        75% 72%, 78% 70%, 81% 65%, 84% 58%, 87% 52%, 90% 50%,
        93% 52%, 96% 58%, 100% 65%,
        100% 100%
    );
    background: linear-gradient(180deg, #208868 0%, #0A2818 100%);
    opacity: 0.5;
}

.wave-divider-footer {
    clip-path: polygon(
        0% 0%,
        0% 70%,
        4% 65%, 8% 55%, 12% 45%, 16% 40%, 20% 38%, 24% 40%,
        28% 45%, 32% 55%, 36% 60%, 40% 62%, 44% 60%, 48% 55%,
        52% 45%, 56% 40%, 60% 38%, 64% 40%, 68% 45%, 72% 55%,
        76% 60%, 80% 62%, 84% 60%, 88% 55%, 92% 45%, 96% 40%,
        100% 38%,
        100% 0%
    );
    background: linear-gradient(0deg, #0A2818 0%, #208868 100%);
    opacity: 0.4;
    height: 50px;
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 24px;
}

.section-hud-line {
    flex: 1;
    height: 2px;
    opacity: 0.5;
}

.section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 36px);
    letter-spacing: 0.01em;
    color: #E8E0C8;
    white-space: nowrap;
}

/* ---- Card Grid ---- */
#article-grid,
#topics-grid {
    position: relative;
    z-index: 2;
    padding: 80px 24px;
    background: #0A2818;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.wiki-card {
    background: rgba(10, 40, 24, 0.9);
    border: 1px solid #208868;
    border-radius: 4px;
    overflow: hidden;
    padding: 0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: borderAnimate 6s linear infinite;
}

.wiki-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 300ms ease, transform 300ms ease, box-shadow 0.3s ease;
}

@keyframes borderAnimate {
    0%   { border-color: #0A2818; }
    33%  { border-color: #208868; }
    66%  { border-color: #40D8C8; }
    100% { border-color: #0A2818; }
}

.wiki-card:hover {
    box-shadow: 0 0 20px rgba(128, 240, 208, 0.2), 0 0 40px rgba(128, 240, 208, 0.1);
    transform: translateY(-2px);
    animation-duration: 2s;
}

/* Card Image - Duotone treatment */
.card-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.8) sepia(0.2) hue-rotate(120deg) brightness(0.8);
    transition: filter 0.3s ease;
}

.wiki-card:hover .card-image {
    filter: grayscale(0.5) sepia(0.3) hue-rotate(90deg) brightness(0.9);
}

/* Card HUD bar */
.card-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(32, 136, 104, 0.3);
}

.card-category {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #30C870;
}

.card-date {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: #208868;
}

.card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 18px;
    color: #E8E0C8;
    padding: 16px 16px 8px;
    line-height: 1.3;
}

.card-preview {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 15px);
    line-height: 1.7;
    color: #E8E0C8;
    opacity: 0.75;
    padding: 0 16px 16px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid rgba(32, 136, 104, 0.2);
}

.card-stat,
.card-contributors {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #208868;
}

.wiki-card:hover .card-hud {
    border-bottom-color: rgba(64, 216, 200, 0.4);
}

.wiki-card:hover .card-category {
    color: #40D8C8;
}

/* ---- Deep Dive Section ---- */
#deep-dive {
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg,
        #0A2818 0%,
        rgba(32, 136, 104, 0.15) 20%,
        rgba(32, 136, 104, 0.15) 80%,
        #0A2818 100%
    );
    padding: 0;
}

.deep-dive-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.deep-dive-hud {
    margin-bottom: 40px;
    position: relative;
}

.deep-dive-hud-svg {
    width: 300px;
    max-width: 100%;
    height: auto;
    margin-bottom: 24px;
    opacity: 0.7;
}

.deep-dive-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #208868;
}

.stat-value {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 16px;
    color: #40D8C8;
}

.deep-dive-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(22px, 2.5vw, 36px);
    letter-spacing: 0.01em;
    color: #E8E0C8;
    margin-bottom: 24px;
}

.deep-dive-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.85;
    color: #E8E0C8;
    opacity: 0.85;
    max-width: 700px;
    margin: 0 auto 32px;
}

/* Spectrum SVG */
.spectrum-visual {
    width: 100%;
    max-width: 650px;
    margin: 32px auto;
    padding: 16px;
    border: 1px solid rgba(32, 136, 104, 0.3);
    border-radius: 4px;
    background: rgba(10, 40, 24, 0.5);
}

.spectrum-svg {
    width: 100%;
    height: auto;
}

.spectrum-node {
    animation: spectrumPulse 3s ease-in-out infinite alternate;
}

@keyframes spectrumPulse {
    0% { opacity: 0.2; r: 3; }
    100% { opacity: 0.6; r: 6; }
}

/* ---- Footer / Reference Pool ---- */
#reference-pool {
    position: relative;
    z-index: 2;
    background: #0A2818;
    padding-top: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

.footer-hud-frame {
    text-align: center;
    margin-bottom: 40px;
}

.footer-hud-svg {
    width: 500px;
    max-width: 100%;
    height: auto;
    opacity: 0.5;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 16px;
    color: #40D8C8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-links li {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 14px;
    color: #E8E0C8;
    opacity: 0.7;
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
    letter-spacing: 0.02em;
}

.footer-links li:hover {
    color: #80F0D0;
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid rgba(32, 136, 104, 0.3);
    padding-top: 24px;
    text-align: center;
}

/* ---- HUD Frame Animations ---- */
.hud-frame {
    transition: opacity 0.5s ease;
}

.hud-frame.visible {
    opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hud-frame {
        width: 50px;
        height: 50px;
    }

    .hud-gauge {
        width: 300px;
        height: 300px;
    }

    .deep-dive-stats {
        gap: 24px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        gap: 12px;
    }

    .hud-meta {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section-hud-line {
        display: none;
    }
}
