/* ==========================================================
   tanso.center - Styles
   Palette: #0F1B2D, #1A2E4A, #5B7BA5, #E8EDF3, #7A9E7E,
            #D4CABC, #C48B4A, #1E2328, #2C3E6D
   Fonts: Space Grotesk, Inter, IBM Plex Mono
   ========================================================== */

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

html {
    font-size: 17px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0F1B2D;
    color: #E8EDF3;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
}

/* --- Noise / Grain Overlay --- */
.noise-filter {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    filter: url(#grain);
}

/* --- Section Base --- */
.section {
    position: relative;
    min-height: 90vh;
    padding: 80px 0;
}

.section__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
}

.section__inner--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

/* --- Section Rules (dividers) --- */
.section-rule {
    width: 40%;
    height: 1px;
    background-color: #2C3E6D;
    margin-bottom: 60px;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: #E8EDF3;
    margin-bottom: 48px;
    text-transform: none;
}

/* --- Leaf Divider --- */
.leaf-divider {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 48px;
    opacity: 0.15;
}

.leaf-icon {
    transition: transform 0.3s ease;
}

/* ==========================================================
   Section 1: Atmospheric Opening
   ========================================================== */
.section--atmospheric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    background-color: #0F1B2D;
}

.section--atmospheric .section__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: #E8EDF3;
    margin-bottom: 40px;
    line-height: 1.1;
}

.ppm-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ppm-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4CABC;
}

.ppm-display {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'IBM Plex Mono', monospace;
    font-feature-settings: "tnum";
}

.ppm-digit {
    display: inline-block;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 500;
    color: #E8EDF3;
    width: 0.7em;
    text-align: center;
    position: relative;
}

.ppm-separator {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 500;
    color: #E8EDF3;
}

.ppm-unit {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: 400;
    color: #5B7BA5;
    margin-left: 8px;
}

/* ==========================================================
   Section 2: Data Landscape - Broken Grid
   ========================================================== */
.section--data {
    background-color: #0F1B2D;
    padding-top: 120px;
}

.broken-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
    align-items: start;
}

/* --- Data Panels --- */
.data-panel {
    background-color: #1A2E4A;
    padding: 32px;
    position: relative;
    border: 1px solid #1E2328;
}

.data-panel--temp {
    grid-column: 1 / 4;
    grid-row: 1 / 2;
    margin-right: -32px;
    z-index: 10;
}

.data-panel--co2 {
    grid-column: 3 / 7;
    grid-row: 2 / 3;
    margin-left: 32px;
    margin-top: -40px;
    z-index: 11;
}

.data-panel--sea {
    grid-column: 2 / 5;
    grid-row: 3 / 4;
    margin-right: -24px;
    margin-top: -32px;
    z-index: 10;
}

.data-panel,
.solution-panel {
    box-shadow: 4px 8px 0 rgba(15, 27, 45, 0.4);
}

/* --- Corner Leaf --- */
.panel-corner-leaf {
    position: absolute;
    top: -8px;
    left: -8px;
    opacity: 0.7;
}

/* --- Annotation Labels --- */
.annotation-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4CABC;
    margin-bottom: 12px;
}

/* --- Panel Typography --- */
.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    color: #E8EDF3;
    margin-bottom: 16px;
}

.panel-body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;
    color: #5B7BA5;
    margin-bottom: 24px;
}

/* --- Isometric Charts --- */
.iso-chart {
    width: 100%;
    max-width: 320px;
}

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

.chart-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    fill: #D4CABC;
}

/* ==========================================================
   Section 3: System Map
   ========================================================== */
.section--system {
    background-color: #0F1B2D;
    padding-top: 120px;
    min-height: 95vh;
}

.system-map-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 32px;
    align-items: center;
    justify-items: center;
}

.system-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.system-layer--atmosphere {
    grid-column: 2;
    grid-row: 1;
}

.system-layer--biosphere {
    grid-column: 1;
    grid-row: 2;
}

.system-layer--industry {
    grid-column: 2;
    grid-row: 2;
}

.system-layer--ocean {
    grid-column: 3;
    grid-row: 2;
}

.system-layer--geosphere {
    grid-column: 2;
    grid-row: 3;
}

.system-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #D4CABC;
}

.system-data {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-feature-settings: "tnum";
    color: #5B7BA5;
}

.flow-paths {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.flow-line {
    animation: flowDash 12s linear infinite;
}

@keyframes flowDash {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -60;
    }
}

.iso-icon {
    display: block;
}

/* ==========================================================
   Section 4: Solutions Garden
   ========================================================== */
.section--solutions {
    background-color: #0F1B2D;
    padding-top: 120px;
}

.broken-grid--relaxed {
    gap: 32px;
}

.solution-panel {
    background-color: #1A2E4A;
    padding: 40px;
    position: relative;
    border: 1px solid #1E2328;
}

