/* Opto Custom Theme - Obsidian Dark Mode */
:root {
    --bg-dark: #0B0F19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Opto by Modulus Palette */
    --brand-blue: #008ad0;
    --brand-blue-hover: #0076b3;
    --brand-blue-glow: rgba(0, 138, 208, 0.25);
    
    --brand-orange: #e55722;
    --brand-orange-hover: #d24a18;
    --brand-orange-soft: #fb923c;
    --brand-orange-glow: rgba(229, 87, 34, 0.25);

    --color-success: #10B981;
    --color-error: #EF4444;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.25;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Background Glow Orbs */
.glow-orb {
    position: absolute;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.orb-1 {
    top: -100px;
    right: -100px;
    background: var(--brand-blue);
}

.orb-2 {
    top: 500px;
    left: -150px;
    background: var(--brand-orange);
}

/* Header & Nav */
.header {
    padding: 22px 0;
    position: sticky;
    top: 0;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Buttons (Solid, crisp colors — zero muddy gradients) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1.5px solid transparent;
}

.btn-primary {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--brand-blue-glow);
}

.btn-primary:hover {
    background: var(--brand-blue-hover);
    border-color: var(--brand-blue-hover);
    box-shadow: 0 8px 24px rgba(0, 138, 208, 0.4);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #ffffff;
    box-shadow: 0 4px 16px var(--brand-orange-glow);
}

.btn-accent:hover {
    background: var(--brand-orange-hover);
    border-color: var(--brand-orange-hover);
    box-shadow: 0 8px 24px rgba(229, 87, 34, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(229, 87, 34, 0.1);
    color: var(--brand-orange-soft);
    border: 1px solid rgba(229, 87, 34, 0.25);
    border-radius: 9999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Hero Section */
.hero {
    padding: 48px 0 80px 0;
}

.hero-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 44px;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

/* Solid high-contrast text accents */
.text-orange {
    color: var(--brand-orange);
}

.text-blue {
    color: var(--brand-blue);
}

.text-green {
    color: var(--color-success);
}

.hero-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-blue);
    margin: -10px 0 20px 0;
}

.hero-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: -10px 0 20px 0;
}

.hero-container.video-expanded .hero-note {
    text-align: center;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 36px;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.card-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.console-body {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    background: #0d121f;
}

.terminal-line {
    display: flex;
    gap: 10px;
}

.c-blue { color: #38bdf8; }
.c-orange { color: #fb923c; }
.c-green { color: #34d399; }
.c-red { color: #f87171; }
.c-dim { color: #64748b; }

/* Stats Bar */
.stats-section {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.015);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.stat-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Live Simulation Section */
.live-sim-section {
    padding: 100px 0 60px 0;
}

.sim-card {
    padding: 0;
}

.sim-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.sim-toggle-group {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.sim-toggle {
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sim-toggle:hover {
    color: var(--text-primary);
}

.sim-toggle.active {
    background: var(--brand-blue);
    color: #ffffff;
}

.sim-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sim-summary-item {
    text-align: center;
}

.sim-summary-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.sim-summary-value {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
}

.sim-chart-wrap {
    padding: 24px;
    height: 340px;
}

.sim-footnote {
    padding: 0 24px 24px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sim-footnote code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Video (hero) */
.hero-video {
    border-color: rgba(0, 138, 208, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 138, 208, 0.15), 0 0 48px var(--brand-blue-glow);
}

/* Expanded state: video plays wide, text drops below */
.hero-container.video-expanded {
    grid-template-columns: 1fr;
    gap: 36px;
}

.hero-container.video-expanded .hero-visual {
    order: -1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.hero-container.video-expanded .hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hero-container.video-expanded .hero-kicker {
    text-align: center;
}

.hero-container.video-expanded .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.hero-container.video-expanded .hero-actions {
    justify-content: center;
}

.video-placeholder:hover .video-play-btn {
    background: var(--brand-blue) !important;
    color: #ffffff;
}

/* Console section (moved below hero) */
.console-section {
    padding: 60px 0 0 0;
}

.console-section .hero-card {
    max-width: 760px;
    margin: 0 auto;
}

.video-card {
    padding: 0;
}

.video-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #0d121f;
    color: var(--text-muted);
}

.video-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 138, 208, 0.15);
    border: 1.5px solid var(--brand-blue);
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

@media (max-width: 700px) {
    .sim-summary {
        grid-template-columns: 1fr;
    }
}

/* Reduction Breakdown Table */
.reduction-table-wrap {
    padding: 24px;
}

.reduction-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.reduction-table th, .reduction-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.reduction-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.reduction-table td {
    color: var(--text-primary);
}

/* Features Grid */
.features-section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    padding: 36px 28px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.feature-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--brand-blue);
    text-decoration: none;
}

@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
    }
    /* On small screens the video comes first so it is visible without scrolling */
    .hero-visual {
        order: -1;
    }
    .hero {
        padding: 24px 0 60px 0;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Small screens: header nav overflowed the viewport; keep logo + demo button only */
@media (max-width: 700px) {
    .nav-link {
        display: none;
    }
    .header {
        padding: 14px 0;
    }
}

/* Wide tables scroll sideways inside their box on small screens */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    min-width: 560px;
}
