/* tanso.bar — Carbon Metrics Dashboard */
/* Synthwave vapor gradient aesthetic */

@property --mesh-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@property --mesh-x {
    syntax: '<percentage>';
    initial-value: 30%;
    inherits: false;
}

@property --mesh-y {
    syntax: '<percentage>';
    initial-value: 40%;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0D0221;
    color: #9E9E9E;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   Scanline Overlay
   ======================================== */
.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 3px
    );
    opacity: 0.5;
}

/* ========================================
   Section Heading
   ======================================== */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #E8E8E8;
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ========================================
   Hero Zone
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.gradient-mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at var(--mesh-x) var(--mesh-y), rgba(224, 64, 251, 0.35), transparent 55%),
        radial-gradient(ellipse at 70% 60%, rgba(0, 229, 255, 0.25), transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(124, 77, 255, 0.2), transparent 60%);
    animation: meshShift 10s ease-in-out infinite alternate;
}

@keyframes meshShift {
    0% {
        --mesh-x: 30%;
        --mesh-y: 40%;
    }
    33% {
        --mesh-x: 50%;
        --mesh-y: 30%;
    }
    66% {
        --mesh-x: 70%;
        --mesh-y: 50%;
    }
    100% {
        --mesh-x: 40%;
        --mesh-y: 60%;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #E8E8E8;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.title-dot {
    color: #E040FB;
    text-shadow: 0 0 20px rgba(224, 64, 251, 0.6);
}

.hero-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    color: #9E9E9E;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.hero-metric {
    margin-bottom: 2.5rem;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: clamp(3rem, 7vw, 4.5rem);
    color: #00E5FF;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.5), 0 0 60px rgba(0, 229, 255, 0.2);
    display: block;
    line-height: 1.1;
}

.metric-unit {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #9E9E9E;
    display: block;
    margin-top: 0.3rem;
}

/* ========================================
   Hero Bar Charts
   ======================================== */
