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

:root {
    --bg: #050505;
    --surface: #0a0a0a;
    --surface-hover: #121212;
    --nav-bg: rgba(5, 5, 5, 0.8);
    --fg: #ffffff;
    --muted: #888888;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --accent: #6b38ff;
    /* Violet/Blue Accent */
    --accent-glow: rgba(107, 56, 255, 0.15);

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;

    --container: 1200px;
    --nav-height: 72px;
}

html.light {
    --nav-bg: rgba(255, 255, 255, 0.8);
    --bg: hsl(260, 50%, 98%);
    --surface: hsl(260, 50%, 94%);
    --surface-hover: hsl(260, 50%, 90%);
    --fg: #111111;
    --muted: #555555;
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.2);
    --accent: #6b38ff;
    --accent-glow: rgba(107, 56, 255, 0.15);
}


html {
    background-color: var(--bg);
    width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    padding: 0;
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

::selection {
    background: var(--accent);
    color: #000;
}

/* Typography */
h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 500;
    color: var(--fg);
}

.display-1 {
    font-size: clamp(48px, 8vw, 96px);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.display-2 {
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.heading-3 {
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1.5rem 0;
    color: var(--muted);
}

.lead {
    font-size: clamp(18px, 2vw, 20px);
    max-width: 65ch;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.caps {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--muted);
}

a {
    color: var(--fg);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 120px 0;
    border-bottom: 1px solid var(--border);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    background: var(--fg);
    color: var(--bg);
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pool-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.2s;
}

.pool-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2rem;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn:hover {
    background: transparent;
    color: var(--fg);
    border-color: var(--border-strong);
}

.btn-outline {
    background: transparent;
    color: var(--fg);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--fg);
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 13px;
    color: var(--fg);
}

.badge .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    display: flex;
    align-items: center;
}

nav::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: -1;
}


.nav-menu-wrapper {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    margin-left: 64px;
    /* Added margin to prevent overlap with the brand */
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: var(--fg);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    color: var(--muted);
}

.nav-links a:hover {
    color: var(--fg);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--fg);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 900px) {

    .nav-inner {
        flex-wrap: wrap;
    }

    .brand {
        flex: 1;
    }

    .mobile-menu-btn {
        display: block;
        z-index: 101;
        position: relative;
    }

    nav.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 99;
    }

    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100dvh;
        background: var(--surface);
        border-left: 1px solid var(--border);
        padding: 80px 24px 40px;
        z-index: 100;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        margin-left: 0;
        /* Reset desktop margin-left on mobile */
    }

    nav.menu-open .nav-menu-wrapper {
        transform: translateX(0);
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0 !important;
    }

    .nav-links a {
        padding: 16px 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .nav-actions {
        margin-top: 24px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px !important;
    }
}

/* Hero */
.hero {
    position: relative;
    min-height: calc(100vh - var(--nav-height));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 40px 0;
    border-bottom: none;
    /* overflow: hidden; removed to fix chopped gradient */
}

.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    max-width: 900px;
}

.hero .badge {
    margin-bottom: 32px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

/* Network Canvas */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

/* SVG Diagram */
.diagram-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

    .diagram-container {
        margin-top: 40px;
    }
}

/* Italics styling */
i {
    font-style: italic;
    font-family: 'Newsreader', 'Playfair Display', serif;
    /* Elegant contrast */
    font-weight: 300;
}

.nav-links.mobile-only {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

@media (max-width: 768px) {
    .terminal-body {
        font-size: 13px !important;
        padding: 16px !important;
        white-space: pre-wrap;
        word-break: break-all;
        overflow-x: hidden;
    }

    .terminal-header {
        padding: 10px 16px;
    }

    .footer-grid {
        padding: 40px 0 20px;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-top: 24px;
    }
}

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

/* Stats Grid */
.stats-section {
    padding: 0 0 120px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.stat-card {
    padding: 32px 24px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.2s ease;
}

.stat-card:hover {
    background: var(--surface-hover);
}

.stat-value {
    font-size: 20px;
    color: var(--fg);
    margin-top: 12px;
    display: block;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 64px;
}

.bento-item {
    background: var(--bg);
    padding: 48px;
    display: flex;
    flex-direction: column;
}

.bento-item.large {
    grid-column: span 8;
}

.bento-item.small {
    grid-column: span 4;
}

.bento-grid.metrics-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {

    .bento-item.large,
    .bento-item.small {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .bento-grid.metrics-grid {
        grid-template-columns: 1fr;
    }

    .bento-item.large,
    .bento-item.small {
        grid-column: span 12;
    }
}

/* Bottlenecks Grid */
.bottlenecks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 64px;
}

@media (max-width: 1024px) {
    .bottlenecks-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.bottleneck-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 0 40px rgba(107, 56, 255, 0.18);
}

.bottleneck-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: 0 0 16px rgba(107, 56, 255, 0.1);
}

.bottleneck-card .bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.08;
    z-index: 0;
    color: var(--fg);
}

