@import url('./tokens.css');

/* ============================================================================
   FreedomCore Modular CSS — v3.0
   Palette + type + spacing + motion tokens live in /css/tokens.css.
   This file is legacy component styles + a transitional alias layer
   that maps old var names (--bg, --green, etc.) onto the new tokens.

   DO NOT add new hex literals here. Reference tokens only.
   The alias block below is eliminated in the component-library PR.
   ============================================================================ */

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

/* ─── TRANSITIONAL ALIAS LAYER ──────────────────────────────────────────────
   Legacy names used by the 1000+ rules in this file. Each resolves to a
   tokens.css primitive so the old selectors keep working while the new
   design system is the authority. Do not introduce new aliases here;
   refactor callers to tokens directly as they are rebuilt per-component.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
    --bg:           var(--bg-primary);
    --bg2:          var(--bg-elevated);
    --text:         var(--text-primary);
    --text-dim:     var(--text-muted);

    --gold:         var(--accent-gold);
    --purple:       var(--accent-violet);
    --blue:         var(--accent-cyan);
    --cyan:         var(--accent-cyan);
    --accent:       var(--accent-cyan);
    --silver:       var(--accent-silver);

    /* --green was #4ecdc4 teal; all callers now resolve to --accent-cyan.
       Status-positive semantics will be site-derived in the component PR. */
    --green:        var(--accent-cyan);

    /* DEPRECATED — status + warning colors outside the locked palette.
       Retained as hex for this PR; eliminated when status derives per-site. */
    --amber:        #f5a623;
    --red:          #ef4444;
    --bronze:       #cd7f32;
    --champion:     #fbbf24;

    /* Derived alpha surfaces (rgba of token hexes, so token-driven) */
    --card:              rgba(20, 20, 28, 0.92);        /* from --bg-elevated */
    --border:            rgba(245, 245, 250, 0.10);     /* from --text-primary */
    --green-dim:         rgba(62, 168, 245, 0.10);
    --blue-dim:          rgba(62, 168, 245, 0.10);
    --glow-primary:      rgba(62, 168, 245, 0.15);
    --glow-secondary:    rgba(62, 168, 245, 0.10);
    --gold-bg:           rgba(255, 215, 0, 0.10);
    --gold-border:       rgba(255, 215, 0, 0.28);
    --champion-bg:       rgba(251, 191, 36, 0.12);
    --scanline:          rgba(0, 0, 0, 0.02);
}

