/* tanso.news - Carbon Economy News Broadcast */
/* Colors: #0A0A0F, #00F5FF, #FF00E5, #39FF14, #6B6B7B, #E0E0EC, #12122A, #FFB400 */

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

:root {
    --void-black: #0A0A0F;
    --neon-cyan: #00F5FF;
    --neon-magenta: #FF00E5;
    --phosphor-green: #39FF14;
    --ash-gray: #6B6B7B;
    --carbon-white: #E0E0EC;
    --deep-indigo: #12122A;
    --warning-amber: #FFB400;
    --cursor-x: 50%;
    --cursor-y: 50%;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--void-black);
    color: var(--ash-gray);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    line-height: 1.55;
    overflow-x: hidden;
}

/* Cursor Glow */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: radial-gradient(circle 120px at var(--cursor-x) var(--cursor-y), rgba(0, 245, 255, 0.12), transparent);
    transition: none;
}

/* Scanning Line */
.scanning-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 245, 255, 0.3);
    z-index: 999;
    animation: scanDown 8s linear infinite;
    pointer-events: none;
}

@keyframes scanDown {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* Particle Field Background */
.particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Broadcast Grid */
.broadcast-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 18vw, 320px), 1fr));
    grid-auto-rows: auto;
    gap: 2px;
    width: 100%;
    min-height: 100vh;
    background: rgba(0, 245, 255, 0.03);
}

/* Base Cell */
.cell {
    background: var(--deep-indigo);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

/* Cell Brackets */
.cell-brackets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cell-brackets::before,
.cell-brackets::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: rgba(0, 245, 255, 0.25);
    border-style: solid;
    transition: transform 0.3s ease;
}

.cell-brackets::before {
    top: 4px;
    left: 4px;
    border-width: 1px 0 0 1px;
}

.cell-brackets::after {
    bottom: 4px;
    right: 4px;
    border-width: 0 1px 1px 0;
}

.cell:hover .cell-brackets::before,
.cell:hover .cell-brackets::after {
    transform: scale(1.1);
}

/* Breaking Cell */
.breaking-cell {
    grid-column: span 3;
    grid-row: span 2;
    padding: 20px;
}

.breaking-cell .kinetic-headline {
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    color: var(--neon-cyan);
}

/* Feature Cell */
.feature-cell {
    grid-column: span 2;
    grid-row: span 2;
    padding: 18px;
}

.feature-cell .kinetic-headline {
    font-size: clamp(1rem, 2.5vw, 2rem);
    color: var(--neon-magenta);
}

/* Standard Cell */
.standard-cell .kinetic-headline {
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    color: var(--neon-cyan);
}

/* Kinetic Headlines */
.kinetic-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
}

.kinetic-headline .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
}

.kinetic-headline.animate .char {
    animation: charReveal 200ms cubic-bezier(0.33, 1, 0.68, 1) forwards;
    animation-delay: calc(var(--i) * 30ms);
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cell Body */
.cell-body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    line-height: 1.55;
    color: var(--ash-gray);
    margin-bottom: 8px;
}

/* Cell Meta */
.cell-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timestamp {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.8rem);
    letter-spacing: 0.08em;
    color: var(--ash-gray);
}

/* Pulse Dots */
.pulse-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pulse-dot.green {
    background: var(--phosphor-green);
    animation: pulseGreen 2s ease-in-out infinite;
}

.pulse-dot.amber {
    background: var(--warning-amber);
    animation: pulseAmber 1s ease-in-out infinite;
}

@keyframes pulseGreen {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes pulseAmber {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Alert Indicator */
.alert-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.alert-label {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--warning-amber);
    font-weight: 400;
}

/* Hidden Data (revealed by cursor proximity) */
.hidden-data {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.55rem, 0.7vw, 0.7rem);
    letter-spacing: 0.05em;
    color: var(--ash-gray);
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: 8px;
}

.cell.cursor-near .hidden-data {
    opacity: 1;
}