.hero-bars {
    max-width: 460px;
    margin: 0 auto;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.bar-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    color: #9E9E9E;
    width: 80px;
    text-align: right;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: #1A0A3E;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #E040FB, #E040FB);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(224, 64, 251, 0.5);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.fill-cyan {
    background: linear-gradient(90deg, #00E5FF, #00E5FF);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.fill-violet {
    background: linear-gradient(90deg, #7C4DFF, #7C4DFF);
    box-shadow: 0 0 10px rgba(124, 77, 255, 0.5);
}

.fill-green {
    background: linear-gradient(90deg, #1DE9B6, #1DE9B6);
    box-shadow: 0 0 10px rgba(29, 233, 182, 0.5);
}

.bar-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: #E8E8E8;
    width: 55px;
    text-align: right;
    flex-shrink: 0;
}

@keyframes barPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.bar-pulse {
    animation: barPulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   Ticker Strip
   ======================================== */
.ticker {
    width: 100%;
    overflow: hidden;
    padding: 0.8rem 0;
    border-top: 1px solid rgba(224, 64, 251, 0.2);
    border-bottom: 1px solid rgba(224, 64, 251, 0.2);
    background: rgba(13, 2, 33, 0.8);
}

.ticker-strip {
    display: flex;
    gap: 3rem;
    animation: scrollLeft 30s linear infinite;
    white-space: nowrap;
    width: max-content;
}

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #E8E8E8;
}

.tick-up {
    color: #1DE9B6;
}

.tick-down {
    color: #E040FB;
}

/* ========================================
   Metric Panels
   ======================================== */
.metrics {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.metric-card {
    background: #1A0A3E;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 0 15px rgba(224, 64, 251, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.15);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(224, 64, 251, 0.05), transparent 50%, rgba(0, 229, 255, 0.05));
    pointer-events: none;
}

.metric-card:hover {
    border-color: rgba(224, 64, 251, 0.35);
    box-shadow: 0 0 25px rgba(224, 64, 251, 0.2);
}

.card-tall {
    grid-row: span 2;
}

.metric-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #9E9E9E;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.7rem;
}

.pill {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.06em;
}

.pill-cyan {
    background: rgba(0, 229, 255, 0.15);
    color: #00E5FF;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.pill-magenta {
    background: rgba(224, 64, 251, 0.15);
    color: #E040FB;
    border: 1px solid rgba(224, 64, 251, 0.3);
}

.pill-green {
    background: rgba(29, 233, 182, 0.15);
    color: #1DE9B6;
    border: 1px solid rgba(29, 233, 182, 0.3);
}

.pill-violet {
    background: rgba(124, 77, 255, 0.15);
    color: #7C4DFF;
    border: 1px solid rgba(124, 77, 255, 0.3);
}

.metric-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 2rem;
    color: #E8E8E8;
    display: block;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.metric-suffix {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #9E9E9E;
    display: block;
    margin-bottom: 0.8rem;
}

/* Diamond indicators */
.diamond {
    width: 8px;
    height: 8px;
    background: #1DE9B6;
    transform: rotate(45deg);
    display: inline-block;
    flex-shrink: 0;
}

.diamond-cyan { background: #00E5FF; }
.diamond-magenta { background: #E040FB; }
.diamond-green { background: #1DE9B6; }
.diamond-violet { background: #7C4DFF; }

/* Sparklines */
.sparkline-wrap {
    margin-top: 0.5rem;
}

.sparkline {
    width: 100%;
    height: 40px;
    display: block;
}

/* Radial Gauges */
.radial-gauge-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.radial-gauge {
    width: 80px;
    height: 80px;
}

.gauge-arc {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mini bar charts */
.bar-mini {
    margin-top: 0.8rem;
}

.bar-mini-track {
    height: 6px;
    background: rgba(26, 10, 62, 0.8);
    border-radius: 3px;
    overflow: hidden;
}

.bar-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #E040FB, #E040FB);
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(224, 64, 251, 0.4);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-cyan-grad {
    background: linear-gradient(90deg, #00E5FF, #00E5FF);
    box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

.emission-breakdown {
    margin-top: 1rem;
}

.emission-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.emission-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #9E9E9E;
    width: 80px;
    flex-shrink: 0;
}

/* ========================================
   Carbon Cycle Diagram
   ======================================== */
.cycle {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.cycle-panel {
    background: #1A0A3E;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.12);
    position: relative;
    overflow: visible;
}

.cycle-diagram {
    width: 100%;
    height: auto;
    display: block;
}

.cycle-node {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cycle-node circle {
    transition: stroke-width 0.2s ease, filter 0.2s ease;
}

.cycle-node:hover circle {
    stroke-width: 2.5;
}

.anim-dash {
    animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -20; }
}

/* Tooltip */
.cycle-tooltip {
    position: absolute;
    background: rgba(13, 2, 33, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(224, 64, 251, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10;
    min-width: 180px;
    box-shadow: 0 0 20px rgba(224, 64, 251, 0.15);
}

.cycle-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #E8E8E8;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.tooltip-body {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #9E9E9E;
    display: block;
    line-height: 1.5;
}

/* ========================================
   Data Feed Section
   ======================================== */
.data-feed {
    max-width: 960px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.feed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.feed-card {
    background: #1A0A3E;
    border-radius: 10px;
    padding: 1.8rem;
    border: 1px solid rgba(124, 77, 255, 0.15);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.08);
}

.feed-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #E8E8E8;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 1rem;
}

.code-block {
    background: rgba(13, 2, 33, 0.6);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(0, 229, 255, 0.1);
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #00E5FF;
    display: block;
    margin-bottom: 0.3rem;
    line-height: 1.8;
}

.code-block code:last-child {
    margin-bottom: 0;
}

.feed-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: #9E9E9E;
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.source-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #E8E8E8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-item .diamond {
    width: 6px;
    height: 6px;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    position: relative;
    padding: 0;
    margin-top: 2rem;
}

.footer-gradient {
    height: 120px;
    background: linear-gradient(to bottom, #0D0221, #0A0118);
    pointer-events: none;
}

.footer-content {
    background: #0A0118;
    text-align: center;
    padding: 3rem 2rem 2rem;
    border-top: 1px solid rgba(124, 77, 255, 0.2);
}

.footer-metric {
    margin-bottom: 0.5rem;
}

.metric-num-lg {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 5rem);
    color: #00E5FF;
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.4), 0 0 80px rgba(0, 229, 255, 0.15);
    line-height: 1;
}

.footer-metric-unit {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #9E9E9E;
    display: block;
    margin-top: 0.3rem;
}

.footer-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #9E9E9E;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.flink {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    color: #E040FB;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.flink:hover {
    color: #00E5FF;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

.footer-copy {
    font-size: 0.7rem;
    color: #9E9E9E;
}

/* ========================================
   Fade-in Animation
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card-tall {
        grid-row: span 1;
    }

    .feed-grid {
        grid-template-columns: 1fr;
    }

    .hero-bars {
        max-width: 100%;
    }
}

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

    .hero {
        min-height: 90vh;
        padding: 3rem 1.5rem;
    }

    .metric-num {
        font-size: 1.6rem;
    }

    .footer-links {
        gap: 1rem;
    }
}
