/* ============================================
   LLITTL.com - Styles
   Dopamine Neon over Deep Void
   HUD Overlay System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --void: #0a0a14;
    --panel-bg: rgba(14, 14, 38, 0.72);
    --neon-magenta: #ff2d78;
    --neon-cyan: #00f0ff;
    --neon-lime: #b8ff00;
    --signal-amber: #ffaa00;
    --text-primary: #e8e4f0;
    --text-secondary: #8a86a0;
    --grain-color: rgba(180, 170, 160, 0.04);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --scroll-progress: 0;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--void);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw + 0.4rem, 1.25rem);
    line-height: 1.72;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Film Grain Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 900;
    mix-blend-mode: overlay;
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    animation: grain-shift 0.4s steps(4) infinite;
}

@keyframes grain-shift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -2px); }
    100% { transform: translate(2px, 1px); }
}

/* --- HUD Frame --- */
#hud-frame {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 2px solid var(--neon-magenta);
    pointer-events: none;
    z-index: 100;
    opacity: 0.6;
}

/* --- Background Blob Layer --- */
#blob-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
}

.blob-1 {
    top: -10%;
    left: -5%;
    animation: blob-drift-1 25s ease-in-out infinite;
}

.blob-2 {
    top: 30%;
    right: -10%;
    animation: blob-drift-2 30s ease-in-out infinite;
}

.blob-3 {
    bottom: -5%;
    left: 20%;
    animation: blob-drift-3 28s ease-in-out infinite;
}

.blob-4 {
    top: 50%;
    left: 50%;
    animation: blob-drift-4 35s ease-in-out infinite;
}

@keyframes blob-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(60px, 40px) scale(1.15); }
    50% { transform: translate(30px, 80px) scale(0.9); }
    75% { transform: translate(-20px, 50px) scale(1.25); }
}

@keyframes blob-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1.1); }
    25% { transform: translate(-50px, 30px) scale(0.85); }
    50% { transform: translate(-80px, -20px) scale(1.3); }
    75% { transform: translate(-30px, -50px) scale(1); }
}

@keyframes blob-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(0.9); }
    33% { transform: translate(40px, -60px) scale(1.2); }
    66% { transform: translate(-30px, -30px) scale(1.05); }
}

@keyframes blob-drift-4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-40px, 30px) scale(1.15); }
    40% { transform: translate(-70px, -10px) scale(0.85); }
    60% { transform: translate(-20px, -50px) scale(1.3); }
    80% { transform: translate(30px, -20px) scale(0.95); }
}

/* --- Midground Geometric Layer --- */
#geo-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.geo-circle, .geo-triangle, .geo-hex {
    position: absolute;
}

.geo-circle-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    right: 10%;
    animation: geo-rotate 90s linear infinite;
}

.geo-circle-2 {
    width: 300px;
    height: 300px;
    bottom: 20%;
    left: 5%;
    animation: geo-rotate 90s linear infinite reverse;
}

.geo-triangle-1 {
    width: 160px;
    height: 160px;
    top: 60%;
    right: 25%;
    animation: geo-rotate 120s linear infinite;
}

.geo-triangle-2 {
    width: 140px;
    height: 140px;
    top: 25%;
    left: 15%;
    animation: geo-rotate 100s linear infinite reverse;
}

.geo-hex {
    width: 350px;
    height: 350px;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation: geo-fade 20s ease-in-out infinite;
}

@keyframes geo-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes geo-fade {
    0%, 100% { opacity: 0.12; }
    50% { opacity: 0.06; }
}

/* --- HUD Corner Elements --- */
#hud-corners {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.hud-corner {
    position: fixed;
    pointer-events: auto;
    mix-blend-mode: screen;
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.8vw + 0.2rem, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Top-left: Logo */
.hud-top-left {
    top: 32px;
    left: 36px;
}

.hud-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: var(--neon-cyan);
    letter-spacing: 0.15em;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

/* Top-right: Signal */
.hud-top-right {
    top: 32px;
    right: 36px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
}

