/* =====================================
   Meridian City Site Theme Version 0.1
   Dusk: ink blue, a lamp-warm accent,
   soft cyan for the live bits.
   ===================================== */
:root {
    color-scheme: dark;

    --bg-page: #0f1420;
    --bg-surface: #151c2b;
    --bg-surface-alt: #1b2436;
    --bg-terminal: #0b0f18;

    --text-heading: #eef1f7;
    --text-body: #c4cbdb;
    --text-secondary: #9aa5bb;
    --text-muted: #6f7a90;

    --border-color: #26304a;
    --border-glow: #3a4a70;

    --accent: #f2b880;
    --accent-hover: #f7c99c;
    --cyan: #7fc8d8;
    --button-text: #14192a;

    --ok: #8fd3a0;
    --warn: #f2d27f;
    --bad: #e98a8a;

    --font-body: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

    /* rgba tints, kept in sync with the colours above */
    --shadow-color: 0, 0, 0;
    --accent-glow: 242, 184, 128;
    --cyan-glow: 127, 200, 216;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(1000px 500px at 85% -10%, rgba(var(--cyan-glow), 0.10), transparent 60%),
        radial-gradient(800px 500px at 5% 10%, rgba(var(--accent-glow), 0.07), transparent 60%),
        var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

main {
    flex: 1;
}

a {
    color: var(--cyan);
}

a:hover {
    color: var(--text-heading);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

code, kbd, pre {
    font-family: var(--font-mono);
}

code {
    font-size: 0.9em;
    padding: 0.1em 0.4em;
    border-radius: 5px;
    background: rgba(var(--cyan-glow), 0.12);
    color: var(--cyan);
}

pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Type */
h1, h2, h3, h4 {
    color: var(--text-heading);
    line-height: 1.15;
    letter-spacing: -0.015em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.eyebrow .sep {
    color: var(--cyan);
    margin: 0 0.3em;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 64ch;
}

/* Navigation */
.top-nav {
    position: sticky;
    top: 0;
    background: rgba(15, 20, 32, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 998;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    padding: 0 2rem;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-heading);
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(var(--cyan-glow), 0.2), 0 0 18px rgba(var(--cyan-glow), 0.2);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-top: 0.3rem;
}

.nav-container {
    flex: 1;

    display: flex;
    align-items: center;

    margin-left: 2rem;
}

.nav-links {
    list-style: none;

    display: flex;
    align-items: center;
    gap: 1.5rem;

    margin-left: auto;
}

.nav-links a {
    position: relative;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.4rem 0;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-heading);
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-glow), 0.8);
}

.nav-actions {
    flex-shrink: 0;
    margin-left: 1.5rem;
}