[data-theme="light"] {
    /* Dark aliases already point at tokens; tokens flip under [data-theme="light"].
       Here we only override the derived alpha surfaces + deprecated status hexes. */
    --card:              rgba(255, 255, 255, 0.95);
    --border:            rgba(10, 10, 15, 0.12);
    --green-dim:         rgba(30, 127, 196, 0.08);
    --blue-dim:          rgba(30, 127, 196, 0.08);
    --glow-primary:      rgba(30, 127, 196, 0.10);
    --glow-secondary:    rgba(30, 127, 196, 0.06);
    --gold-bg:           rgba(200, 155, 0, 0.10);
    --gold-border:       rgba(200, 155, 0, 0.35);
    --champion-bg:       rgba(200, 155, 0, 0.12);
    --scanline:          rgba(0, 0, 0, 0.008);

    --amber:             #b8740a;
    --red:               #d42020;
    --bronze:            #8b4513;
    --champion:          #b8740a;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, var(--scanline) 2px, var(--scanline) 4px);
    pointer-events: none;
    z-index: 1;
}
.grid-bg {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        linear-gradient(rgba(62, 168, 245, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(62, 168, 245, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0; pointer-events: none;
}
[data-theme="light"] .grid-bg { opacity: 0.5; }

/* Frontier card CTA → Access page */
.frontier-cta { transition: opacity 0.2s, letter-spacing 0.2s; }
.frontier-cta:hover { opacity: 0.85; letter-spacing: 2px; }

/* === NAV === */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    padding: 10px 20px;
    display: flex; align-items: center;
    /* Deliberately NOT space-between — the logo's position must be hard-docked
       next to the hamburger. nav-right pushes itself to the right via margin-left:auto. */
    background: var(--bg2);
    backdrop-filter: blur(24px);
    border-bottom: none;
    transition: background 0.3s;
    gap: 10px;
}
.nav-hamburger { flex-shrink: 0; order: 1; }
.nav-logo      { flex-shrink: 0; order: 2; }
.nav-center    { order: 3; flex: 1 1 auto; justify-content: center; }
.nav-right     { order: 4; margin-left: auto; flex-shrink: 0; }
/* Neon cyan/blue underline — full viewport width, sits right below the nav */
.nav-neon-line {
    position: fixed;
    top: 78px;      /* ticker (22px) + nav (~56px) on desktop */
    left: 0; right: 0; width: 100vw;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(78, 205, 196, 0.6) 0%,
        rgba(78, 205, 196, 0.95) 25%,
        rgba(62, 168, 245, 1) 50%,
        rgba(78, 205, 196, 0.95) 75%,
        rgba(78, 205, 196, 0.6) 100%);
    box-shadow:
        0 0 8px rgba(78, 205, 196, 0.75),
        0 0 22px rgba(62, 168, 245, 0.5),
        0 0 40px rgba(62, 168, 245, 0.22);
    pointer-events: none;
    z-index: 201;
}
@media (max-width: 768px) {
    .nav-neon-line { top: 70px; }  /* ticker (18px) + slimmer mobile nav (~52px) */
}
[data-theme="light"] .nav { background: var(--bg); }
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.nav-logo-img {
    width: 32px; height: 32px; border-radius: 8px;
    object-fit: cover; cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.nav-logo-img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(78, 205, 196, 0.3);
}
.logo-expand-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6,10,16,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 9998; align-items: center; justify-content: center;
    cursor: pointer; padding: 40px 20px;
}
.logo-expand-overlay.open { display: flex; }
.logo-expand-img {
    max-width: 80vw; max-height: 70vh; border-radius: 20px;
    box-shadow: 0 0 80px rgba(62, 168, 245, 0.3);
    object-fit: contain;
}
.nav-logo-text {
    font-family: 'Inter', sans-serif;
    font-weight: 800; font-size: 1.05rem;
    letter-spacing: 5px; text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.2);
    transition: color 0.4s, text-shadow 0.4s;
}
.nav-logo:hover .nav-logo-text {
    color: var(--green);
    text-shadow: 0 0 24px rgba(78, 205, 196, 0.35);
}
.nav-center { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.nav-center a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem; color: var(--text-dim);
    text-decoration: none; letter-spacing: 1px; text-transform: uppercase;
    transition: color 0.3s; white-space: nowrap;
}
.nav-center a:hover { color: var(--green); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-btn {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 6px 10px; cursor: pointer; font-size: 0.8rem;
    color: var(--text-dim); transition: all 0.3s;
}
.theme-btn:hover { border-color: var(--green); color: var(--green); }
.nav-live {
    display: flex; align-items: center; gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem; color: var(--green); letter-spacing: 1px;
}
.live-dot {
    width: 6px; height: 6px; background: var(--green);
    border-radius: 50%; animation: pulse-dot 2s infinite;
    box-shadow: 0 0 8px var(--green);
}
.ssl-badge {
    display: flex; align-items: center; gap: 0;
    color: var(--green);
    padding: 6px; border: 1px solid rgba(78,205,196,0.3); border-radius: 6px;
    background: rgba(78,205,196,0.04);
    cursor: pointer; transition: all 0.3s;
    text-decoration: none;
}
.ssl-badge span { display: none; }
.ssl-badge:hover {
    border-color: var(--green); background: rgba(78,205,196,0.12);
    box-shadow: 0 0 12px rgba(78,205,196,0.15);
}
.ssl-badge svg { flex-shrink: 0; }
.ssl-popup {
    display: none; position: fixed;
    top: 60px; right: 16px;
    background: var(--bg); border: 1px solid var(--green);
    border-radius: 12px; padding: 20px 24px;
    z-index: 300; min-width: 280px; max-width: 340px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    font-family: 'JetBrains Mono', monospace;
}
.ssl-popup.open { display: block; }
.ssl-popup-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.75rem; font-weight: 700; color: var(--green);
    letter-spacing: 1px; margin-bottom: 16px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.ssl-popup-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; font-size: 0.65rem;
}
.ssl-popup-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.ssl-popup-value { color: var(--text); font-weight: 600; text-align: right; }
.ssl-popup-value.green { color: var(--green); }
.ssl-popup-close {
    margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: 0.55rem; color: var(--text-dim); text-align: center;
    letter-spacing: 1px;
}