.solution-panel--reforest {
    grid-column: 1 / 5;
    grid-row: 2 / 3;
    margin-right: -24px;
    z-index: 10;
}

.solution-panel--soil {
    grid-column: 3 / 8;
    grid-row: 3 / 4;
    margin-left: 24px;
    margin-top: -32px;
    z-index: 11;
}

.solution-panel--blue {
    grid-column: 2 / 6;
    grid-row: 4 / 5;
    margin-right: -32px;
    margin-top: -24px;
    z-index: 10;
}

.iso-illustration {
    width: 100%;
    max-width: 320px;
    margin-top: 16px;
}

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

/* Increase leaf motif density in solutions section */
.section--solutions .leaf-divider {
    opacity: 0.08;
}

.section--solutions .panel-corner-leaf {
    opacity: 0.9;
}

/* Iso tree group breathing animation */
.iso-tree-group {
    animation: breathe 6s ease-in-out infinite;
}

.iso-tree-group:nth-child(2) { animation-delay: 0.2s; }
.iso-tree-group:nth-child(3) { animation-delay: 0.4s; }
.iso-tree-group:nth-child(4) { animation-delay: 0.6s; }
.iso-tree-group:nth-child(5) { animation-delay: 0.8s; }

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

/* ==========================================================
   Section 5: Grounding Close
   ========================================================== */
.section--grounding {
    background-color: #1A2E4A;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.leaf-vein-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M100,10 Q80,50 60,90 Q40,130 30,180' fill='none' stroke='%235B7BA5' stroke-width='0.8'/%3E%3Cpath d='M100,10 Q120,50 140,90 Q160,130 170,180' fill='none' stroke='%235B7BA5' stroke-width='0.8'/%3E%3Cpath d='M100,10 L100,190' fill='none' stroke='%235B7BA5' stroke-width='1'/%3E%3Cpath d='M60,60 Q80,55 100,50' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M140,60 Q120,55 100,50' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M45,110 Q72,100 100,90' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M155,110 Q128,100 100,90' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M35,155 Q67,140 100,130' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M165,155 Q133,140 100,130' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    background-repeat: repeat;
    pointer-events: none;
}

.closing-quote {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.01em;
    color: #5B7BA5;
    line-height: 1.5;
    max-width: 700px;
    margin-bottom: 48px;
    padding: 0 24px;
}

.closing-quote::before {
    content: none;
}

.closing-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 24px;
}

.meta-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #D4CABC;
    font-feature-settings: "tnum";
}

.meta-separator {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #5B7BA5;
    opacity: 0.5;
}

/* ==========================================================
   Leaf Proximity Hover Effect (cursor within 120px)
   Handled via JS, this CSS defines the transition
   ========================================================== */
.leaf-icon,
.panel-corner-leaf svg,
.iso-tree-group {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================
   Background texture: leaf vein pattern at 3% opacity
   Applied to data panels
   ========================================================== */
.data-panel::after,
.solution-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60,5 Q45,30 35,55 Q25,80 20,110' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M60,5 Q75,30 85,55 Q95,80 100,110' fill='none' stroke='%235B7BA5' stroke-width='0.5'/%3E%3Cpath d='M60,5 L60,115' fill='none' stroke='%235B7BA5' stroke-width='0.7'/%3E%3Cpath d='M40,40 Q50,35 60,30' fill='none' stroke='%235B7BA5' stroke-width='0.3'/%3E%3Cpath d='M80,40 Q70,35 60,30' fill='none' stroke='%235B7BA5' stroke-width='0.3'/%3E%3Cpath d='M30,70 Q45,60 60,55' fill='none' stroke='%235B7BA5' stroke-width='0.3'/%3E%3Cpath d='M90,70 Q75,60 60,55' fill='none' stroke='%235B7BA5' stroke-width='0.3'/%3E%3C/svg%3E");
    background-size: 120px 120px;
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.data-panel > *,
.solution-panel > * {
    position: relative;
    z-index: 1;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 768px) {
    .broken-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .data-panel,
    .solution-panel {
        margin: 0 !important;
    }

    .system-map-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: auto;
    }

    .system-layer--atmosphere,
    .system-layer--biosphere,
    .system-layer--industry,
    .system-layer--ocean,
    .system-layer--geosphere {
        grid-column: 1;
        grid-row: auto;
    }

    .flow-paths {
        display: none;
    }

    .closing-meta {
        flex-direction: column;
        gap: 6px;
    }

    .meta-separator {
        display: none;
    }

    .section {
        min-height: auto;
        padding: 60px 0;
    }

    .section--atmospheric {
        min-height: 80vh;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .section__inner {
        padding: 0 20px;
    }

    .data-panel,
    .solution-panel {
        padding: 24px;
    }
}
