:root {
    --bg: #050712;
    --bg-2: #0b1024;
    --panel: rgba(255, 255, 255, 0.085);
    --panel-strong: rgba(255, 255, 255, 0.13);
    --text: #f7f8ff;
    --muted: #a9b4d4;
    --soft: #7680a0;
    --accent: #7ed2ff;
    --accent-2: #b586ff;
    --accent-3: #7dffcf;
    --danger: #ff7676;
    --warning: #ffd166;
    --good: #71e7a2;
    --border: rgba(255, 255, 255, 0.16);
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
    --radius: 28px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(126, 210, 255, 0.24), transparent 33rem),
        radial-gradient(circle at 90% 8%, rgba(181, 134, 255, 0.20), transparent 32rem),
        radial-gradient(circle at 50% 70%, rgba(125, 255, 207, 0.10), transparent 42rem),
        linear-gradient(150deg, #03040b 0%, #090e21 50%, #050712 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.65) 1px, transparent 1.4px),
        radial-gradient(circle, rgba(255,255,255,0.22) 1px, transparent 1.4px),
        linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
    background-size: 96px 96px, 148px 148px, 54px 54px, 54px 54px;
    opacity: 0.25;
}

button,
input,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.orb {
    position: fixed;
    z-index: -2;
    border-radius: 999px;
    filter: blur(10px);
    opacity: 0.4;
    pointer-events: none;
}

.orb-one {
    width: 22rem;
    height: 22rem;
    top: 9rem;
    left: -8rem;
    background: radial-gradient(circle, rgba(126, 210, 255, 0.42), transparent 70%);
}

.orb-two {
    width: 30rem;
    height: 30rem;
    right: -12rem;
    bottom: 4rem;
    background: radial-gradient(circle, rgba(181, 134, 255, 0.38), transparent 70%);
}

.topbar {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(126, 210, 255, 0.18), rgba(181, 134, 255, 0.14));
    box-shadow: inset 0 0 30px rgba(255,255,255,0.05);
}

.brand strong {
    display: block;
    letter-spacing: 0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 2px;
}

.topnav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
}

.topnav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    padding: 8px 13px;
    border-radius: 999px;
}

.topnav a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

main,
.footer {
    width: min(1240px, calc(100% - 32px));
    margin-inline: auto;
}

.hero {
    min-height: 48vh;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
    gap: clamp(22px, 5vw, 62px);
    align-items: end;
    padding: clamp(32px, 7vw, 86px) 0 clamp(28px, 6vw, 72px);
}

.hero-copy h1 {
    max-width: 920px;
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 6.4rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.hero-copy p:not(.eyebrow) {
    max-width: 760px;
    color: var(--muted);
    font-size: clamp(1rem, 1.7vw, 1.16rem);
    line-height: 1.75;
    margin: 24px 0 0;
}

.eyebrow,
.mini-label {
    margin: 0 0 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.76rem;
    font-weight: 900;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.glass {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.055));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-panel {
    padding: 24px;
}

.hero-panel strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1.25;
}

.hero-panel p {
    color: var(--muted);
    line-height: 1.65;
    margin: 12px 0 0;
}

.btn {
    border: 0;
    border-radius: 16px;
    padding: 13px 18px;
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

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

.btn:active {
    transform: translateY(0);
    opacity: 0.84;
}

.btn.primary {
    background: linear-gradient(135deg, #28bdff, #9d6bff 58%, #7dffcf);
    box-shadow: 0 14px 36px rgba(113, 145, 255, 0.22);
}

.btn.ghost {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
}

.btn.wide {
    width: 100%;
    margin-top: 18px;
}

.workspace {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.controls-card,
.sky-card,
.result-card,
.timeline-card,
.catalog-card {
    padding: clamp(18px, 2.5vw, 28px);
}

.controls-card {
    position: sticky;
    top: 84px;
}

.section-heading,
.result-topline,
.sky-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.section-heading h2,
.result-topline h2,
.sky-header h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.3vw, 1.75rem);
    line-height: 1.15;
}

.section-heading.compact {
    display: block;
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.92rem;
}

input,
select {
    width: 100%;
    min-height: 48px;
    color: var(--text);
    background: rgba(3, 4, 11, 0.62);
    border: 1px solid var(--border);
    border-radius: 15px;
    outline: none;
    padding: 12px 13px;
}

input:focus,
select:focus {
    border-color: rgba(126, 210, 255, 0.75);
    box-shadow: 0 0 0 4px rgba(126, 210, 255, 0.12);
}

.toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 16px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.055);
    color: var(--text);
    font-size: 0.86rem;
}

