/* ===========================================================
   lrx.st v2 -- Nocturnal Observatory
   Palette:
     #0B1226 Midnight Sky        (background)
     #C49B5D Brass Amber         (primary accent)
     #6FD1D4 Phosphor Cyan       (interactive luminous)
     #F2E8D0 Pale Starlight      (primary text)
     #E2B870 Burnished Gold      (borders, dividers)
     #1A2347 Indigo Veil         (cards, lifted surfaces)
     #4A3A6B Aurora Plum         (nebular gradient)
     #B98E4F                     (metadata mono)
     #8B7B6B                     (subtle UI gray-warm)
   =========================================================== */

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

:root {
    --midnight: #0B1226;
    --indigo-veil: #1A2347;
    --aurora-plum: #4A3A6B;
    --brass: #C49B5D;
    --burnished: #E2B870;
    --phosphor: #6FD1D4;
    --starlight: #F2E8D0;
    --meta: #B98E4F;
    --warm-gray: #8B7B6B;

    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "Inter", system-ui, sans-serif;
    --mono: "JetBrains Mono", "Fira Code", monospace;

    --cursor-x: 50vw;
    --cursor-y: 50vh;
}

html, body {
    background: var(--midnight);
    color: var(--starlight);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 50% 30%, rgba(74,58,107,0.22) 0%, rgba(11,18,38,0) 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(196,155,93,0.06) 0%, rgba(11,18,38,0) 70%),
        var(--midnight);
}

/* ---------- Starfield canvas ---------- */
.starfield {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    transition: transform 0.4s ease;
}

/* ---------- Soft vignette ---------- */
.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(11,18,38,0.55) 100%);
}

.nebula {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
}
.nebula-1 {
    top: -20%; left: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--aurora-plum) 0%, transparent 65%);
}
.nebula-2 {
    bottom: -25%; right: -15%;
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(196,155,93,0.18) 0%, transparent 65%);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6vh 6vw;
}

.hero-inner {
    width: min(880px, 100%);
    text-align: center;
    position: relative;
}

.meta-coord {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--meta);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8em;
    opacity: 0.85;
}
.meta-coord.top { margin-bottom: 5vh; }
.meta-coord.bottom { margin-top: 4vh; }
.meta-coord .sep { color: var(--brass); opacity: 0.5; }
.meta-coord .dot {
    width: 5px;
    height: 5px;
    background: var(--phosphor);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--phosphor);
}

.logotype {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(46px, 8vw, 96px);
    letter-spacing: 0.08em;
    color: var(--starlight);
    line-height: 1;
    text-shadow: 0 0 28px rgba(242,232,208,0.18);
}
.logotype .mark {
    display: inline-block;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.logotype .dot-sep {
    color: var(--brass);
    margin: 0 0.18em;
    opacity: 0.7;
}
.logotype .domain {
    font-style: italic;
    color: var(--burnished);
    font-weight: 600;
    font-size: 0.7em;
    letter-spacing: 0.04em;
}

.horizon {
    width: 36%;
    height: 1px;
    margin: 3.2vh auto 3vh;
    background: linear-gradient(90deg, transparent 0%, var(--brass) 30%, var(--burnished) 50%, var(--brass) 70%, transparent 100%);
    opacity: 0.7;
}

.tagline {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(20px, 2.6vw, 30px);
    color: var(--starlight);
    line-height: 1.4;
    margin: 0 auto 1.6vh;
    max-width: 36em;
}
.subtagline {
    font-family: var(--sans);
    font-size: clamp(14px, 1.05vw, 16px);
    color: rgba(242,232,208,0.7);
    margin: 0 auto;
    max-width: 36em;
    line-height: 1.7;
}

.scroll-hint {
    margin-top: 6vh;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--meta);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.75;
    animation: float 3.6s ease-in-out infinite;
}
.scroll-arrow { color: var(--brass); }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ---------- Map / main ---------- */
.map {
    position: relative;
    z-index: 2;
    padding: 4vh 6vw 8vh;
}