/* === HERO === */
.hero {
    position: relative; min-height: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 100px 24px 40px; text-align: center; overflow: hidden;
}
.hero-glow {
    position: absolute; width: 700px; height: 700px;
    background: radial-gradient(circle, var(--glow-primary) 0%, var(--glow-secondary) 30%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation: glow-breathe 8s ease-in-out infinite;
    pointer-events: none;
}
[data-theme="light"] .hero-glow { opacity: 0.4; }
[data-theme="light"] .hero-title {
    text-shadow: none;
}
[data-theme="light"] .nav-logo-text {
    color: var(--text);
    text-shadow: 0 0 16px rgba(43, 168, 158, 0.1);
}
[data-theme="light"] .nav-logo:hover .nav-logo-text {
    color: var(--blue);
}
.hero-badge {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--accent); letter-spacing: 3px; text-transform: uppercase;
    padding: 8px 20px; border: 1px solid rgba(62,168,245,0.3);
    border-radius: 20px; margin-bottom: 32px; position: relative; z-index: 2;
    background: var(--blue-dim);
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(3.5rem, 10vw, 7rem);
    font-weight: 900; letter-spacing: -2px; line-height: 1;
    position: relative; z-index: 2; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--green), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: hero-arrive 1s ease-out both;
}
@keyframes hero-arrive {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.hero-subtitle-brand {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    font-weight: 300; letter-spacing: 8px; text-transform: uppercase;
    color: var(--text-dim); position: relative; z-index: 2;
    margin-bottom: 32px;
}

.hero-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: var(--text-dim); letter-spacing: 4px; text-transform: uppercase;
    margin-bottom: 40px; position: relative; z-index: 2;
}
.hero-desc {
    max-width: 720px; font-size: 1.15rem; line-height: 1.7;
    color: var(--text-dim); margin-bottom: 48px; position: relative; z-index: 2;
}
.hero-actions {
    display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
    position: relative; z-index: 2; margin-bottom: 32px;
}
.btn-primary {
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 1.5px; text-transform: uppercase; padding: 14px 32px;
    background: var(--green); color: var(--bg-primary); border: none; border-radius: 6px;
    cursor: pointer; text-decoration: none; transition: all 0.3s; display: inline-block;
}
.btn-primary:hover { filter: brightness(1.2); box-shadow: 0 0 30px rgba(62,207,142,0.3); }
.btn-outline {
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 500;
    letter-spacing: 1.5px; text-transform: uppercase; padding: 14px 32px;
    background: transparent; color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; text-decoration: none; transition: all 0.3s; display: inline-block;
}
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.social-bar {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    position: relative; z-index: 2;
}
.social-link {
    display: flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;
    color: var(--text); text-decoration: none; letter-spacing: 1px;
    padding: 12px 24px; border: 1px solid var(--border); border-radius: 8px;
    transition: all 0.3s;
}
.social-link:hover { border-color: var(--green); color: var(--green); }

/* === STATUS BAR === */
.status-bar-wrap {
    padding: 20px 24px; position: relative; z-index: 2;
}
.status-bar {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px; max-width: 1100px; margin: 0 auto;
}
.status-item {
    text-align: center; padding: 12px;
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.status-value {
    font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700;
    color: var(--green);
}
.status-value.amber { color: var(--amber); }
.status-value.blue { color: var(--blue); }
.status-label {
    font-size: 0.6rem; color: var(--text-dim); letter-spacing: 1px;
    text-transform: uppercase; margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}
a.status-link {
    display: block; text-decoration: none; cursor: pointer;
    position: relative; z-index: 3;
    transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}
a.status-link:hover {
    border-color: var(--green);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.15);
}

/* === TICKER BAR === */
.ticker-bar {
    border-bottom: 1px solid var(--border); padding: 14px 0;
    overflow: hidden; position: relative; z-index: 2;
}
.ticker-track {
    display: flex; gap: 48px;
    animation: ticker-scroll 35s linear infinite; width: max-content;
}
.ticker-item {
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    letter-spacing: 1px; white-space: nowrap; color: var(--text-dim);
}
.ticker-item span { color: var(--green); }

/* === SECTIONS === */
section { position: relative; z-index: 2; padding: 100px 24px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--green); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
    letter-spacing: -1px; margin-bottom: 20px; line-height: 1.1;
}
.section-text {
    font-size: 1rem; line-height: 1.8; color: var(--text-dim); max-width: 700px;
}
.section-divider { border-top: 1px solid var(--border); }

