/* tanso.group - Cottagecore meets Neon-Electric Carbon Collective */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --coal-black: #0d0d0d;
    --deep-soil: #1a1209;
    --neon-carbon: #39ff14;
    --electric-amber: #ffb627;
    --combustion-magenta: #ff2d6f;
    --warm-parchment: #c4b99a;
    --deep-earth: #2a2017;
    --moss-slate: #2c3227;
    --photosynthesis-green: #00e676;
    --ease-reveal: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --left-width: 42%;
    --right-width: 58%;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background: var(--coal-black);
    color: var(--warm-parchment);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Earth Panel (Left, Fixed)
   ============================================ */
#earth-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--left-width);
    height: 100vh;
    background: var(--deep-soil);
    z-index: 10;
    overflow: hidden;
}

#earth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
}

#earth-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(57, 255, 20, 0.06), transparent 60%);
    pointer-events: none;
    z-index: 2;
}

#earth-panel-inner {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: clamp(2rem, 4vw, 4rem);
}

/* Carbon Ring Mark */
#carbon-ring-mark {
    position: relative;
    margin-bottom: 1.5rem;
}

#carbon-ring-svg {
    display: block;
}

#carbon-ring-mark:hover #carbon-ring-svg circle,
#carbon-ring-mark:hover #carbon-ring-svg line {
    filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.8));
}

#ring-glow {
    position: absolute;
    top: 50%;
    left: 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(57, 255, 20, 0.15);
    transform: translate(-50%, -50%);
    animation: ringPulse 4s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.5); }
}

/* Site Name */
#site-name {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-parchment);
    margin-bottom: 2.5rem;
}

/* Navigation */
#main-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: auto;
}

.nav-link {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-parchment);
    text-decoration: none;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.3s var(--ease-reveal);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--electric-amber);
    transition: width 0.3s var(--ease-reveal);
}

.nav-link:hover {
    color: var(--neon-carbon);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--neon-carbon);
}

.nav-link.active::after {
    width: 100%;
    background: var(--neon-carbon);
}

/* Growing Vine */
#vine-container {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    padding-bottom: 120px;
    overflow: hidden;
}

#vine-svg {
    width: 100%;
    max-height: 400px;
}

.vine-main {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: vineGrow 120s linear forwards;
}

.vine-leaf {
    opacity: 0;
}

.vine-leaf-1 { animation: leafAppear 2s var(--ease-reveal) 20s forwards; }
.vine-leaf-2 { animation: leafAppear 2s var(--ease-reveal) 40s forwards; }
.vine-leaf-3 { animation: leafAppear 2s var(--ease-reveal) 60s forwards; }
.vine-leaf-4 { animation: leafAppear 2s var(--ease-reveal) 80s forwards; }

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

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

/* City Skyline */
#city-skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    pointer-events: none;
}

#skyline-svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Organic Divider
   ============================================ */
#organic-divider {
    position: fixed;
    top: 0;
    left: var(--left-width);
    width: 20px;
    height: 100vh;
    z-index: 15;
    transform: translateX(-50%);
}

#divider-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 4px rgba(0, 230, 118, 0.3));
    animation: dividerBreath 20s ease-in-out infinite;
}

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

/* ============================================
   Mobile Header (hidden on desktop)
   ============================================ */
#mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--deep-soil);
    z-index: 100;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 2px solid var(--moss-slate);
}

#mobile-ring {
    display: flex;
    align-items: center;
}

#mobile-title {
    font-family: 'Courier Prime', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-parchment);
    margin-left: 0.75rem;
    flex: 1;
}

#mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

#mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--warm-parchment);
    transition: all 0.3s var(--ease-reveal);
}

#mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

#mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Mobile Nav */
#mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--deep-soil);
    z-index: 99;
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 2px solid var(--moss-slate);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s var(--ease-reveal), opacity 0.3s var(--ease-reveal);
}

#mobile-nav.open {
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-link {
    font-family: 'Courier Prime', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--warm-parchment);
    text-decoration: none;
    padding: 0.5rem 0;
}

.mobile-nav-link:hover {
    color: var(--neon-carbon);
}

/* ============================================
   Electric Panel (Right, Scrollable)
   ============================================ */
#electric-panel {
    margin-left: var(--left-width);
    width: var(--right-width);
    min-height: 100vh;
    position: relative;
}

/* ============================================
   Strata Sections
   ============================================ */
.stratum {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 4vw, 4rem);
    padding-left: clamp(2rem, 4vw, 4rem);
    position: relative;
}

.stratum-content {
    max-width: 800px;
    width: 100%;
}

/* Collective section special background */
.stratum-collective-bg {
    background: var(--deep-soil);
}

/* ============================================
   Typography
   ============================================ */
.stratum-headline {
    font-family: 'Righteous', cursive;
    font-size: clamp(2.4rem, 5.5vw, 4.8rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--neon-carbon);
    line-height: 1.1;
    margin-bottom: 2rem;
}

.stratum-subheadline {
    font-family: 'Righteous', cursive;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--neon-carbon);
    line-height: 1.2;
    margin-bottom: 2rem;
}

.body-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--warm-parchment);
    margin-bottom: 1.25rem;
}