.guide-btn {
    display: inline-flex;
    align-items: center;

    text-decoration: none;
    color: var(--text-heading);
    font-weight: 600;
    font-size: 0.9rem;

    padding: 0.55rem 1rem;
    border: 1px solid var(--border-glow);
    border-radius: 999px;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-btn:hover {
    color: var(--text-heading);
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(var(--cyan-glow), 0.25);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    border: none;
    background: none;
    color: var(--text-heading);
    font-size: 1.8rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;

    padding: 0.8rem 1.4rem;
    border-radius: 8px;
    border: 1px solid transparent;

    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn.primary {
    background: var(--accent);
    color: var(--button-text);
    box-shadow: 0 0 24px rgba(var(--accent-glow), 0.3);
}

.btn.primary:hover {
    background: var(--accent-hover);
    color: var(--button-text);
    transform: translateY(-1px);
}

.btn.ghost {
    color: var(--text-heading);
    border-color: var(--border-glow);
}

.btn.ghost:hover {
    color: var(--text-heading);
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(var(--cyan-glow), 0.25);
}

/* MAIN CONTENT */
.site-main {
    padding-bottom: 3rem;
}

.section {
    padding: 4.5rem 0;
}

.section.alt {
    background: linear-gradient(180deg, rgba(var(--cyan-glow), 0.05), rgba(var(--cyan-glow), 0.02));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-tight {
    padding: 1.5rem 0 2rem;
}

.section-head {
    margin-bottom: 2.5rem;
}

.section-head h2,
.split-copy h2 {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.list-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* HERO */
.hero {
    padding: 4.5rem 0 3rem;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: start;
}

.hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 1.4rem;
}

.hero-sub {
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 60ch;
    margin-bottom: 1.2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

/* LIVE PANEL */
.live {
    padding: 1.4rem 1.5rem;
    box-shadow: 0 24px 50px rgba(var(--shadow-color), 0.4), inset 0 0 60px rgba(var(--cyan-glow), 0.04);
}

.live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.live-head .eyebrow {
    margin: 0;
}

.live-state {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 8px var(--ok);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.down {
    background: var(--text-muted);
    box-shadow: none;
    animation: none;
}

.status-dot.warn {
    background: var(--warn);
    box-shadow: 0 0 8px var(--warn);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.live-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.live-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;

    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(var(--cyan-glow), 0.05);
}

.live-name {
    font-weight: 600;
    color: var(--text-heading);
}

.live-where {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.live-empty,
.placeholder {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.live-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.live-stats dt {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.live-stats dd {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* CARDS */
.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
}

.card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* SPLIT */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.split-copy p {
    margin-bottom: 1.2rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.split-copy strong {
    color: var(--text-heading);
}

.split-copy .btn {
    margin-top: 0.4rem;
}

/* CODE */
.code {
    position: relative;
    background: var(--bg-terminal);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    margin: 1rem 0 1.4rem;

    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text-heading);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;

    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--text-secondary);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;

    transition: color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
    color: var(--text-heading);
    border-color: var(--cyan);
}

.copy-btn.done {
    color: var(--ok);
    border-color: var(--ok);
}

/* TERMINAL (error pages) */
.terminal {
    background: var(--bg-terminal);
    border: 1px solid var(--border-glow);
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 0.7rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--cyan-glow), 0.05);
}

.terminal-title {
    color: var(--accent);
    font-weight: 700;
}

.terminal-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.terminal-body {
    padding: 1.2rem 1.3rem;
    line-height: 1.7;
}

.line {
    margin: 0.25rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.line.you  { color: var(--cyan); }
.line.sys  { color: var(--text-muted); }
.line.luna { color: var(--text-heading); }

.error-view {
    margin-top: 3rem;
    max-width: 760px;
}

.section-foot {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* PAGE HEAD */
.page-head {
    padding: 3.5rem 0 2rem;
}

.page-head h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 1.1rem;
}

/* PROSE */
.info-prose {
    max-width: 78ch;
}

.info-prose section {
    margin-bottom: 2.6rem;
}

.info-prose h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 1.1rem;
    border-left: 3px solid var(--accent);
}

.info-prose p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.info-prose p:last-child {
    margin-bottom: 0;
}

.info-prose strong {
    color: var(--text-heading);
}

/* TABLES */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.4rem;
    font-size: 0.93rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.spec-table th,
.spec-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.55;
}

.spec-table thead th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(var(--cyan-glow), 0.06);
}

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

.spec-table td.handle,
.spec-table td:first-child {
    color: var(--text-heading);
}

/* RESIDENTS */
.resident-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.resident-list li {
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.resident-list strong {
    color: var(--text-heading);
    margin-right: 0.4rem;
}

/* FOOTER */
footer {
    padding: 2rem 2rem 2.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    max-width: 68ch;
}

.footer-brand .logo-mark {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.footer-tagline {
    color: var(--text-heading);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

footer p {
    margin: 0;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    justify-content: flex-end;
}

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

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

/* MOTION */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .status-dot {
        animation: none;
    }

    .btn {
        transition: none;
    }
}

/* TABLET */
@media (max-width: 900px) {

    .hero-inner,
    .split,
    .cards {
        grid-template-columns: 1fr;
    }

    .split {
        gap: 2rem;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

/* MOBILE NAV */
@media (max-width: 780px) {

    /* Header */
    .menu-toggle {
        display: block;
        margin-left: auto;
        font-size: 1.8rem;
        z-index: 999;
    }

    .logo-sub {
        display: none;
    }

    /* Full-screen menu */
    .nav-container {
        display: none;

        position: fixed;

        top: 70px;
        left: 0;

        width: 100vw;
        min-height: calc(100vh - 70px);

        margin-left: 0;
        padding: 1rem 2rem;

        background: var(--bg-page);
        border-top: 1px solid var(--border-color);

        flex-direction: column;
        align-items: stretch;

        overflow-y: auto;

        z-index: 10000;
    }

    .nav-container.active {
        display: flex !important;
    }

    /* Links */
    .nav-links {
        width: 100%;

        flex-direction: column;
        align-items: flex-start;

        gap: 0;
        margin-left: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a.active::after {
        display: none;
    }

    .nav-actions {
        margin: 1.5rem 0 0;
    }

    .guide-btn {
        width: 100%;
        justify-content: center;
    }

    /* Content */
    .container,
    .nav-inner {
        padding: 0 1.2rem;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .section {
        padding: 3rem 0;
    }

    .live-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .spec-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 600px) {

    .hero-actions .btn,
    .section-foot .btn {
        width: 100%;
        text-align: center;
    }
}