/* === POSITIONS === */
.positions-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pos-card {
    padding: 16px; background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; cursor: pointer; transition: all 0.3s;
    font-family: 'JetBrains Mono', monospace;
}
.pos-card:hover { border-color: rgba(62,207,142,0.3); }
.pos-card.long { border-left: 3px solid var(--green); }
.pos-card.short { border-left: 3px solid var(--red); }
.pos-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.pos-symbol { font-weight: 700; font-size: 0.9rem; }
.pos-regime {
    font-size: 0.55rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-dim); padding: 2px 8px;
    border: 1px solid var(--border); border-radius: 4px;
}
.pos-summary {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    font-size: 0.7rem;
}
.pos-summary-item { text-align: center; }
.pos-summary-label { color: var(--text-dim); font-size: 0.55rem; letter-spacing: 1px; margin-bottom: 2px; }
.pos-summary-value { font-weight: 600; }
.pos-summary-value.positive { color: var(--green); }
.pos-summary-value.negative { color: var(--red); }

/* Position detail expand */
.pos-detail {
    display: none; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
}
.pos-card.expanded .pos-detail { display: block; }
.tv-link { background: transparent; transition: background 0.3s; }
.tv-link:hover { background: rgba(62,168,245,0.1); }
.tv-chart-wrap { margin-top: 12px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); position: relative; }
.tv-chart-wrap iframe { display: block; }
.tv-fullscreen-btn {
    position: absolute; bottom: 8px; right: 8px; z-index: 10;
    background: rgba(19,23,34,0.85); border: none; border-radius: 4px;
    color: rgba(255,255,255,0.7); cursor: pointer; padding: 5px; line-height: 0;
    transition: all 0.15s; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
}
.tv-fullscreen-btn:hover { color: var(--text-primary); background: rgba(19,23,34,0.95); }
.tv-fullscreen-btn svg { display: block; }

/* Fullscreen overlay - appended to body, not nested in card */
.tv-fullscreen-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 9999; background: var(--bg-primary); display: flex; flex-direction: column;
}
.tv-fullscreen-overlay iframe {
    flex: 1; width: 100% !important; height: 100% !important;
    border: none !important; border-radius: 0 !important; margin: 0 !important;
}
.tv-fullscreen-close {
    position: absolute; top: 12px; right: 12px; z-index: 10000;
    background: rgba(19,23,34,0.9); border: none; border-radius: 4px;
    color: var(--text-primary); cursor: pointer; padding: 6px; line-height: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}
.tv-fullscreen-close:hover { background: rgba(239,68,68,0.8); }
.pos-layers {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px;
}
.pos-layer {
    padding: 10px; background: rgba(0,0,0,0.2); border-radius: 6px;
    border: 1px solid var(--border); font-size: 0.65rem;
}
.pos-layer-title {
    font-weight: 700; letter-spacing: 1px; font-size: 0.55rem;
    margin-bottom: 4px; text-transform: uppercase;
}
.pos-layer-title.stop { color: var(--red); }
.pos-layer-title.be { color: var(--amber); }
.pos-layer-title.trail { color: var(--green); }
.pos-telemetry {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px; font-size: 0.65rem;
}
.pos-telem-item { color: var(--text-dim); }
.pos-telem-item span { color: var(--text); font-weight: 600; }
.pos-empty {
    text-align: center; padding: 40px; color: var(--text);
    opacity: 0.75;
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
}

/* === STATS GRID === */
.origin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; }
.origin-stat {
    padding: 28px; background: var(--card);
    border: 1px solid var(--border); border-radius: 12px;
}
.origin-stat-value {
    font-family: 'JetBrains Mono', monospace; font-size: 2rem;
    font-weight: 700; color: var(--green); margin-bottom: 6px;
}
.origin-stat-label { font-size: 0.8rem; color: var(--text-dim); }

/* === ENGINE CARDS === */
.engine-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin-top: 48px;
}
.engine-card {
    padding: 28px; background: var(--card);
    border: 1px solid var(--border); border-radius: 12px;
    transition: all 0.3s; position: relative; overflow: hidden;
}
.engine-card:hover { border-color: rgba(62,207,142,0.3); transform: translateY(-2px); }
.engine-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.engine-card.trend::before { background: var(--green); }
.engine-card.trap::before { background: var(--amber); }
.engine-card.chop::before { background: var(--purple); }
.engine-card.genesis::before { background: var(--blue); }
.engine-icon { font-size: 1.5rem; margin-bottom: 12px; }
.engine-name {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px;
}
.engine-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }

