/* explore_v5.css — A Cosmography
 *
 * The cosmology rendered as a star chart. Deep navy-near-black field,
 * pale glowing nodes, thin constellation lines. The page is a viewport,
 * not a document — no scrolling, the chart occupies the entire screen.
 *
 * Box-shadow is reserved here for the star-glow (the rest of the site
 * forbids shadows). This is an exception by visualisation type, not a
 * loosening of the brutalist rule.
 */

/* ───────────── reset + ground ───────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body.c5 {
    background: #050714;
    color: #cdd6e8;
    font-family: "Iowan Old Style", "Hoefler Text", Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;

    /* radial star-noise: a few deep gradients to give the void some depth */
    background-image:
        radial-gradient(ellipse at 18% 12%, rgba(76, 96, 140, 0.16), transparent 42%),
        radial-gradient(ellipse at 82% 78%, rgba(120, 92, 60, 0.10), transparent 48%),
        radial-gradient(ellipse at 50% 50%, rgba(20, 28, 60, 0.40), #050714 70%);
    background-attachment: fixed;

    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* let cytoscape handle gestures */
}

/* ───────────── topbar — almost invisible ───────────── */
.c5-top {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(5, 7, 20, 0.92) 0%, rgba(5, 7, 20, 0.0) 100%);
    pointer-events: none;
}
.c5-top-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 14px 22px 22px;
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    pointer-events: auto;
}
.c5-brand {
    color: #e6ecf8; text-decoration: none;
    font-family: "Iowan Old Style", Georgia, serif;
    font-size: 17px; font-style: italic;
    letter-spacing: 0.4px;
}
.c5-brand-dot { color: #f6c87a; margin-right: 2px; }
.c5-brand:hover { color: #ffffff; }
.c5-nav {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 11.5px; letter-spacing: 0.6px; text-transform: uppercase;
}
.c5-nav a {
    color: #8f9ab8; text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}
.c5-nav a:hover { color: #e6ecf8; border-bottom-color: rgba(230, 236, 248, 0.4); }
.c5-nav a[aria-current="page"] { color: #f6c87a; border-bottom-color: #f6c87a; }

/* ───────────── main viewport ───────────── */
.c5-main {
    position: fixed; inset: 0;
    overflow: hidden;
}

/* ───────────── title plate ───────────── */
.c5-plate {
    position: absolute; top: 72px; left: 24px;
    z-index: 30;
    max-width: 320px;
    padding: 14px 16px;
    background: rgba(5, 7, 20, 0.55);
    border: 1px solid rgba(180, 200, 240, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #e6ecf8;
}
.c5-plate-meta {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
    color: #6a7898;
    margin-bottom: 6px;
}
.c5-plate-title {
    font-family: "Iowan Old Style", Georgia, serif;
    font-style: italic; font-weight: 400;
    font-size: 28px; line-height: 1.05;
    color: #f1f4fb;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.c5-plate-sub {
    font-size: 13px; line-height: 1.45;
    color: #a4b0cc;
    margin-bottom: 10px;
}
.c5-plate-help {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10.5px; line-height: 1.7;
    color: #7d8aab;
}
.c5-key {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(180, 200, 240, 0.25);
    color: #cdd6e8;
    margin-right: 1px;
}

/* ───────────── stage ───────────── */
.c5-stage {
    position: absolute; inset: 0;
    overflow: hidden;
    background: transparent;
    cursor: grab;
}
.c5-stage:active { cursor: grabbing; }
.c5-graph {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}
.c5-graph:focus { outline: none; }

/* background-stars SVG sits BELOW cytoscape; cytoscape's canvas is on top */
.c5-bgstars {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}
.c5-graph { z-index: 2; }

/* ───────────── compass, bottom-left ───────────── */
.c5-compass {
    position: absolute; bottom: 22px; left: 24px;
    z-index: 30;
    display: flex; align-items: center; gap: 12px;
    color: #8f9ab8;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10.5px; letter-spacing: 0.8px;
}
.c5-compass-ring {
    position: relative;
    width: 56px; height: 56px;
    border: 1px solid rgba(180, 200, 240, 0.32);
    border-radius: 50%;
    background: rgba(5, 7, 20, 0.55);
}
.c5-compass-ring span {
    position: absolute;
    font-size: 10px; font-weight: 700;
    color: #cdd6e8;
}
.c5-compass-n { top: 3px;   left: 50%; transform: translateX(-50%); color: #f6c87a; }
.c5-compass-s { bottom: 3px;left: 50%; transform: translateX(-50%); }
.c5-compass-e { right: 4px; top: 50%;  transform: translateY(-50%); }
.c5-compass-w { left: 4px;  top: 50%;  transform: translateY(-50%); }
.c5-compass-needle {
    position: absolute;
    top: 50%; left: 50%;
    width: 1px; height: 22px;
    background: linear-gradient(to bottom, #f6c87a 0%, #f6c87a 50%, transparent 50%, transparent 100%);
    transform-origin: 50% 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 200ms ease-out;
}
.c5-compass-label {
    max-width: 100px;
    color: #6a7898; text-transform: uppercase;
    line-height: 1.3;
}

/* ───────────── legend, bottom-right ───────────── */
.c5-legend {
    position: absolute; bottom: 22px; right: 24px;
    z-index: 30;
    padding: 12px 14px;
    background: rgba(5, 7, 20, 0.55);
    border: 1px solid rgba(180, 200, 240, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10.5px; letter-spacing: 0.4px;
    color: #cdd6e8;
    min-width: 160px;
}
.c5-legend-row {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 0;
}
.c5-legend-row.c5-legend-thin { color: #8f9ab8; }
.c5-legend-divider {
    margin: 4px 0;
    border-top: 1px solid rgba(180, 200, 240, 0.15);
    padding: 0;
}
.c5-leg-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}
.c5-leg-figure {
    background: #ffffff; color: rgba(255, 255, 255, 0.7);
}
.c5-leg-place {
    background: #a8c9ff; color: rgba(168, 201, 255, 0.7);
}
.c5-leg-chapter {
    background: #f6c87a; color: rgba(246, 200, 122, 0.7);
}
.c5-leg-line {
    display: inline-block; width: 14px; height: 1px;
}
.c5-leg-constellation { background: rgba(220, 230, 250, 0.5); }
.c5-leg-bridge { background: rgba(246, 200, 122, 0.45); border-top: 1px dashed rgba(246, 200, 122, 0.6); height: 0; }

/* ───────────── view controls, top-right ───────────── */
.c5-controls {
    position: absolute; top: 72px; right: 24px;
    z-index: 30;
    display: flex; flex-direction: column; gap: 6px;
}
.c5-btn {
    width: 36px; height: 36px;
    background: rgba(5, 7, 20, 0.6);
    border: 1px solid rgba(180, 200, 240, 0.25);
    color: #cdd6e8;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 16px; line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.c5-btn:hover {
    background: rgba(20, 24, 48, 0.8);
    color: #f6c87a;
    border-color: rgba(246, 200, 122, 0.6);
}
.c5-btn-text {
    width: 36px; height: 36px;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
}

/* ───────────── hovered-star info card ───────────── */
.c5-info {
    position: absolute;
    z-index: 40;
    pointer-events: none;
    padding: 10px 12px;
    background: rgba(5, 7, 20, 0.88);
    border: 1px solid rgba(246, 200, 122, 0.5);
    color: #f1f4fb;
    min-width: 180px; max-width: 260px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 120ms ease-out;
}
.c5-info[aria-hidden="false"] { opacity: 1; }
.c5-info-greek {
    font-family: "Iowan Old Style", Georgia, serif;
    font-size: 14px; font-style: italic;
    color: #f6c87a;
    margin-bottom: 1px;
    letter-spacing: 1px;
}
.c5-info-name {
    font-family: "Iowan Old Style", Georgia, serif;
    font-size: 15px;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.25;
}
.c5-info-kind {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
    color: #8f9ab8;
}
.c5-info-const {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
    color: #6a7898;
    margin-top: 2px;
}

/* ───────────── mobile ───────────── */
@media (max-width: 640px) {
    .c5-top-inner { padding: 10px 14px 18px; }
    .c5-brand { font-size: 15px; }
    .c5-nav { gap: 10px; font-size: 10.5px; }
    .c5-nav a:nth-child(n+5) { display: none; } /* show first 4 only */

    .c5-plate {
        top: 52px; left: 12px; right: 12px;
        max-width: none;
        padding: 10px 12px;
    }
    .c5-plate-title { font-size: 22px; }
    .c5-plate-sub  { font-size: 12px; }
    .c5-plate-help { font-size: 10px; }

    .c5-controls { top: 52px; right: 12px; }
    .c5-btn, .c5-btn-text { width: 32px; height: 32px; }

    .c5-compass { bottom: 14px; left: 12px; gap: 8px; }
    .c5-compass-ring { width: 44px; height: 44px; }
    .c5-compass-label { font-size: 9.5px; max-width: 76px; }

    .c5-legend { bottom: 14px; right: 12px; padding: 8px 10px; font-size: 9.5px; min-width: 130px; }
}