.signal-bar {
    display: block;
    width: 4px;
    background-color: var(--neon-lime);
    border-radius: 1px;
}

.bar-1 {
    height: 5px;
    animation: signal-pulse-1 3s ease-in-out infinite;
}

.bar-2 {
    height: 9px;
    animation: signal-pulse-2 3s ease-in-out infinite 0.3s;
}

.bar-3 {
    height: 14px;
    animation: signal-pulse-3 3s ease-in-out infinite 0.6s;
}

@keyframes signal-pulse-1 {
    0%, 100% { opacity: 1; }
    30% { opacity: 0.3; }
    60% { opacity: 1; }
}

@keyframes signal-pulse-2 {
    0%, 100% { opacity: 1; }
    40% { opacity: 0.2; }
    70% { opacity: 1; }
}

@keyframes signal-pulse-3 {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.15; }
    80% { opacity: 1; }
}

.signal-label {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

/* Bottom-left: Coordinates */
.hud-bottom-left {
    bottom: 32px;
    left: 36px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coord-readout {
    color: var(--signal-amber);
    font-size: clamp(0.6rem, 0.7vw + 0.2rem, 0.78rem);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

.coord-label {
    color: var(--text-secondary);
    font-size: 0.55rem;
    letter-spacing: 0.12em;
    margin-top: 4px;
    opacity: 0.7;
}

/* Bottom-right: Radial Menu */
.hud-bottom-right {
    bottom: 32px;
    right: 36px;
}

.radial-trigger {
    width: 36px;
    height: 36px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--neon-magenta);
    border-radius: 50%;
    position: absolute;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.radial-dot {
    width: 6px;
    height: 6px;
    background-color: var(--neon-magenta);
    border-radius: 50%;
    position: relative;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.radial-trigger:hover .radial-ring {
    transform: scale(1.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.radial-trigger:hover .radial-dot {
    background-color: var(--neon-cyan);
}

.radial-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.radial-link {
    position: absolute;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
    pointer-events: none;
    border-bottom: 1px dotted var(--text-secondary);
    padding-bottom: 2px;
}

.radial-link:hover {
    color: var(--neon-lime);
    border-bottom-color: var(--neon-lime);
}

/* Radial link positions in a 90-degree arc from bottom-right */
.radial-link-1 { bottom: 60px; right: 5px; transition-delay: 0ms; }
.radial-link-2 { bottom: 52px; right: 50px; transition-delay: 60ms; }
.radial-link-3 { bottom: 35px; right: 88px; transition-delay: 120ms; }
.radial-link-4 { bottom: 12px; right: 112px; transition-delay: 180ms; }
.radial-link-5 { bottom: -10px; right: 122px; transition-delay: 240ms; }

.radial-menu.active .radial-link {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* --- Main Content --- */
#content {
    position: relative;
    z-index: 10;
}

/* --- Hero Section --- */
.viewport-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.hero-text {
    text-align: center;
    max-width: 800px;
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw + 0.5rem, 4.5rem);
    letter-spacing: 0.04em;
    color: var(--neon-magenta);
    opacity: 0;
    transform: translateY(10px);
    animation: hero-fade-in 1.2s ease-out 1.5s forwards;
    text-shadow: 0 0 30px rgba(255, 45, 120, 0.25);
}

@keyframes hero-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Breathing Space --- */
.breath-space {
    height: 60vh;
    position: relative;
}

.breath-space-final {
    height: 40vh;
}

/* --- Scan Lines --- */
.scan-line {
    height: 1px;
    background-color: var(--text-secondary);
    opacity: 0;
    margin: 0 80px;
    transform: scaleX(0);
    transition: transform 0.6s ease-out, opacity 0.4s ease;
    position: relative;
}

.scan-line.active {
    opacity: 0.3;
    transform: scaleX(1);
    box-shadow: 0 0 12px var(--neon-magenta), 0 0 24px rgba(255, 45, 120, 0.3);
    animation: scan-glow 0.8s ease-out forwards;
}

@keyframes scan-glow {
    0% { box-shadow: 0 0 12px var(--neon-magenta), 0 0 24px rgba(255, 45, 120, 0.4); }
    100% { box-shadow: 0 0 2px rgba(255, 45, 120, 0.05); }
}

/* --- Content Sections --- */
.content-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 80px;
    align-items: flex-start;
}

/* --- Content Panels --- */
.content-panel {
    max-width: 680px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 40px 44px;
    position: relative;
    border: 1px solid rgba(138, 134, 160, 0.12);
}

.content-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    mix-blend-mode: overlay;
}

.panel-left {
    align-self: flex-start;
    margin-left: 5%;
}

.panel-right {
    align-self: flex-end;
    margin-right: 5%;
}

.panel-center {
    align-self: center;
}

/* --- Reveal Animation --- */
.reveal-panel {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

.panel-left.reveal-panel {
    transform: translateX(-40px) translateY(20px);
}

.panel-left.reveal-panel.visible {
    transform: translateX(0) translateY(0);
}

.panel-right.reveal-panel {
    transform: translateX(40px) translateY(20px);
}

.panel-right.reveal-panel.visible {
    transform: translateX(0) translateY(0);
}

/* --- Panel Typography --- */
.panel-heading {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw + 0.5rem, 4.5rem);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.15;
}

.panel-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw + 0.4rem, 1.25rem);
    line-height: 1.72;
    color: var(--text-primary);
}

.panel-body.secondary {
    color: var(--text-secondary);
    font-weight: 300;
}

.panel-tag {
    display: inline-block;
    margin-top: 24px;
    font-family: var(--font-mono);
    font-size: clamp(0.6rem, 0.7vw + 0.2rem, 0.78rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    border-bottom: 1px dotted var(--neon-cyan);
    padding-bottom: 2px;
}

/* --- Trace Log Entries --- */
.trace-entries {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.trace-entry {
    display: flex;
    gap: 16px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(138, 134, 160, 0.1);
}

.trace-time {
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.8vw + 0.2rem, 0.85rem);
    font-weight: 500;
    color: var(--signal-amber);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.trace-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw + 0.3rem, 1.05rem);
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Closing Section --- */
.closing-text {
    color: var(--neon-magenta);
    text-shadow: 0 0 20px rgba(255, 45, 120, 0.2);
    text-align: center;
}

.closing-sub {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 300;
    margin-top: 12px;
    font-size: clamp(0.9rem, 1vw + 0.3rem, 1.1rem);
}

/* --- Scroll Weight Typography --- */
.scroll-weight {
    font-variation-settings: 'wght' var(--heading-weight, 300);
    transition: font-variation-settings 0.3s ease-out;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #hud-frame {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .hud-top-left { top: 22px; left: 22px; }
    .hud-top-right { top: 22px; right: 22px; }
    .hud-bottom-left { bottom: 22px; left: 22px; }
    .hud-bottom-right { bottom: 22px; right: 22px; }

    .content-section {
        padding: 20px;
        gap: 40px;
    }

    .content-panel {
        padding: 28px 24px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .panel-left, .panel-right {
        align-self: center;
    }

    .scan-line {
        margin: 0 30px;
    }

    .blob {
        width: 300px;
        height: 300px;
    }

    .breath-space {
        height: 40vh;
    }

    .radial-link-1 { bottom: 50px; right: 0; }
    .radial-link-2 { bottom: 44px; right: 40px; }
    .radial-link-3 { bottom: 30px; right: 72px; }
    .radial-link-4 { bottom: 10px; right: 92px; }
    .radial-link-5 { bottom: -10px; right: 100px; }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.4rem, 6vw, 2.4rem);
    }

    .panel-heading {
        font-size: clamp(1.4rem, 5vw, 2.2rem);
    }

    .geo-circle, .geo-triangle, .geo-hex {
        display: none;
    }
}
