/* ============================================
   LLITTL.com - Surreal Dreamscape Styles
   ============================================ */

/* CSS Custom Properties */
:root {
    --deep-ground: #1B1B2F;
    --primary-surface: #2D2B55;
    --accent-warm: #E8A87C;
    --accent-cool: #C3AED6;
    --highlight: #F5F0E8;
    --pop: #41EAD4;
    --text-primary: #EDE8D5;
    --text-secondary: #9B8EC2;

    --font-headline: 'Playfair Display', Georgia, serif;
    --font-body: 'Nunito Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

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

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

body {
    background-color: var(--deep-ground);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================
   Grain Overlay
   ============================================ */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    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='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============================================
   Dot Navigation
   ============================================ */
.dot-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.dot-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-end;
}

.dot-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-direction: row-reverse;
}

.dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}

.dot-link.active .dot,
.dot-link.near .dot {
    width: 10px;
    height: 10px;
    background-color: var(--pop);
}

.dot-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.dot-link:hover .dot-label {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Floating Particles
   ============================================ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--pop);
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(var(--drift-x, 20px));
    }
}

/* ============================================
   Hero Section - The Lens
   ============================================ */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-darkness {
    position: absolute;
    inset: 0;
    background: var(--deep-ground);
    z-index: 1;
}

.hero-lens {
    position: relative;
    z-index: 2;
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, var(--primary-surface) 0%, var(--deep-ground) 80%);
    overflow: hidden;
    animation: lensBreathe 6s ease-in-out infinite;
    box-shadow:
        0 0 80px rgba(65, 234, 212, 0.08),
        0 0 160px rgba(45, 43, 85, 0.4),
        inset 0 0 60px rgba(27, 27, 47, 0.6);
}

@keyframes lensBreathe {
    0%, 100% {
        transform: scale(0.92);
    }
    50% {
        transform: scale(1.0);
    }
}

.lens-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.lens-rings {
    position: absolute;
    inset: 0;
    opacity: 0.15;
}

.ring-svg {
    width: 100%;
    height: 100%;
}

.ring {
    fill: none;
    stroke: var(--accent-cool);
    stroke-width: 0.5;
    animation: ringPulse 8s ease-in-out infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 0.4s; }
.ring-3 { animation-delay: 0.8s; }

@keyframes ringPulse {
    0%, 100% { opacity: 0.3; stroke-width: 0.5; }
    50% { opacity: 0.8; stroke-width: 1; }
}

.hero-text {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-headline);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    color: var(--highlight);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.8;
}

.hero-icon {
    width: 48px;
    height: 48px;
    margin-top: 2rem;
    opacity: 0.5;
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInUp 1.5s ease 2s both;
}

.scroll-hint-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   Transition Zones
   ============================================ */
.transition-zone {
    position: relative;
    width: 100%;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--deep-ground);
}

.morph-container {
    width: 300px;
    height: 300px;
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

.transition-zone.in-view .morph-container {
    opacity: 0.8;
}

.morph-svg {
    width: 100%;
    height: 100%;
}

.morph-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.transition-zone.in-view .morph-path {
    stroke-dashoffset: 0;
}

.morph-path-inner {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.8s ease 0.3s;
}

.transition-zone.in-view .morph-path-inner {
    stroke-dashoffset: 0;
}

.morph-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease 0.5s;
}

.transition-zone.in-view .morph-branch {
    stroke-dashoffset: 0;
}

/* ============================================
   Narrative Sections
   ============================================ */
.narrative-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 6rem 2rem;
}

/* Asymmetric positioning */
.narrative-section.layer-left .section-content {
    margin-left: 20%;
    margin-right: auto;
}

.narrative-section.layer-right .section-content {
    margin-left: 55%;
    margin-right: auto;
}

.section-content {
    max-width: 520px;
    position: relative;
    z-index: 3;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.08s, transform 0.6s ease 0.08s;
}

.section-content.revealed .section-label {
    opacity: 1;
    transform: translateY(0);
}

.section-heading {
    font-family: var(--font-headline);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    color: var(--highlight);
    margin-bottom: 1.5rem;
    line-height: 1.15;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.16s, transform 0.6s ease 0.16s;
}

.section-content.revealed .section-heading {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-content.revealed .section-body:nth-of-type(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.24s;
}

.section-content.revealed .section-body:nth-of-type(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.32s;
}

.section-illustration {
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

.section-content.revealed .section-illustration {
    opacity: 1;
    transform: translateY(0);
}

.illustration-svg {
    width: 160px;
    height: 160px;
    opacity: 0.6;
}

/* ============================================
   Parallax Layers
   ============================================ */
.parallax-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    will-change: transform;
}

.parallax-fg {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    will-change: transform;
}

/* Background glows */
.bg-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
}

.glow-amber {
    background: var(--accent-warm);
    top: 20%;
    left: -10%;
}

.glow-teal {
    background: var(--pop);
    top: 30%;
    right: -10%;
}