.bottleneck-card .content {
    position: relative;
    z-index: 1;
}

.bottleneck-card h3 {
    color: var(--fg);
    margin-bottom: 16px;
}

.bottleneck-card p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.emission-table th,
.emission-table td {
    white-space: nowrap;
}

.icon-box {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--fg);
    margin-bottom: 32px;
    background: var(--surface);
}

/* Split / Code Section */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

@media (max-width: 960px) {
    .split-section {
        grid-template-columns: 1fr;
    }
}

/* Allows alternating split sections on desktop without breaking mobile stacking order */
@media (min-width: 961px) {
    .split-reverse-desktop>*:first-child {
        order: 2;
    }

    .split-reverse-desktop>*:last-child {
        order: 1;
    }
}

.terminal {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    /* High contrast terminal override variables (for both light & dark modes) */
    --fg: #f8fafc;
    --muted: #cbd5e1;
    --accent: #c084fc;
    /* bright purple/lavender for high contrast on black background */
    --border: #1e1e24;
    /* override border to remain dark */
    --border-strong: #64748b;
    /* override strong border/separators to remain visible */
    --surface: #09090b;
    /* override terminal header background to remain dark */
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
}

.terminal-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    overflow-x: auto;
    overflow-y: auto;
    height: 380px;
    -webkit-overflow-scrolling: touch;
}

/* Custom Premium Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0 4px 4px 0;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.4);
    background-clip: padding-box;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 56, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.4);
    background-clip: padding-box;
}

.terminal-body span.prompt {
    color: var(--accent);
}

.terminal-body span.cmd {
    color: var(--fg);
}

/* Brighten hardcoded dark gray comments/separators in terminals */
.terminal-body span[style*="color: #666"],
.terminal-body span[style*="color:#666"] {
    color: #94a3b8 !important;
}

/* Tokenomics Chart */
.chart-container {
    margin-top: 64px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 48px;
    background: var(--surface);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.chart-stat p {
    margin: 0;
}

.chart-stat .val {
    font-size: 32px;
    color: var(--fg);
    margin-top: 8px;
}

.emission-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 14px;
}

.emission-table th {
    text-align: left;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-weight: 400;
}

.emission-table td {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
}

.emission-table tr:last-child td {
    border-bottom: none;
}

/* GPU-promote the table so the browser composites a pre-rendered
           bitmap during scroll instead of repainting 120 rows per frame */
.emission-table {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    border: 1px solid var(--border);
    background-color: var(--bg);
    margin: 48px 0;
    overflow: visible;
    border-radius: 4px;
}

.chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    background: var(--fg);
    color: var(--bg);
    padding: 12px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    z-index: 9999;
    transform: translate(-50%, -120%);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    transition: opacity 0.2s ease, left 0.1s ease, top 0.1s ease;
}

/* .fade-up-row removed — was defined but never animated by JS */

/* Tokenomics Two-Column Layout */
.tokenomics-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: start;
    margin-top: 32px;
}

.tokenomics-chart-side {
    width: 100%;
}

.tokenomics-table-side {
    width: 100%;
}

@media (max-width: 900px) {
    .tokenomics-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Footer */
footer {
    padding: 80px 0 40px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

footer .container {
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 80px;
}

@media (max-width: 960px) {
    footer .container {
        position: relative;
        z-index: 1;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand {
        grid-column: span 1;
        margin-bottom: 24px;
    }

    /* Accordion Logic */
    .footer-col h4 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        margin: 0;
        border-bottom: 1px solid var(--border);
        font-size: 13px;
    }

    .footer-col h4::after {
        content: '\25BC';
        font-size: 10px;
        transition: transform 0.3s ease;
        color: var(--muted);
    }

    .footer-col.active h4::after {
        transform: rotate(180deg);
    }

    .footer-col .footer-links {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .footer-col .footer-links a {
        font-size: 13px;
    }

    .footer-brand p {
        font-size: 14px;
    }

    .footer-col.active .footer-links {
        max-height: 400px;
        opacity: 1;
        margin-top: 16px;
        margin-bottom: 16px;
    }

    /* Horizontal Social Links */
    .social-links-footer {
        flex-direction: row !important;
        gap: 16px !important;
        flex-wrap: wrap;
    }

    .social-links-footer span {
        display: none;
    }

    .social-links-footer a {
        padding: 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
    }
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 24px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 14px;
    color: var(--muted);
    display: inline-block;
    padding: 4px 0;
}

.footer-links a:hover {
    color: var(--fg);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted);
}

/* Utils */
.text-accent {
    color: var(--accent);
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-8 {
    margin-bottom: 32px;
}

/* Animation Utilities */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
}

/* Accessibility & Polish */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    section {
        padding: 80px 0;
    }

    .hero {
        padding: 120px 0 60px 0;
    }

    .display-1 {
        font-size: clamp(32px, 8vw, 48px);
        line-height: 1.1;
    }
}

/* Lenis Base CSS */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}



@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-up {
        opacity: 1 !important;
        transform: none !important;
    }
}