/* Data Cells */
.data-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.data-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    color: var(--ash-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.data-value {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--phosphor-green);
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.data-unit {
    font-size: 0.5em;
    color: var(--ash-gray);
}

.data-change {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.data-change.positive {
    color: var(--phosphor-green);
}

.data-change.negative {
    color: var(--neon-magenta);
}

/* Micro Charts */
.micro-chart {
    width: 80%;
    height: 30px;
    margin-top: 8px;
    position: relative;
}

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

/* Ticker Cells */
.ticker-cell {
    grid-column: 1 / -1;
    padding: 8px 0;
    overflow: hidden;
    background: var(--void-black);
    border-top: 1px solid rgba(0, 245, 255, 0.1);
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.ticker-content {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.8rem);
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    animation: tickerScroll 30s linear infinite;
}

.ticker-reverse {
    animation: tickerScrollReverse 35s linear infinite;
}

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

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

.ticker-content span {
    flex-shrink: 0;
}

/* Generative Cells */
.generative-cell {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Hexagonal Lattice */
.hex-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
    height: 100%;
    padding: 10px;
}

.hex {
    width: 100%;
    aspect-ratio: 1;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--deep-indigo);
    border: 1px solid rgba(0, 245, 255, 0.2);
    animation: hexPulse 3s ease-in-out infinite;
}

.hex:nth-child(2n) { animation-delay: 0.3s; }
.hex:nth-child(3n) { animation-delay: 0.6s; }
.hex:nth-child(4n) { animation-delay: 0.9s; }
.hex:nth-child(5n) { animation-delay: 1.2s; }
.hex:nth-child(6n) { animation-delay: 1.5s; }

@keyframes hexPulse {
    0%, 100% { background: var(--deep-indigo); }
    50% { background: rgba(0, 245, 255, 0.05); }
}

/* Emission Particles */
.emission-particles {
    position: relative;
    background: var(--void-black);
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--phosphor-green);
    opacity: 0;
    animation: particleRise linear infinite;
}

.p1  { left: 5%;  animation-duration: 5.0s; animation-delay: 0.0s; }
.p2  { left: 12%; animation-duration: 5.3s; animation-delay: 0.5s; }
.p3  { left: 20%; animation-duration: 5.6s; animation-delay: 1.0s; }
.p4  { left: 28%; animation-duration: 5.9s; animation-delay: 0.3s; }
.p5  { left: 35%; animation-duration: 6.2s; animation-delay: 0.8s; }
.p6  { left: 42%; animation-duration: 5.1s; animation-delay: 1.5s; }
.p7  { left: 50%; animation-duration: 5.4s; animation-delay: 0.2s; }
.p8  { left: 58%; animation-duration: 5.7s; animation-delay: 0.7s; }
.p9  { left: 65%; animation-duration: 6.0s; animation-delay: 1.2s; }
.p10 { left: 72%; animation-duration: 5.2s; animation-delay: 0.4s; }
.p11 { left: 80%; animation-duration: 5.5s; animation-delay: 0.9s; }
.p12 { left: 88%; animation-duration: 5.8s; animation-delay: 1.4s; }
.p13 { left: 95%; animation-duration: 6.1s; animation-delay: 0.1s; }
.p14 { left: 8%;  animation-duration: 5.3s; animation-delay: 1.8s; }
.p15 { left: 18%; animation-duration: 5.6s; animation-delay: 2.1s; }
.p16 { left: 33%; animation-duration: 5.9s; animation-delay: 1.6s; }
.p17 { left: 48%; animation-duration: 5.2s; animation-delay: 2.4s; }
.p18 { left: 62%; animation-duration: 5.8s; animation-delay: 1.1s; }
.p19 { left: 77%; animation-duration: 6.1s; animation-delay: 2.0s; }
.p20 { left: 92%; animation-duration: 5.4s; animation-delay: 1.7s; }

@keyframes particleRise {
    0% {
        bottom: -3px;
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

/* Data Interference */
.data-interference {
    position: relative;
    background: var(--void-black);
}

.interference-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.interference-layer.l1 {
    background: radial-gradient(circle at 30% 40%, rgba(0, 245, 255, 0.05), transparent 60%);
    animation: interferenceShift1 12s ease-in-out infinite;
}

.interference-layer.l2 {
    background: radial-gradient(circle at 70% 60%, rgba(255, 0, 229, 0.05), transparent 60%);
    animation: interferenceShift2 15s ease-in-out infinite;
}

.interference-layer.l3 {
    background: radial-gradient(circle at 50% 50%, rgba(0, 245, 255, 0.03), transparent 50%);
    animation: interferenceShift3 10s ease-in-out infinite;
}

@keyframes interferenceShift1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -15px); }
}

@keyframes interferenceShift2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-15px, 20px); }
}

@keyframes interferenceShift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, 10px) scale(1.2); }
}

/* Site Identity */
.site-identity {
    position: fixed;
    bottom: 12px;
    left: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    z-index: 1001;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.4);
}

/* In-view animation control */
.cell:not(.in-view) .hex,
.cell:not(.in-view) .particle,
.cell:not(.in-view) .interference-layer {
    animation-play-state: paused;
}

.cell.in-view .hex,
.cell.in-view .particle,
.cell.in-view .interference-layer {
    animation-play-state: running;
}

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

    .breaking-cell,
    .feature-cell {
        grid-column: span 1;
        grid-row: span 1;
    }

    .breaking-cell .kinetic-headline {
        font-size: 1.5rem;
    }

    .feature-cell .kinetic-headline {
        font-size: 1.1rem;
    }

    .cursor-glow {
        background: radial-gradient(circle 200px at 50% 50%, rgba(0, 245, 255, 0.08), transparent);
    }
}
