:root {
    --bg: #030605;
    --bg-soft: #07100d;
    --panel: rgba(8, 15, 13, .88);
    --panel-solid: #09110f;
    --panel-lift: rgba(16, 28, 24, .82);
    --line: rgba(169, 206, 184, .12);
    --line-strong: rgba(170, 239, 197, .22);
    --text: #e7f4ea;
    --muted: #8da696;
    --quiet: #5f7569;
    --accent: #98ffb3;
    --accent-dim: rgba(152, 255, 179, .12);
    --blue: #86d7ff;
    --amber: #ffd879;
    --danger: #ff756f;
    --shadow: 0 26px 90px rgba(0, 0, 0, .44);
    --font: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    font-family: var(--font);
    background:
        linear-gradient(180deg, rgba(10, 18, 15, .2), transparent 38rem),
        radial-gradient(circle at 78% 12%, rgba(152, 255, 179, .08), transparent 28rem),
        radial-gradient(circle at 12% 28%, rgba(134, 215, 255, .07), transparent 24rem),
        var(--bg);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

body * {
    position: relative;
    z-index: 2;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.noise,
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.noise {
    opacity: .024;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
}

.scanlines {
    opacity: .1;
    mix-blend-mode: soft-light;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, .035),
        rgba(255, 255, 255, .035) 1px,
        transparent 1px,
        transparent 5px
    );
}

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    padding: 1rem 5vw;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 6, 5, .76);
    backdrop-filter: blur(18px);
}

.nav-left,
.nav-links,
.classification,
.system-bar,
.phase-top,
.terminal-header,
.terminal-actions,
.line-top,
.map-overlay,
.cta-row {
    display: flex;
    align-items: center;
}

.nav-left {
    gap: 1.1rem;
    flex-wrap: wrap;
}

.logo,
.footer-logo {
    font-size: .96rem;
    font-weight: 700;
    letter-spacing: .24rem;
}

.nav-status,
.nav-links a,
.classification,
.kicker,
.metric-label,
.spec-label,
.eyebrow,
.system-bar,
.term-title,
.term-subtitle,
.term-indicator,
.line-meta,
.line-coords,
.phase-index,
.phase-status,
.protocol-number,
.footer-text {
    font-size: .68rem;
    letter-spacing: .18rem;
    text-transform: uppercase;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
}

.status-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 18px rgba(152, 255, 179, .75);
}

.nav-links {
    justify-content: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    transition: color .25s ease, text-shadow .25s ease;
}

.nav-links a:hover {
    color: var(--text);
    text-shadow: 0 0 16px rgba(152, 255, 179, .36);
}

.hero {
    min-height: 100vh;
    padding: 5.6rem 5vw 7rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(38rem, 1.1fr);
    gap: clamp(2rem, 4vw, 4.8rem);
    align-items: start;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: .8rem;
}

.classification {
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
    gap: .1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
}

.classification span {
    padding: .68rem .85rem;
    border-right: 1px solid var(--line);
}

.classification span:last-child {
    border-right: 0;
}

.kicker {
    margin-bottom: 1rem;
    color: var(--accent);
}

h1 {
    max-width: 48rem;
    font-size: clamp(3.25rem, 6.5vw, 7rem);
    line-height: .88;
    letter-spacing: 0;
}

.sub {
    max-width: 42rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.9;
}

.cta-row {
    gap: .85rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0 1.3rem;
    border: 1px solid var(--line-strong);
    font: 700 .74rem var(--font);
    letter-spacing: .16rem;
    text-transform: uppercase;
    transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.primary {
    border-color: transparent;
    color: #021008;
    background: var(--accent);
    box-shadow: 0 0 34px rgba(152, 255, 179, .17);
}

.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}

.secondary:hover {
    border-color: rgba(152, 255, 179, .45);
    background: rgba(152, 255, 179, .06);
}

.status-grid,
.spec-grid,
.mutation-grid,
.protocol-grid {
    display: grid;
    gap: 1rem;
}

.status-grid,
.spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.spec-card,
.log-entry,
.mutation-card,
.protocol-card {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012)),
        var(--panel);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset;
}

.metric-card,
.spec-card {
    padding: 1.15rem;
}

.metric-label,
.spec-label {
    display: block;
    margin-bottom: .8rem;
    color: var(--quiet);
}

.metric-value,
.spec-value {
    display: block;
    color: var(--text);
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1;
    letter-spacing: 0;
}

.warning {
    color: var(--amber);
    text-shadow: 0 0 18px rgba(255, 216, 121, .26);
}

.terminal-shell {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(18, 31, 27, .9), rgba(5, 9, 8, .98)),
        var(--panel-solid);
    box-shadow: var(--shadow), 0 0 80px rgba(152, 255, 179, .055);
}

.system-bar {
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .88rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: rgba(255, 255, 255, .018);
}

