:root {
    --bg: #0a0e17;
    --bg-alt: #111827;
    --accent: #02d8ce;
    --accent2: #02d8ce;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --card: #1e293b;
    --card-soft: rgba(30, 41, 59, 0.78);
    --border: rgba(148, 163, 184, 0.18);
    --shadow: 0 24px 80px rgba(10, 14, 23, 0.45);
    --radius: 18px;
    --max: 1180px;
}

/* ═══ LIGHT MODE ═══ */
html.light {
    --bg: #f8f9fc;
    --bg-alt: #ffffff;
    --text: #1a1a2e;
    --muted: #4a5568;
    --card: #ffffff;
    --card-soft: rgba(255, 255, 255, 0.95);
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* Body background */
html.light body {
    background: #f8f9fc !important;
    color: var(--text);
}

/* Nav */
html.light .site-nav {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}
html.light .nav-link { color: #4a5568; }
html.light .nav-link:hover { color: #1a1a2e; background: rgba(0,0,0,0.04); }

/* Noise texture */
html.light .site-shell::before { opacity: 0.01; }

/* Hero gradient text */
html.light .gradient {
    background: linear-gradient(135deg, #029e96, #02d8ce) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Hero section */
html.light .hero { color: #1a1a2e; }
html.light .hero-sub { color: #4a5568 !important; }
html.light .hero-badge { background: rgba(2,216,206,0.1) !important; color: #029e96 !important; border-color: rgba(2,216,206,0.2) !important; }

/* Cards & panels */
html.light .card,
html.light .post-card,
html.light .price-card,
html.light .stat-card,
html.light .feed-card,
html.light .diagram-card,
html.light .section-card,
html.light .hero-panel,
html.light .cta-banner {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.06) !important;
    color: #1a1a2e;
}

/* Muted text inside cards */
html.light .muted,
html.light .fineprint,
html.light p { color: #4a5568; }
html.light h1, html.light h2, html.light h3, html.light h4 { color: #1a1a2e; }
html.light strong { color: #1a1a2e; }
html.light .lead { color: #4a5568 !important; }

/* Stats */
html.light .stat-num { color: var(--accent) !important; }
html.light .stat-label { color: #4a5568 !important; }

/* Buttons */
html.light .btn-secondary,
html.light .button-secondary {
    color: #1a1a2e !important;
    border-color: rgba(0,0,0,0.12) !important;
    background: #ffffff !important;
}
html.light .btn-secondary:hover,
html.light .button-secondary:hover {
    border-color: var(--accent) !important;
}

/* Active nav link */
html.light body[data-page="dashboard"] .nav-link[href="dashboard.html"],
html.light body[data-page="how-it-works"] .nav-link[href="how-it-works.html"],
html.light body[data-page="blog"] .nav-link[href="blog.html"],
html.light body[data-page="pricing"] .nav-link[href="pricing.html"] {
    color: #fff !important;
}

/* Pricing */
html.light .price-card .price strong { color: #1a1a2e; }
html.light .badge { color: #fff; }
html.light .eyebrow { color: var(--accent) !important; }

/* Footer / waitlist section */
html.light input[type="email"] {
    background: #f0f2f5 !important;
    color: #1a1a2e !important;
    border-color: rgba(0,0,0,0.1) !important;
}

/* Brand mark */
html.light .brand-mark {
    background: rgba(2, 216, 206, 0.12) !important;
}

/* Code/pre blocks */
html.light pre, html.light code {
    background: #f0f2f5 !important;
    color: #1a1a2e !important;
}

/* Smooth transition on everything */
html.light *, html.light *::before, html.light *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 6px;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    transform: scale(1.15);
    background: rgba(255,255,255,0.08);
}
html.light .theme-toggle:hover {
    background: rgba(0,0,0,0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, rgba(2, 216, 206, 0.12), transparent 32%),
        radial-gradient(circle at 100% 10%, rgba(2, 216, 206, 0.14), transparent 26%),
        linear-gradient(180deg, #0a0e17 0%, #0d1320 48%, #0a0e17 100%);
    color: var(--text);
    line-height: 1.6;
}

body.site-shell {
    padding-top: 88px;
}

a {
    color: inherit;
}

.site-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.45;
}

.container {
    width: min(calc(100% - 2rem), var(--max));
    margin: 0 auto;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 14, 23, 0.84);
    backdrop-filter: blur(18px);
}

.site-nav-inner {
    width: min(calc(100% - 2rem), var(--max));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.35rem;
}
.brand-video {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}
/* GIF header works on all browsers — no Safari-specific hacks needed */

.brand-mark {
    display: inline-flex;
    width: 2.2rem;
    height: 2.2rem;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(2, 216, 206, 0.22), rgba(2, 216, 206, 0.18));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand span:last-child {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.nav-links a {
    text-decoration: none;
}

.nav-link {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.95rem;
    transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    transform: translateY(-1px);
}

body[data-page="dashboard"] .nav-link[href="dashboard.html"],
body[data-page="dashboard"] .nav-link[href="../dashboard.html"],
body[data-page="how-it-works"] .nav-link[href="how-it-works.html"],
body[data-page="how-it-works"] .nav-link[href="../how-it-works.html"],
body[data-page="blog"] .nav-link[href="blog.html"],
body[data-page="blog"] .nav-link[href="../blog.html"],
body[data-page="pricing"] .nav-link[href="pricing.html"],
body[data-page="pricing"] .nav-link[href="../pricing.html"] {
    color: #081117;
    background: linear-gradient(135deg, var(--accent), #02d8ce);
}

.nav-cta,
.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-cta,
.button-primary {
    color: #041014;
    background: linear-gradient(135deg, var(--accent), #02d8ce);
    box-shadow: 0 16px 40px rgba(2, 216, 206, 0.22);
}

.nav-cta {
    padding: 0.7rem 1.1rem;
    font-size: 0.94rem;
}

.button-primary {
    padding: 0.88rem 1.35rem;
}

.button-secondary {
    padding: 0.88rem 1.35rem;
    color: var(--text);
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.06);
}

.nav-cta:hover,
.button-primary:hover,
.button-secondary:hover,
.card:hover,
.post-card:hover,
.price-card:hover,
.stat-card:hover,
.table-wrap:hover,
.feed-card:hover,
.diagram-card:hover,
.section-card:hover {
    transform: translateY(-2px);
}

.button-secondary:hover {
    border-color: rgba(2, 216, 206, 0.45);
}

.page-hero {
    padding: 3rem 0 1.75rem;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 2.5rem;
    background:
        linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.92)),
        linear-gradient(120deg, rgba(2, 216, 206, 0.09), rgba(2, 216, 206, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -35% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(2, 216, 206, 0.22), transparent 62%);
    pointer-events: none;
}

.eyebrow,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--accent);
    background: rgba(2, 216, 206, 0.12);
    border: 1px solid rgba(2, 216, 206, 0.18);
}

.badge-secondary {
    color: var(--accent2);
    background: rgba(2, 216, 206, 0.12);
    border-color: rgba(2, 216, 206, 0.2);
}

.page-hero h1,
.section-header h2,
.content h2,
.content h3 {
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.page-hero h1 {
    margin: 1rem 0 0.9rem;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
}

.lead {
    max-width: 68ch;
    color: var(--muted);
    font-size: 1.04rem;
}

.hero-actions,
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.metric-strip,
.stats-grid,
.card-grid,
.pricing-grid,
.post-grid,
.diagram-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-strip {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 1.8rem;
}

.card-grid,
.post-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.diagram-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.pricing-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card,
.post-card,
.price-card,
.stat-card,
.table-wrap,
.feed-card,
.diagram-card,
.section-card {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card,
.post-card,
.price-card,
.stat-card,
.diagram-card,
.section-card {
    padding: 1.4rem;
}

.card:hover,
.post-card:hover,
.price-card:hover,
.stat-card:hover,
.table-wrap:hover,
.feed-card:hover,
.diagram-card:hover,
.section-card:hover {
    border-color: rgba(2, 216, 206, 0.28);
    box-shadow: 0 28px 65px rgba(10, 14, 23, 0.52);
}

.stat-label {
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    margin-top: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-change {
    margin-top: 0.4rem;
    font-size: 0.92rem;
}

.positive {
    color: #4ade80;
}

.negative {
    color: #f87171;
}

.neutral {
    color: #fbbf24;
}

.section {
    padding: 1.25rem 0 3rem;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.section-header p {
    max-width: 60ch;
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.table-wrap {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.92rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    text-align: left;
    font-size: 0.94rem;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.signal-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.signal-buy {
    color: #03271d;
    background: linear-gradient(135deg, #02d8ce, #02d8ce);
}

.signal-hold {
    color: #372400;
    background: linear-gradient(135deg, #fbbf24, #fde68a);
}

.signal-sell {
    color: #3a0710;
    background: linear-gradient(135deg, #f87171, #fca5a5);
}

.feed-card {
    overflow: hidden;
}

.feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feed-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.feed-item:last-child {
    border-bottom: 0;
}

.feed-time {
    color: var(--muted);
    font-size: 0.86rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.fineprint {
    color: var(--muted);
    font-size: 0.9rem;
}

.diagram {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 14, 23, 0.55);
}

.diagram-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.diagram-node {
    flex: 1 1 120px;
    min-height: 78px;
    display: grid;
    place-items: center;
    padding: 0.9rem;
    border-radius: 14px;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.diagram-arrow {
    flex: 0 0 46px;
    height: 2px;
    background: linear-gradient(90deg, rgba(2, 216, 206, 0.15), rgba(2, 216, 206, 0.95));
    position: relative;
}

.diagram-arrow::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--accent2);
    border-right: 2px solid var(--accent2);
    transform: translateY(-50%) rotate(45deg);
}

.weight-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1.3rem;
}

.post-card h3,
.price-card h3,
.diagram-card h3,
.section-card h3,
.card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
}

.post-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.post-link {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
}

.price-card.featured {
    border-color: rgba(2, 216, 206, 0.4);
    background:
        linear-gradient(160deg, rgba(2, 216, 206, 0.08), transparent 30%),
        rgba(30, 41, 59, 0.88);
}

.price {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin: 0.7rem 0 1rem;
}

.price strong {
    font-size: 2.2rem;
}

.check-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.3rem;
    margin-bottom: 0.65rem;
    color: var(--muted);
}

.check-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.cta-banner {
    margin-top: 2rem;
    padding: 1.4rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(2, 216, 206, 0.12), rgba(2, 216, 206, 0.12));
    border: 1px solid rgba(2, 216, 206, 0.2);
}

.content {
    padding: 0 0 3.5rem;
}

.content article {
    max-width: 860px;
    margin: 0 auto;
}

.content p,
.content li {
    color: #cad5e4;
    font-size: 1rem;
}

.content h2 {
    margin-top: 2.5rem;
    margin-bottom: 0.7rem;
    font-size: 1.85rem;
}

.content h3 {
    margin-top: 1.7rem;
    margin-bottom: 0.6rem;
    font-size: 1.2rem;
}

.content ul {
    padding-left: 1.2rem;
}

.content code {
    padding: 0.18rem 0.42rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.12);
    color: #c3f7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
}

.content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(10, 14, 23, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.content blockquote {
    margin: 1.4rem 0;
    padding: 0.2rem 0 0.2rem 1rem;
    border-left: 3px solid var(--accent);
    color: #d9e4f3;
}

.site-footer {
    padding: 1.6rem 0 2.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer-inner {
    width: min(calc(100% - 2rem), var(--max));
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem 1.2rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-footer a {
    color: var(--text);
    text-decoration: none;
}

@media (max-width: 900px) {
    .site-nav-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .feed-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.site-shell {
        padding-top: 130px;
    }

    .container,
    .site-nav-inner,
    .site-footer-inner {
        width: min(calc(100% - 1.2rem), var(--max));
    }

    .hero-panel {
        padding: 1.4rem;
        border-radius: 22px;
    }

    .page-hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    th,
    td {
        padding: 0.72rem 0.7rem;
        font-size: 0.88rem;
    }

    .diagram-arrow {
        flex-basis: 100%;
        height: 36px;
        width: 2px;
        justify-self: center;
        margin: 0 auto;
        background: linear-gradient(180deg, rgba(2, 216, 206, 0.15), rgba(2, 216, 206, 0.95));
    }

    .diagram-arrow::after {
        right: auto;
        left: 50%;
        top: auto;
        bottom: -1px;
        transform: translateX(-50%) rotate(135deg);
    }
}
