/* tanso.wiki - Carbon Dreamscape - Translucent Frost Palette */
:root {
    --carbon-bg: #0a1118;
    --frost-glass: rgba(180, 210, 230, 0.07);
    --diamond-mist: rgba(200, 225, 240, 0.12);
    --text-primary: #d6e4ed;
    --text-heading: #c8dce8;
    --accent-warm: #d4a574;
    --accent-cool: #7eb8d4;
    --phantom-glow: #3a6080;
    --ice-edge: rgba(160, 200, 220, 0.15);
    --blur-radius: 16px;
    --panel-radius: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--carbon-bg);
    color: var(--text-primary);
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ===== LATTICE BACKGROUND ===== */
#lattice-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 0;
    opacity: 0;
    transition: opacity 2s ease;
}

#lattice-bg.visible {
    opacity: 1;
}

#hex-lattice {
    width: 100%;
    height: 100%;
    animation: lattice-rotate 720s linear infinite;
}

@keyframes lattice-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== SECTIONS / ACTS ===== */
.act {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12vh 5vw;
}

/* ===== ACT 1: THE VOID ===== */
#act-void {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-center {
    text-align: center;
}

.title-tanso {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-variation-settings: 'wght' 100;
    color: var(--text-heading);
    letter-spacing: 0.12em;
    text-transform: lowercase;
    opacity: 0;
    transition: font-variation-settings 2.5s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 2s ease;
}

.title-tanso.condensed {
    font-variation-settings: 'wght' 400;
    opacity: 1;
}

.subtitle-kanji {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #e8f0f6;
    opacity: 0;
    transition: opacity 2s ease 1.5s;
    letter-spacing: 0.08em;
}

.subtitle-kanji.visible {
    opacity: 0.7;
}

/* ===== CONTENT RIVER ===== */
.content-river {
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8vh;
}

/* ===== HEXAGONAL GLASS PANELS ===== */
.hex-panel {
    position: relative;
    background: linear-gradient(135deg, rgba(180, 210, 230, 0.05), rgba(160, 190, 210, 0.10));
    backdrop-filter: blur(16px) saturate(1.4) brightness(1.05);
    -webkit-backdrop-filter: blur(16px) saturate(1.4) brightness(1.05);
    border: 1px solid var(--ice-edge);
    border-radius: var(--panel-radius);
    padding: 2.5rem 2.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateX(var(--drift, 0));
    animation: panel-breathe 8s ease-in-out infinite;
    clip-path: polygon(8% 0%, 92% 0%, 100% 15%, 100% 85%, 92% 100%, 8% 100%, 0% 85%, 0% 15%);
}

@keyframes panel-breathe {
    0%, 100% { transform: translateX(var(--drift, 0)) scale(1); }
    50% { transform: translateX(var(--drift, 0)) scale(1.003); }
}

/* ===== REVEAL ANIMATION ===== */
.reveal-panel {
    opacity: 0;
    filter: blur(8px);
    transform: translateX(var(--drift, 0)) translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                filter 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-panel.revealed {
    opacity: 1;
    filter: blur(0);
    transform: translateX(var(--drift, 0)) translateY(0);
}

/* ===== FROST BLOOM EFFECT ===== */
.hex-panel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(200, 225, 240, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.hex-panel.frost-bloom::before {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
}

/* ===== TYPOGRAPHY ===== */
h2 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    font-variation-settings: 'wght' 200;
    color: var(--text-heading);
    letter-spacing: 0.06em;
    line-height: 1.15;
    text-transform: lowercase;
    margin-bottom: 1.5rem;
    transition: font-variation-settings 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

h2.in-view {
    font-variation-settings: 'wght' 500;
}

h3 {
    font-family: 'Geologica', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-variation-settings: 'wght' 300;
    color: var(--text-heading);
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin-bottom: 1rem;
    transition: font-variation-settings 1s ease;
}

p {
    max-width: 52ch;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p:last-child {
    margin-bottom: 0;
}

.formula {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--accent-cool);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    color: #e8f0f6;
    line-height: 1.4;
    border: none;
    padding: 1.5rem 0;
    margin: 1.5rem 0;
}

.ember-text {
    color: var(--accent-warm);
    opacity: 0.85;
}

/* ===== SECTION TITLES ===== */
.section-title {
    text-align: center;
    width: 100%;
    max-width: none;
}

.section-subtitle {
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #e8f0f6;
    opacity: 0.6;
    margin-bottom: 6vh;
}

/* ===== ALLOTROPE SECTION ===== */
.allotrope-header {
    text-align: center;
    margin-bottom: 6vh;
    width: 100%;
}

.allotrope-cluster {
    display: flex;
    flex-direction: column;
    gap: 6vh;
    max-width: 900px;
    width: 100%;
}

.allotrope-panel {
    position: relative;
}

.allotrope-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
}

.allotrope-svg {
    width: 100%;
    height: 100%;
    animation: svg-pulse 6s ease-in-out infinite;
}

@keyframes svg-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

.allotrope-transition-svg {
    width: 100%;
    max-width: 600px;
    margin: 4vh auto;
    opacity: 0.5;
}

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

/* ===== NATURE SVG ===== */
.nature-carbon-svg {
    width: 100%;
    max-width: 400px;
    margin: 2vh auto;
    transform: translateX(var(--drift, 0));
}

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

/* ===== CYCLE SECTION ===== */
.cycle-river {
    gap: 6vh;
}

/* ===== FUTURE SECTION ===== */
.future-river {
    gap: 6vh;
}

.future-panel {
    background: linear-gradient(135deg, rgba(180, 210, 230, 0.05), rgba(212, 165, 116, 0.04), rgba(160, 190, 210, 0.10));
}

/* ===== CODA ===== */
.coda-panel {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 8vh auto 0;
}

.coda-hex {
    text-align: center;
}

.coda-quote {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    max-width: 48ch;
    margin: 0 auto;
    padding: 2rem 0;
}

/* ===== HEXAGONAL NAVIGATION ===== */
#hex-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 1s ease;
}

#hex-nav.visible {
    opacity: 1;
}

.hex-nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(180, 210, 230, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(160, 200, 220, 0.15);
    border-radius: 8px;
    color: var(--accent-cool);
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-nav-btn:hover {
    background: rgba(200, 225, 240, 0.15);
    color: var(--accent-warm);
    transform: scale(1.1);
}

.hex-nav-btn svg {
    width: 32px;
    height: 32px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .act {
        padding: 8vh 4vw;
    }

    .hex-panel {
        padding: 1.8rem 1.5rem;
        clip-path: polygon(4% 0%, 96% 0%, 100% 8%, 100% 92%, 96% 100%, 4% 100%, 0% 92%, 0% 8%);
        --drift: 0 !important;
    }

    .reveal-panel {
        --drift: 0 !important;
    }

    .allotrope-cluster {
        gap: 4vh;
    }

    .content-river {
        gap: 5vh;
    }

    #hex-nav {
        bottom: 1rem;
        right: 1rem;
    }

    .hex-nav-btn {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .hex-panel {
        padding: 1.4rem 1.2rem;
    }

    .allotrope-icon {
        width: 70px;
        height: 70px;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--carbon-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--phantom-glow);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cool);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(126, 184, 212, 0.3);
    color: #e8f0f6;
}