/* ---------- Meridian arcs ---------- */
.meridian {
    position: relative;
    width: 100%;
    height: 100px;
    margin: 6vh 0;
    overflow: visible;
}
.meridian-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.meridian-svg .arc-path {
    stroke-linecap: round;
    opacity: 0.85;
}
.meridian-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--brass);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: var(--midnight);
    padding: 0 14px;
    border: 1px solid rgba(196,155,93,0.4);
    border-radius: 100px;
    line-height: 22px;
    box-shadow: 0 0 20px rgba(11,18,38,0.8);
}

/* ---------- Constellation sections ---------- */
.constellation {
    margin: 4vh auto;
    max-width: 1280px;
}

.constellation-head {
    text-align: left;
    margin-bottom: 4vh;
    max-width: 640px;
    padding-left: 2vw;
    position: relative;
}
.constellation-head.right-aligned {
    margin-left: auto;
    text-align: right;
    padding-right: 2vw;
    padding-left: 0;
}

.cluster-num {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--meta);
    letter-spacing: 0.16em;
    margin-bottom: 0.6em;
    padding: 3px 10px;
    border: 1px solid rgba(196,155,93,0.35);
    border-radius: 14px;
}

.constellation-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(34px, 4.4vw, 56px);
    color: var(--starlight);
    letter-spacing: 0.01em;
    margin-bottom: 0.4em;
    text-shadow: 0 0 28px rgba(242,232,208,0.12);
}
.constellation-lede {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    color: rgba(242,232,208,0.75);
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.6;
    max-width: 38em;
}
.constellation-head.right-aligned .constellation-lede { margin-left: auto; }

/* ---------- Sky -- node positioning area ---------- */
.sky {
    position: relative;
    width: 100%;
    height: 720px;
    border: 1px solid rgba(196,155,93,0.10);
    border-radius: 4px;
    background:
        radial-gradient(circle at 20% 30%, rgba(74,58,107,0.18) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(196,155,93,0.06) 0%, transparent 45%),
        rgba(26,35,71,0.18);
    overflow: visible;
}
.link-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 1;
}
.link-layer .link-path {
    fill: none;
    stroke: var(--brass);
    stroke-width: 1;
    stroke-linecap: round;
    opacity: 0.55;
    transition: opacity 0.4s ease, stroke 0.4s ease;
}
.link-layer .link-path.lit {
    stroke: var(--burnished);
    opacity: 0.95;
    filter: drop-shadow(0 0 4px rgba(226,184,112,0.5));
}
.link-layer .junction {
    fill: var(--burnished);
    opacity: 0.8;
}

/* ---------- Node cards ---------- */
.node {
    position: absolute;
    left: var(--nx);
    top: var(--ny);
    width: clamp(220px, 22vw, 300px);
    padding: 18px 18px 16px;
    background: linear-gradient(180deg, rgba(26,35,71,0.94) 0%, rgba(20,28,58,0.94) 100%);
    border: 1px solid rgba(226,184,112,0.32);
    border-radius: 3px;
    color: var(--starlight);
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    box-shadow:
        0 0 0 1px rgba(196,155,93,0.05),
        0 8px 30px rgba(0,0,0,0.4),
        inset 0 0 12px rgba(196,155,93,0.04);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    will-change: transform, opacity;
}
.node.visible {
    opacity: 1;
}
.node:hover {
    transform: translate(-50%, calc(-50% - 4px));
    border-color: var(--phosphor);
    box-shadow:
        0 0 0 1px rgba(111,209,212,0.15),
        0 12px 40px rgba(0,0,0,0.55),
        0 0 28px rgba(111,209,212,0.18),
        inset 0 0 20px rgba(196,155,93,0.06);
}

.node-coord {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--meta);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(196,155,93,0.16);
}
.node-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 22px;
    color: var(--starlight);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}
.node-desc {
    font-family: var(--sans);
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(242,232,208,0.78);
}
.node-glyph {
    position: absolute;
    top: 14px;
    right: 14px;
    color: var(--brass);
    opacity: 0.7;
    transition: color 0.3s ease, opacity 0.3s ease;
}
.node:hover .node-glyph {
    color: var(--phosphor);
    opacity: 1;
}