.toggle input {
    width: 17px;
    height: 17px;
    min-height: auto;
    accent-color: #7ed2ff;
}

.status {
    color: var(--muted);
    line-height: 1.55;
    margin: 14px 0 0;
    min-height: 44px;
}

.sky-card {
    overflow: hidden;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dot,
.line {
    display: inline-block;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--muted);
}

.dot.selected {
    background: #fff;
    box-shadow: 0 0 14px rgba(126,210,255,0.95);
}

.dot.star {
    background: rgba(255,255,255,0.85);
}

.line {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(126,210,255,0.2), rgba(126,210,255,1));
}

.canvas-wrap {
    position: relative;
    margin-top: 18px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 26px;
    background:
        radial-gradient(circle at center, rgba(126,210,255,0.08), rgba(255,255,255,0.02) 50%, rgba(0,0,0,0.14) 100%);
    overflow: hidden;
    touch-action: none;
}

#skyCanvas {
    display: block;
    width: 100%;
    height: min(72vh, 720px);
    min-height: 440px;
}

.canvas-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 170px;
    max-width: 260px;
    pointer-events: none;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    background: rgba(4, 6, 15, 0.86);
    box-shadow: 0 18px 42px rgba(0,0,0,0.35);
    backdrop-filter: blur(14px);
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.45;
}

.canvas-tooltip strong {
    display: block;
    margin-bottom: 3px;
}

.canvas-tooltip span {
    color: var(--muted);
}

.map-help {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.86rem;
}

.map-help span {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.045);
}

.results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr);
    gap: 22px;
    margin-top: 22px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.metric {
    min-height: 96px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: rgba(255,255,255,0.065);
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.metric strong {
    display: block;
    font-size: clamp(1.25rem, 2.4vw, 1.62rem);
    line-height: 1.15;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.badge.good {
    color: var(--good);
    border-color: rgba(113, 231, 162, 0.36);
    background: rgba(113, 231, 162, 0.08);
}

.badge.warning {
    color: var(--warning);
    border-color: rgba(255, 209, 102, 0.36);
    background: rgba(255, 209, 102, 0.08);
}

.badge.bad {
    color: var(--danger);
    border-color: rgba(255, 118, 118, 0.36);
    background: rgba(255, 118, 118, 0.08);
}

.recommendation {
    color: var(--muted);
    line-height: 1.75;
    border-left: 3px solid var(--accent);
    padding: 12px 0 12px 16px;
}

.compass-card {
    display: grid;
    align-content: start;
}

.compass {
    display: grid;
    place-items: center;
    padding: 8px 0 14px;
}

.compass-ring {
    position: relative;
    width: min(220px, 56vw);
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(126,210,255,0.12) 0 5%, transparent 6%),
        conic-gradient(from 0deg, rgba(126,210,255,0.22), rgba(181,134,255,0.12), rgba(125,255,207,0.16), rgba(126,210,255,0.22));
    box-shadow: inset 0 0 38px rgba(0,0,0,0.24);
}

.compass-ring span {
    position: absolute;
    font-weight: 950;
    color: rgba(247,248,255,0.86);
}

.compass-ring span:nth-child(1) { top: 10px; left: 50%; transform: translateX(-50%); }
.compass-ring span:nth-child(2) { right: 12px; top: 50%; transform: translateY(-50%); }
.compass-ring span:nth-child(3) { bottom: 10px; left: 50%; transform: translateX(-50%); }
.compass-ring span:nth-child(4) { left: 12px; top: 50%; transform: translateY(-50%); }

.needle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 44%;
    border-radius: 999px;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(0deg);
    background: linear-gradient(180deg, #fff, #7ed2ff);
    box-shadow: 0 0 24px rgba(126,210,255,0.75);
}

.needle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 13px solid #fff;
}

