/* namu.style — Glassmorphic Command Center */

:root {
    --pale-violet: #E8E0F8;
    --muted-lavender: #B0A8C8;
    --triadic-green: #40C080;
    --triadic-orange: #E06040;
    --triadic-violet: #8040C0;
    --deep-space: #0C0A18;
    --glass-panel: rgba(20, 18, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --star-pulse: #C0A0E0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    color: var(--muted-lavender);
    background: var(--deep-space);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Star field canvas */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Star-Celestial Navigation Markers */
.star-marker {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--star-pulse);
    border-radius: 50%;
    z-index: 1;
    animation: starPulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--star-pulse), 0 0 16px rgba(192, 160, 224, 0.3);
}

.star-marker:nth-child(2) { animation-delay: 0.3s; }
.star-marker:nth-child(3) { animation-delay: 0.7s; }
.star-marker:nth-child(4) { animation-delay: 1.1s; }
.star-marker:nth-child(5) { animation-delay: 1.5s; }
.star-marker:nth-child(6) { animation-delay: 0.5s; }
.star-marker:nth-child(7) { animation-delay: 0.9s; }
.star-marker:nth-child(8) { animation-delay: 1.3s; }

@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* Viewport Sections */
.viewport-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    z-index: 2;
}

/* HUD Grid Layouts */
.hud-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
}

.hero-grid {
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: auto auto;
}

.hero-grid .panel-main {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.hero-grid .panel-status {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.hero-grid .panel-coordinates {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.analysis-grid {
    grid-template-columns: 2fr 1fr;
}

.typography-grid {
    grid-template-columns: 1.4fr 1fr;
}

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

.observatory-grid {
    grid-template-columns: 1.5fr 1fr;
}

/* HUD Panel — Glassmorphism */
.hud-panel {
    background: var(--glass-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 32px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out, box-shadow 0.3s ease;
    overflow: hidden;
}

.hud-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.hud-panel:hover {
    box-shadow: 0 8px 40px rgba(128, 64, 192, 0.15), 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Panel Corner Stars */
.panel-corner {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--star-pulse);
    border-radius: 50%;
    animation: starPulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--star-pulse);
}

.panel-corner.top-left { top: 8px; left: 8px; }
.panel-corner.top-right { top: 8px; right: 8px; animation-delay: 0.5s; }
.panel-corner.bottom-left { bottom: 8px; left: 8px; animation-delay: 1s; }
.panel-corner.bottom-right { bottom: 8px; right: 8px; animation-delay: 1.5s; }

/* Panel Border Glow */
.panel-border-glow {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(224, 96, 64, 0.2), transparent 40%, rgba(64, 192, 128, 0.2) 60%, transparent 80%, rgba(128, 64, 192, 0.2)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Typography */
h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 4.5rem);
    color: var(--pale-violet);
    letter-spacing: 0.08em;
    line-height: 1.1;
    margin-bottom: 16px;
}

h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--pale-violet);
    letter-spacing: 0.06em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.panel-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.8;
    color: var(--muted-lavender);
    margin-bottom: 24px;
}

/* HUD Labels & Readouts */
.hud-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--triadic-green);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.readout-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--triadic-green);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.readout-value {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--pale-violet);
    letter-spacing: 0.08em;
}

.triadic-orange { color: var(--triadic-orange); }
.triadic-green { color: var(--triadic-green); }

.hud-readout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-readout:last-child {
    border-bottom: none;
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
}

.glitch-text.glitching::before,
.glitch-text.glitching::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 4.5rem);
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.glitch-text.glitching::before {
    color: var(--triadic-orange);
    text-shadow: -2px 0 var(--triadic-orange);
    animation: glitchShift 0.15s steps(2) forwards;
    clip-path: inset(0 0 50% 0);
}

