:root {
    --bg: #05070b;
    --ink: #f4efe2;
    --muted: #aeb6bd;
    --panel: rgba(12, 17, 24, 0.82);
    --panel-strong: rgba(20, 27, 36, 0.94);
    --line: rgba(244, 239, 226, 0.16);
    --gold: #f1c36d;
    --blue: #7bd7ff;
    --green: #83e0aa;
    --rust: #df7d55;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 64px 64px,
        linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 64px 64px,
        radial-gradient(circle at 18% 8%, rgba(123, 215, 255, 0.16), transparent 32rem),
        radial-gradient(circle at 86% 12%, rgba(241, 195, 109, 0.14), transparent 30rem),
        var(--bg);
    font-family: "IBM Plex Mono", monospace;
    letter-spacing: 0;
}

#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.68;
}

a { color: inherit; }

.shell {
    position: relative;
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 26px 0 52px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.home-link,
.source-pill {
    border: 1px solid var(--line);
    background: rgba(5, 7, 11, 0.56);
    padding: 10px 12px;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.78rem;
}

.hero {
    min-height: 440px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
    gap: 28px;
    align-items: center;
}

.eyebrow,
.filter-title,
label,
th,
small {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}

h1, h2 {
    font-family: "Libre Baskerville", Georgia, serif;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 8vw, 7.6rem);
    line-height: 0.95;
    max-width: 760px;
}

.hero-copy p:last-child {
    max-width: 680px;
    color: #c8d1d6;
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.orbit-stage {
    position: relative;
    height: 380px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at center, rgba(241,195,109,0.11), transparent 16rem),
        rgba(5, 7, 11, 0.38);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.star {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 76px;
    height: 76px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #fff6c7 0 18%, var(--gold) 34%, rgba(223, 125, 85, 0.36) 70%, transparent 72%);
    box-shadow: 0 0 70px rgba(241, 195, 109, 0.7);
}

.orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    border: 1px solid rgba(244, 239, 226, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 18s linear infinite;
}

.orbit span {
    position: absolute;
    right: 9%;
    top: 14%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 22px rgba(123, 215, 255, 0.78);
}

.orbit-a { width: 150px; height: 92px; }
.orbit-b { width: 260px; height: 170px; animation-duration: 28s; }
.orbit-b span { background: var(--green); }
.orbit-c { width: 370px; height: 250px; animation-duration: 42s; }
.orbit-c span { background: var(--rust); }

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.control-deck,
.stats,
.catalog-wrap {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.control-deck {
    padding: 18px;
}

.search-row {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

input,
select,
button {
    font: inherit;
}

input[type="search"],
select {
    width: 100%;
    min-height: 46px;
    color: var(--ink);
    background: rgba(255,255,255,0.055);
    border: 1px solid var(--line);
    padding: 0 12px;
    outline: none;
}

input[type="search"]:focus,
select:focus {
    border-color: rgba(123, 215, 255, 0.72);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--gold);
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr 0.8fr 1fr;
    gap: 14px;
}

.filter-block {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 10px;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.segmented button {
    min-height: 38px;
    color: var(--muted);
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--line);
    cursor: pointer;
    font-size: 0.78rem;
}

.segmented button.active {
    color: #071016;
    background: var(--gold);
    border-color: var(--gold);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.045);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 18px 0;
    background: var(--line);
}

.stats div {
    min-width: 0;
    padding: 18px;
    background: var(--panel-strong);
}

.stats span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
    font: 700 clamp(1.35rem, 3vw, 2.3rem) "Libre Baskerville", Georgia, serif;
}

.catalog-wrap {
    overflow: hidden;
}

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.table-head h2,
.table-head p {
    margin: 0;
}

.table-head p {
    color: var(--muted);
    font-size: 0.82rem;
}

.table-scroll {
    max-height: 680px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 840px;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(244, 239, 226, 0.11);
    text-align: left;
}

tbody tr:hover {
    background: rgba(123, 215, 255, 0.07);
}

td {
    color: #dce5e8;
    font-size: 0.9rem;
}

.planet-name {
    color: var(--ink);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(123, 215, 255, 0.34);
    color: var(--blue);
    background: rgba(123, 215, 255, 0.08);
}

.temperate {
    border-color: rgba(131, 224, 170, 0.42);
    color: var(--green);
    background: rgba(131, 224, 170, 0.08);
}

@media (max-width: 920px) {
    .hero,
    .filter-grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .orbit-stage {
        height: 300px;
    }

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

    .source-pill {
        display: none;
    }
}