/* ---------- Ephemeris ---------- */
.ephemeris {
    margin: 6vh auto;
    max-width: 980px;
    padding: 3vh 4vw;
    background: linear-gradient(180deg, rgba(26,35,71,0.5) 0%, rgba(11,18,38,0.4) 100%);
    border: 1px solid rgba(196,155,93,0.15);
    border-radius: 4px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.ephemeris-head {
    margin-bottom: 3vh;
}
.ephemeris-list {
    list-style: none;
    border-top: 1px solid rgba(196,155,93,0.18);
}
.ephemeris-row {
    display: grid;
    grid-template-columns: 160px 30px 1fr 100px;
    align-items: center;
    gap: 16px;
    padding: 16px 8px;
    border-bottom: 1px solid rgba(196,155,93,0.10);
    font-size: 14px;
    transition: background 0.3s ease, transform 0.3s ease;
}
.ephemeris-row:hover {
    background: rgba(74,58,107,0.18);
    transform: translateX(4px);
}
.ephem-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--meta);
    letter-spacing: 0.06em;
}
.ephem-glyph {
    font-size: 18px;
    color: var(--burnished);
    text-align: center;
}
.ephem-text {
    font-family: var(--sans);
    color: rgba(242,232,208,0.85);
    line-height: 1.55;
}
.ephem-text em {
    font-style: italic;
    color: var(--phosphor);
}
.ephem-id {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--brass);
    letter-spacing: 0.1em;
    text-align: right;
}

/* ---------- Observatory footer ---------- */
.observatory {
    position: relative;
    z-index: 2;
    padding: 8vh 6vw 6vh;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 6vw;
    align-items: center;
    border-top: 1px solid rgba(196,155,93,0.16);
    background: linear-gradient(180deg, transparent 0%, rgba(26,35,71,0.35) 100%);
}

.astrolabe {
    width: 360px;
    height: 360px;
    margin: 0 auto;
    position: relative;
    filter: drop-shadow(0 0 30px rgba(196,155,93,0.18));
}
.astrolabe-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.astrolabe-svg .outer-ring {
    transform-origin: 180px 180px;
    animation: spin-cw 120s linear infinite;
}
.astrolabe-svg .tick-ring {
    transform-origin: 180px 180px;
    animation: spin-ccw 180s linear infinite;
}
.astrolabe-svg .middle-ring {
    transform-origin: 180px 180px;
    animation: spin-cw 240s linear infinite;
}
.astrolabe-svg .tick-marks {
    transform-origin: 180px 180px;
    animation: spin-ccw 300s linear infinite;
}
.astrolabe-svg .core circle:last-child {
    transform-origin: 180px 180px;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes spin-cw {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes spin-ccw {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 0.9; transform: scale(1.15); }
}

.footer-text {
    color: rgba(242,232,208,0.85);
}
.footer-line {
    font-family: var(--serif);
    font-size: clamp(20px, 2vw, 26px);
    color: var(--starlight);
    margin-bottom: 1em;
    letter-spacing: 0.02em;
}
.footer-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--meta);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 1.4em;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em;
    align-items: center;
}
.footer-meta .sep {
    color: var(--brass);
    opacity: 0.5;
}
.footer-fine {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: rgba(242,232,208,0.55);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sky {
        height: auto;
        min-height: 100px;
        padding: 24px 16px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .sky .link-layer { display: none; }
    .node {
        position: relative;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        opacity: 1;
    }
    .node:hover {
        transform: translateY(-3px) !important;
    }
    .observatory {
        grid-template-columns: 1fr;
        gap: 5vh;
        text-align: center;
    }
    .footer-meta { justify-content: center; }
    .ephemeris-row {
        grid-template-columns: 1fr;
        gap: 6px;
        text-align: left;
    }
    .ephem-glyph, .ephem-time, .ephem-id { text-align: left; }
    .constellation-head.right-aligned { text-align: left; padding-right: 0; padding-left: 2vw; }
}

@media (max-width: 560px) {
    .astrolabe { width: 260px; height: 260px; }
    .meta-coord { font-size: 10px; flex-wrap: wrap; }
    .logotype { font-size: 56px; }
}