#compassText {
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

.timeline-card,
.catalog-card {
    margin-top: 22px;
}

.timeline-wrap {
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.timeline-bars {
    min-width: 680px;
    display: grid;
    grid-template-columns: repeat(var(--items, 24), minmax(18px, 1fr));
    align-items: end;
    gap: 7px;
    min-height: 158px;
    padding: 12px 2px 2px;
}

.time-slot {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: end;
    gap: 8px;
    min-width: 18px;
}

.time-slot .bar {
    width: 100%;
    min-height: 8px;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, rgba(126,210,255,0.96), rgba(181,134,255,0.70));
    opacity: var(--opacity, 0.35);
    border: 1px solid rgba(255,255,255,0.14);
}

.time-slot.best .bar {
    background: linear-gradient(180deg, #fff, #7ed2ff);
    box-shadow: 0 0 18px rgba(126,210,255,0.70);
}

.time-slot small {
    display: block;
    color: var(--soft);
    font-size: 0.68rem;
    text-align: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.planet-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.planet-card {
    position: relative;
    overflow: hidden;
    min-height: 190px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,255,255,0.062);
}

.planet-card::before {
    content: "";
    position: absolute;
    width: 112px;
    height: 112px;
    right: -36px;
    top: -34px;
    background: radial-gradient(circle, var(--planet-color), transparent 68%);
    opacity: 0.26;
}

.planet-card strong {
    position: relative;
    display: block;
    font-size: 1.12rem;
}

.planet-card span {
    position: relative;
    display: inline-flex;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.planet-card p {
    position: relative;
    color: var(--muted);
    line-height: 1.55;
    margin: 12px 0 0;
    font-size: 0.92rem;
}

.footer {
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
    padding: 34px 0 44px;
}

@media (max-width: 1100px) {
    .workspace,
    .results-grid,
    .hero {
        grid-template-columns: 1fr;
    }

    .controls-card {
        position: static;
    }

    #skyCanvas {
        height: min(70vh, 680px);
    }

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

@media (max-width: 720px) {
    :root {
        --radius: 22px;
    }

    main,
    .footer,
    .topbar {
        width: min(100% - 22px, 1240px);
    }

    .topbar {
        position: relative;
        align-items: flex-start;
    }

    .topnav {
        display: none;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .hero {
        padding-top: 30px;
    }

    .hero-copy h1 {
        font-size: clamp(2.55rem, 15vw, 4.3rem);
    }

    .hero-actions,
    .hero-actions .btn {
        width: 100%;
    }

    .hero-actions .btn {
        min-height: 50px;
    }

    .controls-card,
    .sky-card,
    .result-card,
    .timeline-card,
    .catalog-card {
        padding: 16px;
    }

    .toggles,
    .metrics,
    .best-metrics,
    .planet-cards {
        grid-template-columns: 1fr;
    }

    .sky-header,
    .section-heading,
    .result-topline {
        display: block;
    }

    .legend {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .canvas-wrap {
        border-radius: 18px;
        margin-inline: -4px;
    }

    #skyCanvas {
        height: min(78vh, 560px);
        min-height: 360px;
    }

    .map-help span {
        width: 100%;
        text-align: center;
    }

    .metric {
        min-height: 78px;
    }

    .timeline-bars {
        min-width: 760px;
    }
}

@media (max-width: 430px) {
    .hero-copy h1 {
        letter-spacing: -0.07em;
    }

    .brand small {
        display: none;
    }

    #skyCanvas {
        min-height: 330px;
    }
}
