/* Global Tone Check - Master Stylesheet */

/* Color Palette */
:root {
    --color-deep-bg: #0B1120;
    --color-panel-bg: #0F172A;
    --color-border: #1E293B;
    --color-tertiary-text: #475569;
    --color-secondary-text: #94A3B8;
    --color-primary-text: #CBD5E1;
    --color-headline: #E2E8F0;
    --color-accent: #22D3EE;
    --color-accent-dim: #0E7490;
    --color-warning: #F59E0B;
    --color-negative: #F87171;
    --color-positive: #34D399;
    --color-slate-gray: #64748B;

    /* Typography */
    --font-primary: 'Space Grotesk', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Animation timing */
    --ease-out-cubic: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Grid and spacing */
    --baseline: 8px;
    --gap-min: 24px;
    --gap-major: 40px;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-deep-bg);
    color: var(--color-primary-text);
    font-family: var(--font-secondary);
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: rgba(11, 17, 32, 0.85);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    padding: 0 32px;
    z-index: 1000;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wordmark {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-secondary-text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px var(--color-accent);
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 12px var(--color-accent);
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 64px;
    background: 
        radial-gradient(circle, #1E293B 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: 0 0;
    background-color: var(--color-deep-bg);
    animation: grid-fade-in 0.6s ease-out 0.2s both;
}

@keyframes grid-fade-in {
    from {
        background-color: var(--color-deep-bg);
        background-image: none;
    }
    to {
        background-color: var(--color-deep-bg);
        background-image: radial-gradient(circle, #1E293B 1px, transparent 1px);
    }
}

.hero-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    transform: translateZ(0);
}

.hero-tagline {
    position: absolute;
    bottom: 33%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-family: var(--font-primary);
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 300;
    color: var(--color-headline);
    letter-spacing: 0.02em;
    z-index: 10;
}

.tagline-word {
    display: inline-block;
    margin: 0 8px;
    opacity: 0;
    animation: word-fade-in 0.5s ease-out forwards;
}

.tagline-word:nth-child(1) { animation-delay: 2.1s; }
.tagline-word:nth-child(2) { animation-delay: 2.22s; }
.tagline-word:nth-child(3) { animation-delay: 2.34s; }
.tagline-word:nth-child(4) { animation-delay: 2.46s; }
.tagline-word:nth-child(5) { animation-delay: 2.58s; }
.tagline-word:nth-child(6) { animation-delay: 2.7s; }
.tagline-word:nth-child(7) { animation-delay: 2.82s; }

@keyframes word-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dashboard Band */
.dashboard-band {
    background-color: var(--color-deep-bg);
    background-image: radial-gradient(circle, #1E293B 1px, transparent 1px);
    background-size: 32px 32px;
    padding: 64px 32px;
}

.signal-band {
    min-height: 200vh;
}

.panels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-major);
    max-width: 1200px;
    margin: 0 auto;
}

.panel {
    background-color: var(--color-panel-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 32px;
    opacity: 0;
    transform: scale(0.96) translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s var(--ease-out-cubic), 
                border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, opacity;
}

.panel.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.panel:hover {
    transform: scale(1.02) translateY(0);
    border-color: var(--color-accent);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 30px rgba(34, 211, 238, 0.08);
}

.panel.not-hovered {
    opacity: 0.85;
}

.panel-title {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    color: var(--color-headline);
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.panel-content {
    position: relative;
}

.waveform-chart,
.heat-map,
.network-micro,
.tone-chart {
    width: 100%;
    height: auto;
    margin-bottom: 24px;
}

.waveform-line {
    fill: none;
    stroke: url(#waveform-gradient);
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.waveform-line.animated {
    animation: draw-waveform 1.2s ease-out forwards;
}

@keyframes draw-waveform {
    to {
        stroke-dashoffset: 0;
    }
}

.heat-nodes circle {
    fill: var(--color-warning);
    opacity: 0.6;
    animation: heat-pulse 2s ease-in-out infinite;
}

@keyframes heat-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

.network-edges path {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 1px;
    opacity: 0.6;
}

.network-nodes circle {
    fill: var(--color-secondary-text);
    opacity: 0.7;
    filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.3));
}

.tone-bar {
    opacity: 0.7;
    animation: count-up 1.2s ease-out forwards;
}

.tone-bar.positive {
    fill: var(--color-positive);
}

.tone-bar.neutral {
    fill: var(--color-warning);
}

.tone-bar.negative {
    fill: var(--color-negative);
}

.panel-stats {
    display: flex;
    gap: 32px;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-family: var(--font-secondary);
    font-size: 12px;
    color: var(--color-tertiary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 24px;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

/* Narrative Band */
.narrative-band {
    background-color: var(--color-deep-bg);
    min-height: 150vh;
    padding: 96px 32px;
    transition: background-color 0.3s ease;
}

.narrative-content {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.narrative-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-primary-text);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.narrative-content p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Network Culmination Band */
.network-band {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-deep-bg);
}

.culmination-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    transform: translateZ(0);
}

/* Final darkness */
.final-darkness {
    height: 100px;
    background-color: var(--color-deep-bg);
}

/* Network node styles */
.network-nodes circle {
    fill: var(--color-slate-gray);
    opacity: 0.7;
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.2));
}

.network-edges path {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 1.5px;
    opacity: 0.5;
}

/* Pulse ring animation */
.pulse-ring {
    position: absolute;
    border: 1px solid var(--color-accent);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse-ring-expand 2s ease-out infinite;
}

@keyframes pulse-ring-expand {
    from {
        transform: scale(1);
        opacity: 0.4;
    }
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }
    
    .panels-grid {
        grid-template-columns: 1fr;
        gap: var(--gap-min);
        padding: 32px 16px;
    }
    
    .panel {
        padding: 24px;
    }
    
    .narrative-band {
        padding: 64px 16px;
    }
    
    .dashboard-band {
        padding: 32px 16px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .panel {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    
    .narrative-content p {
        opacity: 1;
        transform: translateY(0);
    }
    
    .status-indicator {
        animation: none;
    }
}

/* SVG gradient definitions */
svg defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}