/* === INTELLIGENCE CHAIN === */
.chain-flow { display: flex; flex-direction: column; gap: 0; margin-top: 48px; position: relative; }
.chain-line {
    position: absolute; left: 24px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(180deg, var(--green), var(--blue), var(--purple), var(--amber));
    opacity: 0.3;
}
.chain-node { display: flex; align-items: flex-start; gap: 20px; padding: 24px 0; position: relative; }
.chain-dot {
    width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
    position: relative; z-index: 2;
}
.chain-dot.green { background: var(--green); box-shadow: 0 0 12px var(--green); }
.chain-dot.blue { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.chain-dot.purple { background: var(--purple); box-shadow: 0 0 12px var(--purple); }
.chain-dot.amber { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.chain-time {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--text-dim); margin-bottom: 4px; letter-spacing: 1px;
}
.chain-title {
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
    font-weight: 700; letter-spacing: 1px; margin-bottom: 4px;
}
.chain-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }

/* === SWARM TERMINAL === */
.swarm-section {
    position: relative; overflow: hidden;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(78, 205, 196, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(62, 168, 245, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 90% 40% at 50% 100%, rgba(139, 92, 246, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, transparent 0%, rgba(6, 10, 16, 0.4) 50%, transparent 100%);
}
.swarm-section::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background-image:
        radial-gradient(circle 1px, rgba(78, 205, 196, 0.15) 1px, transparent 1px),
        radial-gradient(circle 1px, rgba(62, 168, 245, 0.1) 1px, transparent 1px);
    background-size: 48px 48px, 72px 72px;
    background-position: 0 0, 24px 24px;
    opacity: 0.4;
    animation: swarm-drift 20s linear infinite;
}
.swarm-section > * { position: relative; z-index: 1; }
@keyframes swarm-drift {
    0% { background-position: 0 0, 24px 24px; }
    100% { background-position: 48px 48px, 96px 96px; }
}
[data-theme="light"] .swarm-section {
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(43, 168, 158, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 60%, rgba(37, 128, 200, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 90% 40% at 50% 100%, rgba(109, 63, 192, 0.03) 0%, transparent 60%),
        linear-gradient(180deg, transparent 0%, rgba(240, 244, 248, 0.3) 50%, transparent 100%);
}
[data-theme="light"] .swarm-section::before {
    background-image:
        radial-gradient(circle 1px, rgba(43, 168, 158, 0.12) 1px, transparent 1px),
        radial-gradient(circle 1px, rgba(37, 128, 200, 0.08) 1px, transparent 1px);
    opacity: 0.3;
}
.swarm-tabs {
    display: flex; gap: 8px; margin-top: 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-wrap: nowrap;
}
.swarm-tabs::-webkit-scrollbar { display: none; }
.swarm-tab {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    letter-spacing: 1px; padding: 8px 16px; border-radius: 6px;
    border: 1px solid var(--border); background: transparent;
    color: var(--text-dim); cursor: pointer; transition: all 0.3s;
    text-transform: uppercase; font-weight: 600;
    flex-shrink: 0; white-space: nowrap;
}
.swarm-tab.active { border-color: var(--tab-color, var(--green)); color: var(--tab-color, var(--green)); background: rgba(0,0,0,0.2); }
.swarm-tab:hover { border-color: var(--tab-color, var(--green)); color: var(--tab-color, var(--green)); }
.swarm-terminal {
    margin-top: 16px; background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
[data-theme="light"] .swarm-terminal { background: rgba(6, 10, 16, 0.04); }
.swarm-terminal-header {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border);
}
.swarm-terminal-dot { width: 8px; height: 8px; border-radius: 50%; }
.swarm-terminal-title {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    color: var(--text-dim); letter-spacing: 1px; margin-left: 8px;
}
.swarm-terminal-body {
    padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    line-height: 1.8; color: var(--green); min-height: 300px; max-height: 500px;
    overflow-y: auto; -webkit-overflow-scrolling: touch; white-space: pre-wrap; word-break: break-word;
}
[data-theme="light"] .swarm-terminal-body { color: var(--blue); }
.swarm-terminal-body::-webkit-scrollbar { width: 6px; }
.swarm-terminal-body::-webkit-scrollbar-track { background: transparent; }
.swarm-terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.swarm-line-count {
    font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
    color: var(--text-dim); margin-left: auto; letter-spacing: 1px;
}

/* === TIERS === */
.tier-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; margin-top: 48px;
}
.tier-card {
    padding: 32px; background: var(--card);
    border: 1px solid var(--border); border-radius: 12px; position: relative;
}
.tier-card.featured {
    border-color: rgba(62,207,142,0.4);
    box-shadow: 0 0 40px rgba(62,207,142,0.05);
}
.tier-badge {
    font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
    letter-spacing: 2px; text-transform: uppercase; color: var(--green); margin-bottom: 16px;
}
.tier-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.tier-price {
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
    color: var(--text-dim); margin-bottom: 20px;
}
.tier-features { list-style: none; padding: 0; }
.tier-features li {
    font-size: 0.85rem; color: var(--text-dim); padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; gap: 10px;
}
.tier-features li::before {
    content: ''; width: 4px; height: 4px;
    background: var(--green); border-radius: 50%; flex-shrink: 0;
}
.tier-soon {
    font-family: 'JetBrains Mono', monospace; font-size: 0.65rem;
    letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim);
    margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* === GATING === */
.gated { position: relative; }
.gate-lock {
    display: none;
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11,11,15,0.92); backdrop-filter: blur(8px);
    z-index: 10; border-radius: 12px;
    flex-direction: column; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace; text-align: center;
}
.gated.locked .gate-lock { display: flex; }
.gate-lock-icon { font-size: 2rem; margin-bottom: 12px; }
.gate-lock-text { font-size: 0.75rem; color: var(--text-dim); letter-spacing: 1px; }