.glitch-text.glitching::after {
    color: var(--triadic-green);
    text-shadow: 2px 0 var(--triadic-green);
    animation: glitchShiftReverse 0.15s steps(2) forwards;
    clip-path: inset(50% 0 0 0);
}

@keyframes glitchShift {
    0% { transform: translate(-2px, 0); }
    50% { transform: translate(2px, -1px); }
    100% { transform: translate(0, 0); }
}

@keyframes glitchShiftReverse {
    0% { transform: translate(2px, 0); }
    50% { transform: translate(-2px, 1px); }
    100% { transform: translate(0, 0); }
}

/* Status Grid */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-item:last-child {
    border-bottom: none;
}

/* Coordinate Display */
.coord-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coord-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.coord-row:last-child {
    border-bottom: none;
}

/* Color Spectrum Bars */
.color-spectrum {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.spectrum-bar {
    position: relative;
    height: 28px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.spectrum-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--bar-width);
    background: var(--bar-color);
    opacity: 0.35;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.spectrum-bar .readout-label {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
}

/* Metrics */
.metric-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.metric-item {
    text-align: center;
}

.metric-value {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--pale-violet);
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}

/* Typography Specimens */
.type-specimen {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.type-specimen:last-child {
    border-bottom: none;
}

.type-label {
    display: block;
    margin-bottom: 8px;
}

.type-sample-display {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--pale-violet);
    letter-spacing: 0.06em;
    line-height: 1.2;
}

.type-sample-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: var(--muted-lavender);
    line-height: 1.8;
}

.type-sample-mono {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--triadic-green);
    letter-spacing: 0.08em;
}

/* Palette Registry */
.palette-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.palette-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.palette-entry:last-child {
    border-bottom: none;
}

.palette-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.palette-entry .readout-label {
    flex: 1;
    font-size: 0.6rem;
}

.palette-entry .readout-value {
    font-size: 0.7rem;
    color: var(--muted-lavender);
}

/* Observatory Visual */
.observatory-visual {
    position: relative;
    height: 200px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.constellation-line {
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(192, 160, 224, 0.2), transparent);
}

.constellation-line.vertical {
    top: 10%;
    left: 50%;
    width: 1px;
    height: 80%;
    background: linear-gradient(180deg, transparent, rgba(192, 160, 224, 0.2), transparent);
}

.constellation-node {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--star-pulse);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--star-pulse), 0 0 20px rgba(192, 160, 224, 0.3);
    animation: starPulse 2s ease-in-out infinite;
    transform: translate(-50%, -50%);
}

.constellation-node:nth-child(3) { animation-delay: 0.4s; }
.constellation-node:nth-child(4) { animation-delay: 0.8s; }
.constellation-node:nth-child(5) { animation-delay: 1.2s; }
.constellation-node:nth-child(6) { animation-delay: 1.6s; }
.constellation-node:nth-child(7) { animation-delay: 0.2s; }

/* Transmission Log */
.log-entries {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.log-entry.visible {
    opacity: 1;
    transform: translateX(0);
}

.log-time {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--triadic-green);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.log-msg {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--muted-lavender);
}

/* Footer */
#footer {
    position: relative;
    z-index: 2;
    padding: 40px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin-bottom: 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-content .readout-label {
    font-size: 0.6rem;
    color: rgba(176, 168, 200, 0.4);
}

/* Panel entrance animations */
.hud-panel {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

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

/* Responsive */
@media (max-width: 900px) {
    .viewport-section {
        padding: 40px 20px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .hero-grid .panel-main {
        grid-column: 1;
        grid-row: 1;
    }

    .hero-grid .panel-status {
        grid-column: 1;
        grid-row: 2;
    }

    .hero-grid .panel-coordinates {
        grid-column: 1;
        grid-row: 3;
    }

    .analysis-grid,
    .typography-grid,
    .observatory-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .viewport-section {
        padding: 30px 16px;
        min-height: auto;
    }

    .hud-panel {
        padding: 24px 20px;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}