.map-frame {
    overflow: hidden;
    background: #030605;
}

.map-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 401;
    justify-content: space-between;
    gap: 1rem;
    pointer-events: none;
    color: rgba(231, 244, 234, .72);
    font-size: .64rem;
    letter-spacing: .16rem;
    text-transform: uppercase;
}

.scan-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .6rem;
    border: 1px solid var(--line);
    background: rgba(3, 6, 5, .64);
    backdrop-filter: blur(8px);
}

.scan-chip span {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--accent);
    animation: signalBlink 1.1s infinite;
}

#map {
    width: 100%;
    height: min(58vh, 40rem);
    min-height: 29rem;
    z-index: 2;
    filter: brightness(.5) contrast(1.22) saturate(.45) hue-rotate(22deg);
}

#terminal {
    padding: 1.2rem;
    border-top: 1px solid var(--line);
    background: rgba(0, 0, 0, .62);
}

.terminal-header {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.term-title {
    margin-bottom: .35rem;
    color: var(--text);
}

.term-subtitle {
    color: var(--quiet);
    letter-spacing: .12rem;
}

.term-indicator {
    color: var(--accent);
}

.terminal-actions {
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.scan-button {
    min-height: 2.35rem;
    padding: 0 .85rem;
    border: 1px solid rgba(152, 255, 179, .28);
    color: var(--accent);
    background: rgba(152, 255, 179, .055);
    font: 700 .62rem var(--font);
    letter-spacing: .14rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.scan-button:hover {
    border-color: rgba(152, 255, 179, .55);
    background: rgba(152, 255, 179, .1);
}

.scan-button:disabled {
    cursor: wait;
    color: var(--quiet);
    border-color: var(--line);
    background: rgba(255, 255, 255, .025);
}

#feed {
    display: flex;
    gap: .9rem;
    min-height: 14.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: .4rem;
}

.line {
    flex: 0 0 19rem;
    display: flex;
    flex-direction: column;
    min-height: 13.4rem;
    padding: 1rem;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(152, 255, 179, .05), rgba(255, 255, 255, .012)),
        rgba(7, 13, 11, .86);
    animation: cardIn .42s ease both;
}

.line.system {
    border-color: rgba(134, 215, 255, .16);
}

.line.scanning {
    border-color: rgba(255, 216, 121, .26);
    background:
        linear-gradient(90deg, transparent, rgba(255, 216, 121, .055), transparent),
        rgba(7, 13, 11, .86);
    background-size: 220% 100%;
    animation: cardIn .42s ease both, scanSweep 1.8s linear infinite;
}

.line-top {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.line-meta {
    color: var(--accent);
}

.line-status {
    color: var(--quiet);
    font-size: .62rem;
    letter-spacing: .16rem;
    text-transform: uppercase;
}

.line-location {
    margin-bottom: .85rem;
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.15;
}

.line-headline {
    flex: 1;
    margin-bottom: 1.1rem;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.65;
}

.line-coords {
    color: var(--blue);
    letter-spacing: .12rem;
}

.hotspot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    color: #031008;
    background: var(--accent);
    box-shadow:
        0 0 16px rgba(152, 255, 179, .8),
        0 0 38px rgba(152, 255, 179, .32);
    animation: hotspotPulse 1.9s infinite;
}

.hotspot::before,
.hotspot::after {
    content: "";
    position: absolute;
    inset: -.45rem;
    border: 1px solid rgba(152, 255, 179, .45);
    border-radius: 50%;
    animation: ringPulse 2.4s infinite;
}

.hotspot::after {
    animation-delay: .8s;
}

.hotspot-number {
    z-index: 1;
    font-size: .68rem;
    font-weight: 800;
}

.leaflet-popup-content-wrapper {
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--text);
    background: #050807;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .44);
}

.leaflet-popup-tip {
    background: #050807;
}

.leaflet-popup-content {
    font-family: var(--font);
    line-height: 1.55;
}

.section {
    padding: 7rem 5vw;
}

.section-header {
    margin-bottom: 3.2rem;
}

.eyebrow {
    display: block;
    margin-bottom: .9rem;
    color: var(--accent);
}

.section-header h2 {
    max-width: 56rem;
    font-size: clamp(2.6rem, 5vw, 5.6rem);
    line-height: .9;
    letter-spacing: 0;
}

.section-copy {
    max-width: 42rem;
    margin-top: 1.15rem;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.8;
}

.archive-panel {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .008)),
        rgba(4, 8, 7, .72);
}

.archive-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .95rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--quiet);
    font-size: .68rem;
    letter-spacing: .16rem;
    text-transform: uppercase;
}

.log-list {
    display: flex;
    flex-direction: column;
}

.log-entry {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr) auto;
    gap: 1.25rem;
    align-items: start;
    padding: 1.2rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-year {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    color: var(--accent);
    font-size: 1rem;
}

