/* ================================================
   political.quest - Aurora Governance Landscape
   Japanese-minimal aesthetic with aurora-light motifs
   ================================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-ground: #0B1026;
    --sky-layer: #152042;
    --aurora-green: #2DFFC3;
    --aurora-violet: #8B5CF6;
    --aurora-pink: #F472B6;
    --text-primary: #E8ECF4;
    --text-secondary: #8B95A8;
    --divider: #1E2A4A;
    --bg-temperature: #0B1026;
}

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

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

body {
    background-color: var(--bg-temperature);
    color: var(--text-primary);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

/* --- Viewport Sections --- */
.viewport-section {
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* --- Hero Section --- */
#hero {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
}

#aurora-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hero-title {
    position: relative;
    z-index: 2;
    padding-left: 8%;
    padding-bottom: 15%;
}

.hero-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: 0.03em;
    color: var(--text-primary);
    line-height: 1.1;
}

.hero-dot {
    color: var(--aurora-green);
    text-shadow: 0 0 20px rgba(45, 255, 195, 0.5), 0 0 40px rgba(45, 255, 195, 0.2);
}

.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    margin-top: 1rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Data Garden Sections --- */
.data-garden {
    display: flex;
    align-items: center;
    padding: 15vh 0;
}

.garden-pair {
    display: grid;
    grid-template-columns: minmax(60px, 3fr) 7fr 2fr;
    gap: 40px;
    width: 100%;
    max-width: 1400px;
    padding: 0 5%;
}

.garden-pair--reversed {
    grid-template-columns: 2fr 7fr minmax(60px, 3fr);
}

.garden-pair--reversed .vertical-label-col {
    order: 2;
}

.garden-pair--reversed .content-col {
    order: 1;
}

.vertical-label-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    opacity: 0.7;
}

.content-col {
    max-width: 800px;
}

.section-intro {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--text-secondary);
    margin-bottom: 60px;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.section-intro.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Ink-Wash Bar Charts --- */
.ink-wash-chart {
    padding: 20px 0;
}

.bar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 16px;
}

.bar-label:first-child {
    margin-top: 0;
}

.bar-track {
    width: 100%;
    height: 8px;
    background: var(--divider);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    width: 0;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--aurora-green), var(--aurora-violet), transparent);
    mix-blend-mode: screen;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: -4px;
    right: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--aurora-green);
    filter: blur(6px);
    opacity: 0.5;
}

/* --- Constellation Charts --- */
.constellation-chart {
    width: 100%;
    padding: 20px 0;
}

.constellation-svg {
    width: 100%;
    height: auto;
    max-height: 400px;
}