/* === FOOTER === */
.footer {
    padding: 60px 24px 40px; border-top: 1px solid var(--border); text-align: center;
    position: relative; z-index: 2;
}
.footer-logo {
    font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
    font-weight: 700; color: var(--green); letter-spacing: 3px; margin-bottom: 20px;
}
.footer-links {
    display: flex; gap: 24px; justify-content: center; margin-bottom: 32px; flex-wrap: wrap;
}
.footer-links a {
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    color: var(--text-dim); text-decoration: none; letter-spacing: 1px;
    text-transform: uppercase; transition: color 0.3s;
    display: flex; align-items: center; gap: 6px;
}
.footer-links a:hover { color: var(--green); }
.footer-copy { font-size: 0.7rem; color: rgba(90, 90, 110, 0.6); }

/* === ANIMATIONS === */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
    50% { opacity: 0.5; box-shadow: 0 0 16px var(--green); }
}
@keyframes glow-breathe {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}
@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
/* title-shine removed — replaced by hero-glow-breathe */
@keyframes cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.blink { animation: cursor-blink 1s infinite; }
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* === HERO LOGO — theme-swapped pair === */
/* Dark-mode default: show dark variant, hide light. Flip on light theme. */
[data-theme="dark"] .hero-logo-light { display: none !important; }
[data-theme="dark"] .hero-logo-dark  { display: block !important; }
[data-theme="light"] .hero-logo-dark  { display: none !important; }
[data-theme="light"] .hero-logo-light { display: block !important; margin: 0 auto 22px; }


/* === HERO BANNER IMAGE === */
.hero-banner {
    position: relative; z-index: 2;
    width: 100%; max-width: 900px;
    margin-bottom: 32px;
    border-radius: 16px; overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 60px rgba(62, 168, 245, 0.08);
}
.hero-banner img {
    width: 100%; height: auto; display: block;
}

/* === NTFY BADGE === */
.ntfy-badge {
    display: flex; align-items: center; gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem; color: var(--accent);
    letter-spacing: 1px; padding: 4px 8px;
    border: 1px solid rgba(62,168,245,0.3); border-radius: 4px;
    background: rgba(62,168,245,0.05);
    cursor: pointer; transition: all 0.3s;
    text-decoration: none;
}
.ntfy-badge:hover { border-color: var(--accent); background: rgba(62,168,245,0.12); }

