:root {
    --bg-color: #0b0f19; /* Cosmic dark */
    --panel-bg: rgba(20, 25, 40, 0.6);
    --panel-border: rgba(100, 150, 255, 0.2);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #00f0ff; /* Neon cyan */
    --accent-glow: rgba(0, 240, 255, 0.5);
    --highlight: #b052ff; /* Quantum purple */
    --highlight-glow: rgba(176, 82, 255, 0.4);
    --tooltip-bg: rgba(10, 15, 30, 0.95);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(176, 82, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.08) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent), var(--highlight));
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

main {
    max-width: 900px;
    margin: 0 auto;
}

h2 {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1rem;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 var(--highlight-glow);
    border-color: rgba(176, 82, 255, 0.3);
}

/* Equations */
.equation {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow-x: auto;
    border-left: 4px solid var(--accent);
}

.highlight-equation {
    border-left: 4px solid var(--highlight);
    background: linear-gradient(90deg, rgba(176, 82, 255, 0.1) 0%, rgba(0,0,0,0.3) 100%);
}

/* Glossary terms */
.glossary-term {
    color: var(--accent);
    text-decoration: underline dotted;
    cursor: help;
    position: relative;
    font-weight: 600;
}

/* Slider Widget */
.widget-panel {
    border-color: rgba(0, 240, 255, 0.3);
}

.slider-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0;
    gap: 1rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 15px var(--accent-glow);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid var(--panel-border);
}

.slider-label {
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.metric-card h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--tooltip-bg);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
    font-size: 0.9rem;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.visible {
    opacity: 1;
}

/* Canvas & Conclusion */
.caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.conclusion-panel {
    border-color: rgba(176, 82, 255, 0.4);
}

.quote {
    font-style: italic;
    color: var(--text-muted);
    border-left: 4px solid var(--text-muted);
    padding-left: 1rem;
    margin-top: 2rem;
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .glass-panel { padding: 1.5rem; }
    .metrics-grid { grid-template-columns: 1fr; }
}
