@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/manrope.ttf") format("truetype");
}

:root {
    color-scheme: dark;
    font-family: Manrope, "Segoe UI", sans-serif;
    color: #f3f5ff;
    background: #0a0c10;
    --text: #f3f5ff;
    --muted: #a6b0c8;
    --accent: #9de6f5;
    --warm: #ffc5a1;
    --line: #a7b5d020;
    --gutter: clamp(16px, 4vw, 64px);
    --glass-fill: #11151e;
    --glass-edge: var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}
a { color: inherit; text-decoration: none; }
button, select, input { color: inherit; font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.page:focus { outline: none; }
.skip-link {
    position: fixed;
    z-index: 10;
    top: 10px;
    left: var(--gutter);
    transform: translateY(-150%);
    padding: 12px 16px;
    border-radius: 12px;
    color: #08131b;
    background: var(--accent);
}
.skip-link:focus { transform: translateY(0); }
.container { width: min(calc(100% - 2 * var(--gutter)), 1440px); margin-inline: auto; }

.glass { border: 1px solid var(--glass-edge); border-radius: 10px; background: var(--glass-fill); }
.site-header { position: relative; z-index: 3; }
.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 95px;
    border-bottom: 1px solid var(--line);
}
.brand {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 11px;
    border-radius: 8px;
    font-size: 1.31rem;
    font-weight: 750;
    letter-spacing: -.065em;
}
.brand__accent { color: var(--accent); }
.brand__mark {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: var(--accent);
}
.brand__mark::before, .brand__mark::after {
    position: absolute;
    width: 23px;
    height: 11px;
    border: 1px solid currentColor;
    border-radius: 50%;
    content: "";
    transform: rotate(-38deg);
}
.brand__mark::after { opacity: .37; transform: rotate(40deg); }
.brand__mark span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #defaff;
}
.site-nav { display: flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; }
.site-nav__link {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #bfcae0;
    font-size: .79rem;
    font-weight: 550;
    white-space: nowrap;
    transition: background .18s, color .18s, border-color .18s;
}
.site-nav__link:hover { color: var(--text); background: #d9e8ff12; }
.site-nav__link[aria-current="page"] { border-bottom-color: var(--accent); color: var(--text); background: #c5dbff0c; }
.future-badge {
    color: #b6c0d9;
    font-size: .625rem;
    font-weight: 500;
}
.site-nav .future-badge { color: #a9b6d1; }
.site-header .menu-toggle { display: none; }
.menu-toggle__icon {
    width: 15px;
    height: 11px;
    border-block: 1px solid currentColor;
    background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}

.page { padding-block: clamp(29px, 4vw, 58px) 38px; }
.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px 30px;
    margin-bottom: clamp(22px, 2.7vw, 35px);
}
h1, h2, h3, p, figure { margin: 0; }
h1 {
    font-size: clamp(2.65rem, 5.2vw, 5.35rem);
    font-weight: 740;
    line-height: 1.02;
    letter-spacing: -.05em;
}
h2 { line-height: 1.13; letter-spacing: -.048em; }
.page-heading__description {
    margin-top: 12px;
    color: var(--muted);
    font-size: clamp(.85rem, 1.35vw, 1rem);
    line-height: 1.55;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--glass-edge);
    border-radius: 7px;
    background: #171d29;
    font-size: .8rem;
    font-weight: 650;
    line-height: 1.2;
    transition: background .18s, border-color .18s;
}
.button:hover { border-color: #a7b5d04a; background: #222c3b; }
.button--primary { border-color: #a8dce140; color: #e0f8fa; background: #243c44; }
.button--primary:hover { background: #304e58; }
.icon-button { width: 42px; padding-inline: 0; font-size: 1rem; }
.quiet-link { color: #c6ddef; text-decoration: underline; text-decoration-color: #9de6f56b; text-underline-offset: .24em; }
.quiet-link:hover { color: var(--accent); }

.observatory { position: relative; isolation: isolate; overflow: hidden; }
.observatory__sky, .observatory__scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.observatory__sky { z-index: -2; }
.observatory__scene { z-index: -1; cursor: grab; touch-action: none; }
.observatory__scene:active { cursor: grabbing; }
.observatory__scene:focus-visible { outline-offset: -5px; }
.object-panel, .object-detail { position: relative; padding: 12px; }
.panel-label {
    color: #bfcbdf;
    font-size: .68rem;
    font-weight: 650;
    letter-spacing: .085em;
    text-transform: uppercase;
}
.object-list { display: grid; gap: 1px; }
.object-button {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 33px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #d4def0;
    background: transparent;
    text-align: left;
    font-size: .77rem;
}
.object-button:hover { background: #e4efff15; }
.object-button[aria-pressed="true"] { color: var(--text); background: #7faad329; }
.object-dot {
    flex: 0 0 9px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    color: var(--object-color);
    background: currentColor;
}
.object-detail h2 { margin-top: 2px; font-size: 1.62rem; font-weight: 700; }
.object-detail__type { color: var(--muted); font-size: .76rem; }
.object-facts { display: grid; gap: 10px; margin: 3px 0 0; padding-top: 11px; border-top: 1px solid var(--line); }
.object-facts div { display: grid; gap: 4px; }
.object-facts dt { color: var(--muted); font-size: .68rem; }
.object-facts dd { margin: 0; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.scene-caption {
    z-index: 0;
    grid-area: 2 / 1;
    align-self: end;
    color: #aeb9d1;
    font-size: .68rem;
    line-height: 1.48;
    pointer-events: none;
}
.time-controls, .camera-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 5px;
    border-radius: 10px;
}
.time-controls { grid-area: 2 / 2; justify-self: center; }
.camera-controls { grid-area: 2 / 3; justify-self: end; }
.time-controls .button, .camera-controls .button { min-height: 36px; }
.time-controls .icon-button, .camera-controls .icon-button { width: 36px; }
.scene-time {
    display: grid;
    gap: 3px;
    min-width: 150px;
    padding: 0 7px;
    white-space: nowrap;
}
.scene-time time { font-size: .76rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.scene-time__status { display: flex; align-items: center; gap: 6px; color: #b9cae0; font-size: .63rem; }
.scene-time__status::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #89e2d8;
    box-shadow: 0 0 7px #89e2d8bb;
    content: "";
}
.scene-time__status[data-live="false"]::before { background: #ffc5a1; box-shadow: none; }
.speed-select {
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #171d29;
    font-size: .73rem;
}
.scene-fallback { position: absolute; inset: 40% 20px auto; text-align: center; font-size: .9rem; }

.section-panel {
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(28px, 6vw, 90px);
    min-height: min(66vh, 660px);
    padding-block: clamp(18px, 4vw, 56px);
    border-block: 1px solid var(--line);
}
.section-panel__content { max-width: 590px; }
.section-panel__content h1 { margin-top: 14px; font-size: clamp(2.4rem, 5vw, 5rem); }
.section-panel__description { max-width: 43ch; margin: 15px 0 24px; color: #c0cbe0; line-height: 1.6; }

.preview-page {
    position: relative;
    isolation: isolate;
    background: #07080b;
}
.preview-page::before {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: max(560px, 94svh);
    background:
        linear-gradient(90deg, #07080b 0%, #07080bcf 28%, transparent 63%),
        linear-gradient(180deg, #07080b 0%, transparent 24% 65%, #07080b 100%),
        var(--preview-art) 72% center / cover no-repeat;
    opacity: .64;
    pointer-events: none;
    content: "";
}
.preview-page--constellations { --preview-art: url("images/constellations-bg.webp"); }
.preview-page .page {
    display: grid;
    align-items: center;
    min-height: min(68svh, 720px);
    flex: 1;
    padding-block: clamp(70px, 12vh, 140px);
}
.preview-page--black-holes { --preview-art: url("images/black-holes-bg.webp"); }
.space-backdrop {
    position: relative;
    isolation: isolate;
    --glass-fill: #11151ee8;
}
.space-backdrop::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 100svh;
    background: var(--space-art) var(--space-position, center) / var(--space-size, cover) no-repeat;
    opacity: var(--space-opacity, .7);
    mask-image: linear-gradient(#000 78%, transparent);
    pointer-events: none;
}
.catalog-page {
    --space-art: url("images/exoplanets-earth-bg.jpg");
    --space-position: left 90%;
    --space-size: max(109%, calc(100svh * 16 / 9)) auto;
    --space-opacity: .56;
}
.three-body-page { --space-art: url("images/three-body-nebula-bg.jpg"); }
@media (max-width: 1050px) {
    .catalog-page {
        --space-position: right center;
        --space-size: cover;
        --space-opacity: .42;
    }
}
.preview-page--black-holes .page {
    align-content: center;
    width: min(calc(100% - 2 * var(--gutter)), 1280px);
    margin-inline: max(var(--gutter), calc((100% - 1440px) / 2)) auto;
    min-height: 0;
    padding-block: clamp(36px, 7vh, 84px);
}
.preview-page--black-holes .panel-label { color: var(--warm); }
.preview-page--black-holes h1 { margin-top: 10px; }
.preview-page--black-holes .section-panel__description {
    max-width: 38ch;
    margin: 18px 0 26px;
}
.section-panel--three-body {
    background:
        radial-gradient(ellipse at 76% 47%, #d3e0fb90 0 2px, transparent 3px),
        radial-gradient(ellipse at 84% 62%, #9de6f5a0 0 3px, transparent 4px),
        radial-gradient(ellipse at 65% 39%, #ffc5a1a0 0 2px, transparent 3px),
        repeating-radial-gradient(ellipse at 76% 50%, transparent 0 33px, #a8c1ee15 34px 35px, transparent 36px 68px);
}
@media (max-width: 720px) {
    .section-panel { grid-template-columns: 1fr; min-height: auto; }
    .preview-page .page { align-items: start; padding-block: 64px 34px; }
    .preview-page::before {
        height: 100%;
        background:
            linear-gradient(180deg, #07080b 0%, #07080bec 31%, transparent 54% 74%, #07080b 100%),
            var(--preview-art) 77% 77% / auto min(62vh, 530px) no-repeat;
    }
    .section-panel--three-body { min-height: 50vh; padding: 22px; background-position: 85% center; }
}
@media (max-width: 760px) {
    .preview-page--black-holes::before { display: none; }
    .preview-page--black-holes .page {
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 16px;
        padding-block: 36px 22px;
    }
    .preview-page--black-holes .page::after {
        content: "";
        width: min(100%, 560px);
        justify-self: center;
        aspect-ratio: 16 / 9;
        background: var(--preview-art) center / contain no-repeat;
        mix-blend-mode: screen;
    }
    .preview-page--black-holes .section-panel__description { margin: 14px 0 20px; }
}

.site-footer { margin-top: auto; color: var(--muted); font-size: .73rem; }
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 15px;
    padding-block: 17px 24px;
    border-top: 1px solid var(--line);
}

@media (max-width: 1060px) {
    .site-nav__link { padding-inline: 9px; }
    .site-header__inner { min-height: 81px; gap: 14px; }
}

@media (max-width: 900px) {
    .site-header__inner { flex-wrap: wrap; min-height: 69px; padding-block: 10px; }
    .site-nav { display: grid; width: 100%; border-radius: 19px; }
    .site-nav__link { justify-content: space-between; min-height: 42px; padding-inline: 13px; }
    .site-header[data-menu-ready] .menu-toggle { display: inline-flex; }
    .site-header[data-menu-ready] .site-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: min(100%, 330px);
        padding: 7px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--glass-fill);
    }
    .site-header[data-menu-ready] .menu-toggle[aria-expanded="false"] + .site-nav { display: none; }
    .scene-caption { grid-area: 2 / 1; }
}

@media (max-width: 720px) {
    .object-button { flex: none; min-height: 34px; }
    .time-controls { order: 1; align-self: center; justify-content: center; max-width: 100%; }
    .camera-controls { order: 2; position: absolute; top: 10px; right: 10px; }
    .scene-caption { order: 5; margin: 2px 0; }
    .scene-time { min-width: 0; }
    .scene-time time { font-size: .68rem; }
    .speed-select { max-width: 82px; padding-inline: 5px; }
}

@media (max-width: 390px) {
    .time-controls { gap: 3px; }
    .time-controls .button { padding-inline: 8px; }
    .time-controls .icon-button { padding: 0; width: 31px; }
    .scene-time { padding-inline: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; }
}