/* === SECURITY GRID === */
.security-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px; margin-top: 40px;
}
.security-card {
    padding: 24px; background: var(--card);
    border: 1px solid var(--border); border-radius: 12px;
    position: relative; overflow: hidden;
    transition: all 0.3s;
}
.security-card:hover {
    border-color: rgba(78,205,196,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(78,205,196,0.06);
}
.security-icon { margin-bottom: 12px; }
.security-title {
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
    font-weight: 700; letter-spacing: 1px; margin-bottom: 8px;
}
.security-desc {
    font-size: 0.82rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px;
}
.security-status {
    font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
    letter-spacing: 2px; color: var(--green); font-weight: 700;
    padding: 4px 10px; border: 1px solid rgba(78,205,196,0.3);
    border-radius: 4px; display: inline-block;
    background: rgba(78,205,196,0.06);
}

/* === EXPLORE BUTTONS === */
.explore-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-top: 24px;
}
.explore-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; background: var(--card);
    border: 1px solid var(--border); border-radius: 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
    color: var(--text); text-decoration: none; letter-spacing: 1px;
    transition: all 0.3s; text-transform: uppercase;
}
.explore-btn:hover {
    border-color: var(--accent); color: var(--accent);
    transform: translateY(-2px); box-shadow: 0 4px 20px rgba(62,168,245,0.1);
}
.explore-btn-icon { font-size: 1.2rem; }
.explore-btn-arrow { margin-left: auto; opacity: 0.4; transition: opacity 0.3s; }
.explore-btn:hover .explore-btn-arrow { opacity: 1; }

/* === MOBILE HAMBURGER + DROPDOWN === */
.nav-hamburger {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; color: var(--text-dim); transition: color 0.3s;
    border: 1px solid var(--border); border-radius: 6px;
}
.nav-hamburger:hover { color: var(--green); border-color: var(--green); }
.nav-hamburger svg { display: block; }