.constellation-point {
    fill: var(--aurora-green);
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.constellation-point.visible {
    opacity: 1;
    transform: scale(1);
}

.constellation-line {
    stroke: var(--aurora-green);
    stroke-width: 0.5;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}

.constellation-line.visible {
    opacity: 0.15;
}

/* --- Aurora Field Sections --- */
.aurora-field {
    position: relative;
    overflow: hidden;
}

.karesansui-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 600px 300px at 30% 40%, rgba(45, 255, 195, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse 400px 200px at 70% 60%, rgba(139, 92, 246, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 250px at 50% 50%, rgba(244, 114, 182, 0.02) 0%, transparent 70%);
}

.karesansui-bg--alt {
    background:
        radial-gradient(ellipse 500px 250px at 60% 30%, rgba(139, 92, 246, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 600px 300px at 20% 70%, rgba(45, 255, 195, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse 400px 200px at 80% 50%, rgba(244, 114, 182, 0.03) 0%, transparent 70%);
}

.floating-element {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 1s ease, transform 0.3s ease;
}

.floating-element.visible {
    opacity: 1;
}

.fe-1 { top: 12%; left: 8%; }
.fe-2 { top: 35%; left: 55%; }
.fe-3 { top: 60%; left: 20%; }
.fe-4 { top: 18%; left: 72%; }
.fe-5 { top: 72%; left: 60%; }
.fe-6 { top: 15%; left: 15%; }
.fe-7 { top: 50%; left: 45%; }
.fe-8 { top: 30%; left: 75%; }

.mini-chart {
    width: 200px;
    height: 120px;
}

.aurora-ribbon-svg {
    fill: none;
    stroke: var(--aurora-green);
    stroke-width: 2;
    opacity: 0.5;
    filter: blur(1px);
}

.aurora-ribbon-svg.ribbon-2 {
    stroke: var(--aurora-violet);
    opacity: 0.35;
    filter: blur(2px);
}

.aurora-ribbon-svg.ribbon-3 {
    stroke: var(--aurora-pink);
    opacity: 0.25;
    filter: blur(3px);
}

.data-annotation {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
}

.scatter-cluster {
    width: 180px;
    height: 120px;
    position: relative;
}

.scatter-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--aurora-green);
    box-shadow: 0 0 8px rgba(45, 255, 195, 0.4);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scatter-dot.visible {
    opacity: 1;
    transform: scale(1);
}

.scatter-dot.violet {
    background: var(--aurora-violet);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.scatter-dot.pink {
    background: var(--aurora-pink);
    box-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

/* Floating element drift animations */
@keyframes drift-1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(3px, -2px); }
    50% { transform: translate(-2px, 3px); }
    75% { transform: translate(2px, 1px); }
}

@keyframes drift-2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 2px); }
    50% { transform: translate(2px, -3px); }
    75% { transform: translate(-1px, -2px); }
}

@keyframes drift-3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2px, 3px); }
    50% { transform: translate(-3px, -1px); }
    75% { transform: translate(1px, -3px); }
}

.fe-1.visible, .fe-4.visible, .fe-7.visible {
    animation: drift-1 12s ease-in-out infinite;
}

.fe-2.visible, .fe-5.visible, .fe-8.visible {
    animation: drift-2 10s ease-in-out infinite;
}

.fe-3.visible, .fe-6.visible {
    animation: drift-3 14s ease-in-out infinite;
}

/* --- Coda Section --- */
#coda {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 8%;
    position: relative;
}

.coda-domain {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
}

.coda-domain-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--divider);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.5;
}

.coda-statement {
    text-align: right;
    max-width: 400px;
}

.coda-haiku {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--text-secondary);
    line-height: 2;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.coda-haiku.visible {
    opacity: 1;
}

/* --- Aurora Ribbons Overlay --- */
.aurora-ribbons-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.ribbon-path {
    fill: none;
    stroke-width: 3;
    opacity: 0.4;
}

/* --- Text Reveal Animations --- */
.char-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.char-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

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

::-webkit-scrollbar-track {
    background: var(--deep-ground);
}

::-webkit-scrollbar-thumb {
    background: var(--divider);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--aurora-green);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .garden-pair,
    .garden-pair--reversed {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .garden-pair--reversed .vertical-label-col {
        order: 0;
    }

    .garden-pair--reversed .content-col {
        order: 0;
    }

    .vertical-label {
        writing-mode: horizontal-tb;
    }

    #hero-title {
        padding-left: 6%;
        padding-bottom: 25%;
    }

    .floating-element {
        transform: scale(0.8);
    }

    .fe-1 { top: 5%; left: 5%; }
    .fe-2 { top: 25%; left: 50%; }
    .fe-3 { top: 50%; left: 10%; }
    .fe-4 { top: 10%; left: 65%; }
    .fe-5 { top: 70%; left: 40%; }
    .fe-6 { top: 10%; left: 10%; }
    .fe-7 { top: 45%; left: 35%; }
    .fe-8 { top: 25%; left: 65%; }

    .coda-statement {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .mini-chart {
        width: 140px;
        height: 84px;
    }

    .scatter-cluster {
        width: 120px;
        height: 80px;
    }
}