/* ============================================================
   quietjoon.net - Dark-Academia Burgundy Observatory
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --deep-burgundy-dark: #1A0810;
    --wine-dark: #4A1828;
    --burgundy-mid: #8A4050;
    --constellation-silver: #A08080;
    --observatory-cream: #FDF4F0;
    --marble-surface: #F8F0EC;
    --star-glow: rgba(160, 128, 128, 0.05);
    --hud-border: rgba(140, 80, 80, 0.2);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: var(--wine-dark);
    background-color: var(--observatory-cream);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Constellation Canvas (Background) --- */
#constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Marble Texture Overlay --- */
#marble-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(138, 64, 80, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(160, 128, 128, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(74, 24, 40, 0.015) 0%, transparent 60%),
        radial-gradient(ellipse at 10% 80%, rgba(138, 64, 80, 0.02) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 20%, rgba(160, 128, 128, 0.025) 0%, transparent 45%),
        radial-gradient(ellipse at 40% 90%, rgba(26, 8, 16, 0.01) 0%, transparent 35%);
}

/* --- Observatory HUD Frame --- */
#hud-frame {
    position: relative;
    z-index: 10;
    max-width: 740px;
    margin: 0 auto;
    padding: 0 20px;
    border-left: 1px solid var(--hud-border);
    border-right: 1px solid var(--hud-border);
    min-height: 100vh;
}

/* --- Corner Crosshairs --- */
.crosshair {
    position: fixed;
    width: 40px;
    height: 40px;
    z-index: 100;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.crosshair.visible {
    opacity: 1;
}

.crosshair-tl {
    top: 12px;
    left: 12px;
}

.crosshair-tr {
    top: 12px;
    right: 12px;
}

.crosshair-bl {
    bottom: 12px;
    left: 12px;
}

.crosshair-br {
    bottom: 12px;
    right: 12px;
}

/* --- Status Bars --- */
#status-bar,
#bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--burgundy-mid);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--hud-border);
    background: var(--observatory-cream);
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

#status-bar {
    position: sticky;
    top: 0;
    z-index: 50;
}

#bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 740px;
    width: 100%;
    z-index: 50;
    border-top: 1px solid var(--hud-border);
    border-bottom: none;
    padding: 0 28px;
}

#status-bar.visible,
#bottom-bar.visible {
    opacity: 1;
}

.status-left,
.status-center,
.status-right {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-center {
    opacity: 0.6;
}

/* --- Main Content --- */
#observatory-content {
    padding: 20px 0 60px;
}

/* --- HUD Panels --- */
.hud-panel {
    background: var(--marble-surface);
    border: 1px solid var(--hud-border);
    margin-bottom: 32px;
    position: relative;
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
}

.hud-panel.scale-hover:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 32px rgba(26, 8, 16, 0.08);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-bottom: 1px solid var(--hud-border);
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--burgundy-mid);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-id {
    opacity: 0.7;
}

.panel-title {
    letter-spacing: 0.15em;
}

.panel-timestamp {
    opacity: 0.5;
}

.panel-inner {
    padding: 28px 24px;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    margin-bottom: 48px;
}

#hero .panel-inner {
    text-align: center;
    padding: 40px 24px;
}

.hero-data-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--burgundy-mid);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hero-data-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.data-label {
    opacity: 0.7;
}

.data-divider {
    width: 40px;
    height: 1px;
    background: var(--hud-border);
}

.data-value {
    opacity: 0.9;
}

#site-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.25em;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1s ease-out 0.3s, transform 1s ease-out 0.3s;
}

#site-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: var(--constellation-silver);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out 0.6s, transform 0.8s ease-out 0.6s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-readout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--burgundy-mid);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out 0.9s, transform 0.8s ease-out 0.9s;
}

.hero-readout.visible {
    opacity: 1;
    transform: translateY(0);
}

.readout-separator {
    opacity: 0.3;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: var(--wine-dark);
    margin-bottom: 20px;
}

/* --- Observation Entry --- */
.observation-entry {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
}

.entry-marker {
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--burgundy-mid);
    opacity: 0.6;
}

.entry-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--hud-border);
    transform: translate(-50%, -50%);
}

.entry-text {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--constellation-silver);
}

/* --- Catalog Grid --- */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.catalog-entry {
    padding: 20px 16px;
    border: 1px solid var(--hud-border);
    background: var(--observatory-cream);
    text-align: center;
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
}

.catalog-entry.scale-hover:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(26, 8, 16, 0.06);
}

.catalog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
}

.catalog-icon svg {
    width: 100%;
    height: 100%;
}

.catalog-name {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.catalog-data {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--burgundy-mid);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 10px;
    opacity: 0.7;
}

.catalog-desc {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--constellation-silver);
}

/* --- Transmission List --- */
.transmission-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.transmission-item {
    padding: 20px;
    border: 1px solid var(--hud-border);
    background: var(--observatory-cream);
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
}

.transmission-item.scale-hover:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(26, 8, 16, 0.06);
}

.transmission-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--burgundy-mid);
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.transmission-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.transmission-excerpt {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--wine-dark);
    opacity: 0.85;
}

/* --- Coordinates Grid --- */
.coordinates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.coord-block {
    padding: 16px;
    border: 1px solid var(--hud-border);
    background: var(--observatory-cream);
    text-align: center;
}

.coord-label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: var(--burgundy-mid);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
    opacity: 0.6;
}

.coord-value {
    display: block;
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--deep-burgundy-dark);
    letter-spacing: 0.06em;
}

/* --- Observatory Footer --- */
.observatory-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--hud-border);
}

.footer-note {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--constellation-silver);
    letter-spacing: 0.04em;
    line-height: 1.7;
}

/* --- Scroll-Reveal Animation --- */
.hud-panel:not(#hero) {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.hud-panel:not(#hero).scale-hover:hover {
    transform: scale(1.04);
}

.hud-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    #hud-frame {
        padding: 0 12px;
    }

    .panel-inner {
        padding: 20px 16px;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .coordinates-grid {
        grid-template-columns: 1fr;
    }

    .hero-readout {
        flex-direction: column;
        gap: 4px;
    }

    .readout-separator {
        display: none;
    }

    #status-bar,
    #bottom-bar {
        font-size: 0.55rem;
        padding: 0 12px;
    }

    .crosshair {
        width: 28px;
        height: 28px;
    }
}

/* --- Selection --- */
::selection {
    background: rgba(138, 64, 80, 0.2);
    color: var(--deep-burgundy-dark);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--observatory-cream);
}

::-webkit-scrollbar-thumb {
    background: var(--hud-border);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--burgundy-mid);
}