.mobile-dropdown {
    position: fixed; top: 78px;   /* ticker (22px) + desktop nav (~56px) */
    left: 0; right: 0;
    background: rgba(6, 10, 16, 0.98);
    backdrop-filter: blur(24px);
    /* border-bottom only when open — was creating a 2px ghost line right
       below the neon line when dropdown is closed (max-height:0 collapses
       the box but the border still renders as a strip). */
    z-index: 150;
    display: flex; flex-direction: column;
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
@media (max-width: 768px) {
    .mobile-dropdown { top: 74px; }  /* ticker (18px) + mobile nav (~56px) */
}
.mobile-dropdown.open { max-height: calc(100vh - 80px); overflow-y: auto; pointer-events: auto; border-bottom: 2px solid var(--green); }
[data-theme="light"] .mobile-dropdown {
    background: rgba(240, 244, 248, 0.98);
    border-bottom-color: var(--green);
}
[data-theme="light"] .mobile-dropdown a { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .mobile-dropdown a:hover { background: rgba(43, 168, 158, 0.08); }
.mobile-dropdown a {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem; color: var(--text); font-weight: 600;
    text-decoration: none; letter-spacing: 2px; text-transform: uppercase;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(30, 55, 90, 0.3);
    transition: all 0.3s;
    opacity: 0; transform: translateY(-8px);
}
.mobile-dropdown.open a {
    opacity: 1; transform: translateY(0);
    animation: menu-stair 0.3s ease forwards;
}
.mobile-dropdown a:nth-child(1) { animation-delay: 0.03s; }
.mobile-dropdown a:nth-child(2) { animation-delay: 0.06s; }
.mobile-dropdown a:nth-child(3) { animation-delay: 0.09s; }
.mobile-dropdown a:nth-child(4) { animation-delay: 0.12s; }
.mobile-dropdown a:nth-child(5) { animation-delay: 0.15s; }
.mobile-dropdown a:nth-child(6) { animation-delay: 0.18s; }
.mobile-dropdown a:nth-child(7) { animation-delay: 0.21s; }
.mobile-dropdown a:nth-child(8) { animation-delay: 0.24s; }
.mobile-dropdown a:nth-child(9) { animation-delay: 0.27s; }
.mobile-dropdown a:nth-child(10) { animation-delay: 0.30s; }
.mobile-dropdown a:nth-child(11) { animation-delay: 0.33s; }
.mobile-dropdown a:hover, .mobile-dropdown a:active {
    color: var(--green); background: rgba(78, 205, 196, 0.05);
    padding-left: 32px;
}
@keyframes menu-stair {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .nav-center { gap: 10px; }
    .nav-center a { font-size: 0.55rem; letter-spacing: 0.5px; }
}
@media (max-width: 768px) {
    .nav-center { display: none; }
    .nav-hamburger { display: block; }
    .ntfy-badge { display: none; }
    .nav-live { display: none; }
    /* Tighten nav so GitHub + theme-btn + SSL all stay visible on narrow phones */
    .nav { padding: 8px 12px; gap: 8px; }
    .nav-right { gap: 6px; flex-shrink: 0; }
    .nav-right > * { flex-shrink: 0; }
    .nav-logo { min-width: 0; flex-shrink: 1; }
    .nav-logo-text { letter-spacing: 2px; font-size: 0.95rem; }
    .origin-grid { grid-template-columns: 1fr 1fr; }
    .engine-grid { grid-template-columns: 1fr; }
    .tier-grid { grid-template-columns: 1fr; }
    .hero { padding: 80px 20px 40px; }
    section { padding: 60px 16px; }
    .chain-flow { padding-left: 8px; }
    .status-bar { grid-template-columns: repeat(2, 1fr); }
    .pos-layers { grid-template-columns: 1fr; }
    .pos-summary { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: clamp(2.5rem, 12vw, 4rem); }
    .security-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    /* Very narrow phones: hide the logo wordmark, keep the logo image */
    .nav-logo-text { display: none; }
    .nav { padding: 8px 10px; gap: 6px; }
    .nav-right { gap: 4px; }
}
@media (max-width: 480px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .btn-primary, .btn-outline { text-align: center; }
    .status-bar { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-title { animation: none !important; }
}

/* ─── GLOBAL TOP TICKER — fixed above the nav ─── */
.site-ticker {
    position: fixed !important;
    top: 0 !important; left: 0; right: 0;
    overflow: hidden;
    background: var(--bg2);
    border-bottom: 1px solid rgba(255,215,0,0.22);
    padding: 0;
    z-index: 210 !important;
    height: 22px;
    transition: background 0.3s, border-color 0.3s;
}
[data-theme="light"] .site-ticker {
    background: var(--bg);
    border-bottom: 1px solid rgba(184, 116, 10, 0.35);
}
[data-theme="light"] .site-ticker .ticker-item { color: var(--text); }
[data-theme="light"] .site-ticker .ticker-source {
    color: var(--amber) !important;
    border: 1px solid rgba(184,116,10,0.35);
    background: rgba(184,116,10,0.06);
}
.site-ticker .ticker-track {
    display: inline-block !important;
    white-space: nowrap;
    animation: site-ticker-scroll 180s linear infinite;
    will-change: transform;
    line-height: 22px !important;
}
.site-ticker .ticker-item {
    display: inline-block !important;
    padding: 0 18px !important;
    font-size: 0.64rem !important;
    color: var(--text);
    vertical-align: middle;
}
.site-ticker .ticker-source {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 0.5rem !important;
    color: var(--gold) !important;
    letter-spacing: 0.8px;
    margin-right: 6px !important;
    padding: 1px 5px !important;
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 3px;
    display: inline-block;
    background: rgba(255,215,0,0.04);
}
.site-ticker .ticker-item a { color: inherit; text-decoration: none; }
.site-ticker .ticker-item a:hover { color: var(--green); }

.nav { top: 22px !important; }
body { padding-top: 22px !important; }

@media (max-width: 768px) {
    .site-ticker { height: 18px !important; }
    .site-ticker .ticker-track { line-height: 18px !important; animation-duration: 140s !important; }
    .site-ticker .ticker-item { padding: 0 10px !important; font-size: 0.52rem !important; }
    .site-ticker .ticker-source { font-size: 0.42rem !important; padding: 0 3px !important; margin-right: 4px !important; }
    .nav { top: 18px !important; padding: 8px 12px !important; }
    body { padding-top: 18px !important; }
}
.site-ticker .ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: site-ticker-scroll 180s linear infinite;
    will-change: transform;
}
.site-ticker .ticker-item {
    display: inline-block;
    padding: 0 28px;
    font-size: 0.72rem;
    color: var(--text);
    vertical-align: middle;
}
.site-ticker .ticker-source {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: var(--accent);
    letter-spacing: 1px;
    margin-right: 8px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    display: inline-block;
}
.site-ticker .ticker-item.crypto .ticker-source { color: var(--amber); border-color: rgba(245,166,35,0.3); }
.site-ticker .ticker-item a { color: inherit; text-decoration: none; }
.site-ticker .ticker-item a:hover { color: var(--green); }
@keyframes site-ticker-scroll {
    from { transform: translate3d(0,0,0); }
    to   { transform: translate3d(-50%,0,0); }
}