.body-text-large {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

/* Typewriter text in origin */
.typewriter-text {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    letter-spacing: 0.02em;
    color: var(--warm-parchment);
    line-height: 1.6;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--neon-carbon);
    width: 0;
    max-width: 100%;
}

.typewriter-text.typing {
    animation: typewrite 4s steps(40, end) forwards, blinkCursor 0.7s steps(1) infinite;
}

.typewriter-text.typed {
    width: 100%;
    white-space: normal;
    border-right: 2px solid transparent;
}

@keyframes typewrite {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    0%, 100% { border-color: var(--neon-carbon); }
    50% { border-color: transparent; }
}

/* ============================================
   Interstitials
   ============================================ */
.interstitial {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: clamp(2rem, 4vw, 4rem);
    background: var(--coal-black);
}

.interstitial-text {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    letter-spacing: 0.04em;
    color: var(--neon-carbon);
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--neon-carbon);
    width: 0;
    max-width: 100%;
}

.interstitial-text.typing {
    animation: typewrite 3s steps(60, end) forwards, blinkCursor 0.7s steps(1) infinite;
}

.interstitial-text.typed {
    width: 100%;
    opacity: 0.4;
    border-right: 2px solid transparent;
    white-space: normal;
    transition: opacity 1s var(--ease-reveal);
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-reveal), transform 0.8s var(--ease-reveal);
}

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

/* ============================================
   Section Illustrations
   ============================================ */
.section-illustration {
    margin-bottom: 2rem;
    max-width: 400px;
}

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

.draw-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 3s var(--ease-reveal);
}

.reveal-element.visible .draw-path {
    stroke-dashoffset: 0;
}

/* ============================================
   Allotropes Row
   ============================================ */
.allotrope-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.allotrope-item {
    flex: 1;
    min-width: 120px;
    max-width: 160px;
    text-align: left;
}

.allotrope-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease-out;
}

.allotrope-item:hover .allotrope-icon {
    transform: scale(1.15);
}

.allotrope-item:hover .allotrope-icon * {
    stroke: var(--electric-amber);
}

.allotrope-label {
    display: block;
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--electric-amber);
    margin-bottom: 0.4rem;
}

.allotrope-desc {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--warm-parchment);
    opacity: 0.8;
}

/* ============================================
   Graphene Pattern
   ============================================ */
.graphene-pattern {
    margin-top: 2rem;
    overflow: hidden;
    max-width: 100%;
}

.graphene-svg {
    width: 100%;
    height: auto;
    opacity: 0.5;
}

.hex-cell {
    opacity: 0;
}

.graphene-pattern.visible .hex-cell {
    animation: hexAppear 0.6s var(--ease-reveal) forwards;
}

@keyframes hexAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Carbon Cycle
   ============================================ */
.cycle-illustration {
    max-width: 500px;
    margin-bottom: 2rem;
}

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

.cycle-ring {
    transition: stroke-dashoffset 2s var(--ease-reveal);
}

.reveal-element.visible .cycle-ring {
    stroke-dashoffset: 0;
}

.cycle-label {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ============================================
   Dual Columns (Crisis & Frontier)
   ============================================ */
.dual-columns {
    display: flex;
    gap: 4%;
    margin-top: 2rem;
}

.dual-col {
    flex: 0 0 48%;
}

.dual-heading {
    font-family: 'Righteous', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.crisis-heading {
    color: var(--combustion-magenta);
}

.frontier-heading {
    color: var(--neon-carbon);
}

.crisis-accent {
    color: var(--combustion-magenta);
    font-weight: 600;
}

.frontier-accent {
    color: var(--neon-carbon);
    font-weight: 600;
}

/* ============================================
   Collective Contact
   ============================================ */
.collective-contact {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
}

.contact-email {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1.05rem);
    letter-spacing: 0.04em;
    color: var(--neon-carbon);
}

/* ============================================
   Hex-pattern background on left panel
   ============================================ */
#earth-panel-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' viewBox='0 0 60 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='30,2 56,15 56,37 30,50 4,37 4,15' stroke='%2339ff14' stroke-width='0.5' fill='none' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 60px 52px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Mobile Styles
   ============================================ */
@media (max-width: 768px) {
    #earth-panel,
    #organic-divider {
        display: none;
    }

    #mobile-header {
        display: flex;
    }

    #mobile-nav {
        display: flex;
    }

    #electric-panel {
        margin-left: 0;
        width: 100%;
        padding-top: 64px;
    }

    .stratum {
        padding: 2rem 1.5rem;
    }

    .interstitial {
        padding: 2rem 1.5rem;
    }

    .dual-columns {
        flex-direction: column;
        gap: 2rem;
    }

    .dual-col {
        flex: 1 1 100%;
    }

    .allotrope-row {
        gap: 1rem;
    }

    .allotrope-item {
        min-width: 100px;
    }

    .typewriter-text,
    .interstitial-text {
        white-space: normal;
    }
}

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

    .stratum-subheadline {
        font-size: 1.4rem;
    }

    .allotrope-row {
        flex-direction: column;
    }

    .allotrope-item {
        max-width: 100%;
    }
}