.log-index {
    color: var(--quiet);
    font-size: .62rem;
    letter-spacing: .16rem;
    text-transform: uppercase;
}

.log-content h3,
.mutation-card h3,
.protocol-card h3 {
    letter-spacing: 0;
}

.log-content h3 {
    margin-bottom: .45rem;
    font-size: 1.25rem;
}

.log-content p,
.mutation-card li,
.protocol-card p {
    color: var(--muted);
    line-height: 1.8;
}

.log-meta {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: .85rem;
    color: var(--quiet);
    font-size: .66rem;
    letter-spacing: .12rem;
    text-transform: uppercase;
}

.log-coords {
    color: var(--blue);
    white-space: nowrap;
    font-size: .7rem;
    letter-spacing: .12rem;
}

.archive-empty {
    padding: 1.4rem 1rem;
    color: var(--muted);
    line-height: 1.7;
}

.archive-more {
    width: 100%;
    min-height: 3rem;
    border: 0;
    border-top: 1px solid var(--line);
    color: var(--accent);
    background: rgba(152, 255, 179, .045);
    font: 700 .68rem var(--font);
    letter-spacing: .16rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease;
}

.archive-more:hover {
    background: rgba(152, 255, 179, .085);
}

.chart-shell {
    overflow: hidden;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .008)),
        rgba(4, 8, 7, .72);
    box-shadow: var(--shadow);
}

#dexscreener-embed {
    position: relative;
    width: 100%;
    padding-bottom: 125%;
    background: #030605;
}

#dexscreener-embed iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    border: 0;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28rem;
}

.chart-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(152, 255, 179, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(152, 255, 179, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: .8;
}

.chart-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 42rem;
    padding: 2rem;
    text-align: center;
}

.chart-placeholder-label {
    color: var(--accent);
    font-size: .68rem;
    letter-spacing: .18rem;
    text-transform: uppercase;
}

.chart-placeholder strong {
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: .95;
    letter-spacing: 0;
}

.chart-placeholder p {
    color: var(--muted);
    line-height: 1.7;
}

.chart-placeholder code {
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: .75rem .9rem;
    border: 1px solid var(--line);
    color: var(--blue);
    background: rgba(0, 0, 0, .32);
}

.mutation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mutation-card,
.protocol-card {
    padding: 1.55rem;
}

.phase-top {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    color: var(--quiet);
}

.phase-status {
    color: var(--accent);
}

.mutation-card h3 {
    margin-bottom: 1.35rem;
    font-size: 1.8rem;
    line-height: 1.08;
}

.mutation-card ul {
    display: grid;
    gap: .85rem;
}

.mutation-card li {
    padding-left: 1rem;
}

.mutation-card li::before {
    content: "/";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.protocol-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.protocol-number {
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.protocol-card h3 {
    margin-bottom: .85rem;
    font-size: 1.45rem;
    line-height: 1.1;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2.5rem 5vw 3.5rem;
    border-top: 1px solid var(--line);
}

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

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(152, 255, 179, .2);
}

@keyframes signalBlink {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scanSweep {
    from { background-position: 180% 0; }
    to { background-position: -40% 0; }
}

@keyframes hotspotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.14); }
}

@keyframes ringPulse {
    0% {
        opacity: .55;
        transform: scale(.65);
    }
    100% {
        opacity: 0;
        transform: scale(1.85);
    }
}

@media (max-width: 1200px) {
    .hero-grid,
    .mutation-grid,
    .protocol-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        gap: 2rem;
    }

    .terminal-shell {
        order: -1;
    }
}

@media (min-width: 1400px) {
    #dexscreener-embed {
        padding-bottom: 65%;
    }
}

@media (max-width: 760px) {
    .nav {
        align-items: flex-start;
        padding: .95rem 1rem;
    }

    .nav,
    .nav-links {
        flex-direction: column;
    }

    .nav-links {
        align-items: flex-start;
        gap: .75rem;
    }

    .hero,
    .section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero {
        padding-top: 3.2rem;
        padding-bottom: 4.5rem;
    }

    .classification {
        width: 100%;
    }

    .classification span {
        flex: 1 1 100%;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .classification span:last-child {
        border-bottom: 0;
    }

    h1 {
        font-size: clamp(3rem, 12vw, 4.9rem);
    }

    .status-grid,
    .spec-grid {
        grid-template-columns: 1fr;
    }

    .system-bar,
    .map-overlay,
    .terminal-header,
    .terminal-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    #map {
        height: 27rem;
        min-height: 27rem;
    }

    #terminal {
        padding: 1rem;
    }

    .line {
        flex-basis: 16.5rem;
    }

    .log-entry {
        grid-template-columns: 1fr;
    }

    .log-coords {
        white-space: normal;
    }
}