.glow-lavender {
    background: var(--accent-cool);
    top: 10%;
    left: 30%;
}

.glow-deep {
    background: var(--primary-surface);
    top: 40%;
    right: 20%;
    opacity: 0.3;
}

/* ============================================
   Floating Spores (CSS particles)
   ============================================ */
.floating-spore {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--highlight);
    opacity: 0;
    animation: sporeDrift linear infinite;
}

.spore-1 {
    left: 15%;
    top: 70%;
    animation-duration: 12s;
    animation-delay: 0s;
}
.spore-2 {
    left: 45%;
    top: 80%;
    animation-duration: 16s;
    animation-delay: 2s;
    width: 3px;
    height: 3px;
}
.spore-3 {
    left: 75%;
    top: 60%;
    animation-duration: 14s;
    animation-delay: 4s;
    width: 2px;
    height: 2px;
    background: var(--accent-cool);
}
.spore-4 {
    left: 25%;
    top: 75%;
    animation-duration: 18s;
    animation-delay: 1s;
}
.spore-5 {
    left: 80%;
    top: 65%;
    animation-duration: 13s;
    animation-delay: 3s;
    width: 2px;
    height: 2px;
    background: var(--pop);
}
.spore-6 {
    left: 10%;
    top: 85%;
    animation-duration: 15s;
    animation-delay: 0.5s;
    width: 3px;
    height: 3px;
}
.spore-7 {
    left: 35%;
    top: 70%;
    animation-duration: 11s;
    animation-delay: 2.5s;
    width: 2px;
    height: 2px;
    background: var(--accent-warm);
}
.spore-8 {
    left: 60%;
    top: 90%;
    animation-duration: 17s;
    animation-delay: 1.5s;
}
.spore-9 {
    left: 85%;
    top: 75%;
    animation-duration: 14s;
    animation-delay: 4.5s;
    width: 3px;
    height: 3px;
    background: var(--accent-cool);
}
.spore-10 {
    left: 20%;
    top: 80%;
    animation-duration: 16s;
    animation-delay: 0.8s;
    width: 2px;
    height: 2px;
    background: var(--pop);
}
.spore-11 {
    left: 70%;
    top: 70%;
    animation-duration: 13s;
    animation-delay: 3.2s;
}

@keyframes sporeDrift {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    5% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.7;
        transform: translateY(-40vh) translateX(30px) scale(0.8);
    }
    95% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-80vh) translateX(-20px) scale(0.3);
    }
}

/* ============================================
   Sonar Rings
   ============================================ */
.sonar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--pop);
    opacity: 0;
    pointer-events: none;
}

.footer-dot:hover .sonar-ring {
    animation: sonarExpand 1.2s ease-out forwards;
}

.footer-dot:hover .sonar-1 {
    animation-delay: 0s;
}

.footer-dot:hover .sonar-2 {
    animation-delay: 0.4s;
}

.footer-dot:hover .sonar-3 {
    animation-delay: 0.8s;
}

@keyframes sonarExpand {
    0% {
        width: 10px;
        height: 10px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0.8;
    }
    100% {
        width: 120px;
        height: 120px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        opacity: 0;
    }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    position: relative;
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-ground);
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.footer-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.footer-whisper {
    font-family: var(--font-headline);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--text-secondary);
    text-align: center;
}

.footer-dot {
    position: relative;
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.footer-dot-inner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pop);
    animation: footerDotPulse 4s ease-in-out infinite;
}

@keyframes footerDotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.footer-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.4;
}

/* ============================================
   Vignette Effect
   ============================================ */
.narrative-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(27, 27, 47, 0.5) 100%);
    z-index: 2;
    pointer-events: none;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-lens {
        animation: none;
        transform: scale(1);
    }

    .ring {
        animation: none;
    }

    .hero-icon {
        animation: none;
    }

    .scroll-arrow {
        animation: none;
    }

    .floating-spore {
        animation: none;
    }

    .particle {
        animation: none;
    }

    .footer-dot-inner {
        animation: none;
    }

    .section-content,
    .section-label,
    .section-heading,
    .section-body,
    .section-illustration,
    .footer-content {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .morph-path,
    .morph-path-inner,
    .morph-branch {
        stroke-dashoffset: 0;
        transition: none;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .dot-nav {
        right: 12px;
    }

    .dot-nav ul {
        gap: 16px;
    }

    .narrative-section.layer-left .section-content,
    .narrative-section.layer-right .section-content {
        margin-left: 5%;
        margin-right: 5%;
    }

    .narrative-section {
        padding: 4rem 1.5rem;
    }

    .hero-lens {
        width: min(90vw, 90vh);
        height: min(90vw, 90vh);
    }

    .hero-subtitle {
        max-width: 300px;
    }

    .morph-container {
        width: 200px;
        height: 200px;
    }

    .bg-glow {
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .dot-nav {
        display: none;
    }

    .narrative-section.layer-left .section-content,
    .narrative-section.layer-right .section-content {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}
