/* GGOGGL.com - Altered Perception Through Enchanted Lenses */
/* Palette: Deep Obsidian #0b0c10, Tarnished Brass #8a7e5a, Aberration Red #e84057,
   Aberration Cyan #3de8e0, Phosphor White #e8e4d9, Lens Flare Gold #d4a843, Fog Violet #6b5b8a */

:root {
    --obsidian: #0b0c10;
    --brass: #8a7e5a;
    --red: #e84057;
    --cyan: #3de8e0;
    --phosphor: #e8e4d9;
    --gold: #d4a843;
    --violet: #6b5b8a;
    --chroma-red: #e84057;
    --chroma-cyan: #3de8e0;
    --chroma-offset: 3px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--phosphor);
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   APERTURE IRIS - Fixed Navigation
   ============================================ */
.aperture-iris {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    z-index: 1000;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.aperture-iris:hover {
    opacity: 1;
    transform: scale(1.15);
}

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

.iris-center-dot {
    opacity: 1;
    transition: opacity 0.6s ease;
}

.blade {
    opacity: 0.8;
    transform-origin: 100px 100px;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s ease;
}

.aperture-iris.open .blade-1 { transform: rotate(15deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-2 { transform: rotate(60deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-3 { transform: rotate(105deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-4 { transform: rotate(150deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-5 { transform: rotate(195deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-6 { transform: rotate(240deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-7 { transform: rotate(285deg) scale(0.3); opacity: 0.15; }
.aperture-iris.open .blade-8 { transform: rotate(330deg) scale(0.3); opacity: 0.15; }

/* ============================================
   BOKEH PARTICLES - Pure CSS, No JavaScript
   ============================================ */
.bokeh-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bokeh-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--color);
    filter: blur(2px);
    animation: bokeh-drift var(--dur) ease-in-out var(--delay) infinite alternate;
    will-change: transform;
}

@keyframes bokeh-drift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -20px) scale(1.2);
        opacity: 0.8;
    }
    50% {
        transform: translate(-15px, 25px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translate(20px, 10px) scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: translate(-25px, -15px) scale(1);
        opacity: 0.6;
    }
}

/* ============================================
   LENS SECTIONS - Base
   ============================================ */
.lens-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
    transition: filter 0.8s ease;
}

.lens-section.blur-out {
    filter: blur(4px) brightness(0.7);
    transform: scale(1.02);
}

.lens-section.focus-in {
    filter: blur(0px) brightness(1);
}

.section-inner {
    max-width: 860px;
    width: 100%;
    padding: 6rem 2rem;
    position: relative;
    z-index: 3;
}

/* ============================================
   CHROMATIC TEXT SHADOW - Signature Effect
   ============================================ */
.chromatic-text {
    text-shadow:
        calc(var(--chroma-offset) * -1) 2px 0 var(--chroma-red),
        var(--chroma-offset) 2px 0 var(--chroma-cyan);
}

/* ============================================
   CHROMATIC CARD SHADOW - Dual Shadow Pairs
   ============================================ */
.chromatic-card {
    box-shadow:
        calc(var(--chroma-offset) * -1) calc(var(--chroma-offset) * -0.67) 0 rgba(232, 64, 87, 0.1),
        var(--chroma-offset) calc(var(--chroma-offset) * 0.67) 0 rgba(61, 232, 224, 0.1);
    transition: box-shadow 0.4s ease, opacity 0.8s ease, transform 0.8s ease;
}

.chromatic-card:hover {
    box-shadow:
        -6px -4px 0 rgba(232, 64, 87, 0.18),
        6px 4px 0 rgba(61, 232, 224, 0.18);
}

/* ============================================
   SECTION 1: THE DARK
   ============================================ */
.section-dark {
    background: var(--obsidian);
    min-height: 100vh;
}

.aperture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--obsidian);
    z-index: 10;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.aperture-overlay.opening {
    clip-path: circle(100% at 50% 50%);
}

.light-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow:
        0 0 20px 8px rgba(212, 168, 67, 0.3),
        0 0 60px 20px rgba(212, 168, 67, 0.1);
    animation: light-pulse 2.5s ease-in-out infinite;
    z-index: 5;
    transition: opacity 1.5s ease;
}

@keyframes light-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
        box-shadow:
            0 0 20px 8px rgba(212, 168, 67, 0.3),
            0 0 60px 20px rgba(212, 168, 67, 0.1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 1;
        box-shadow:
            0 0 30px 12px rgba(212, 168, 67, 0.5),
            0 0 80px 30px rgba(212, 168, 67, 0.2);
    }
}

.hero-content {
    position: relative;
    z-index: 6;
    text-align: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 2s ease, transform 2s ease;
}

.hero-content.visible {
    opacity: 1;
    transform: scale(1);
}

.site-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(5rem, 15vw, 14rem);
    letter-spacing: 0.04em;
    color: var(--phosphor);
    line-height: 1;
    animation: title-settle 3s ease forwards;
    animation-play-state: paused;
}

.hero-content.visible .site-title {
    animation-play-state: running;
}

@keyframes title-settle {
    0% {
        text-shadow:
            -8px 3px 0 var(--chroma-red),
            8px 3px 0 var(--chroma-cyan);
        letter-spacing: 0.12em;
    }
    30% {
        text-shadow:
            -5px 2px 0 var(--chroma-red),
            5px 2px 0 var(--chroma-cyan);
    }
    60% {
        text-shadow:
            -4px 2px 0 var(--chroma-red),
            4px 2px 0 var(--chroma-cyan);
        letter-spacing: 0.06em;
    }
    100% {
        text-shadow:
            -3px 2px 0 var(--chroma-red),
            3px 2px 0 var(--chroma-cyan);
        letter-spacing: 0.04em;
    }
}

.site-subtitle {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--brass);
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 1.5s ease 1s;
}

.hero-content.visible .site-subtitle {
    opacity: 1;
}

/* ============================================
   SECTION 2: FIRST FOCUS
   ============================================ */
.section-first-focus {
    background: linear-gradient(
        180deg,
        var(--obsidian) 0%,
        rgba(11, 12, 16, 0.97) 30%,
        rgba(107, 91, 138, 0.04) 70%,
        var(--obsidian) 100%
    );
    min-height: 150vh;
    flex-direction: column;
}

/* Etched Diagrams - Marginalia */
.etched-diagram {
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s ease;
    z-index: 1;
}

.etched-diagram.visible {
    opacity: 1;
}

.diagram-left {
    left: 2%;
    top: 15%;
    width: 120px;
    height: auto;
}

.diagram-right {
    right: 2%;
    top: 40%;
    width: 110px;
    height: auto;
}

.diagram-center-bg {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 700px;
    height: auto;
}

.diagram-paths {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease;
}

.etched-diagram.visible .diagram-paths {
    stroke-dashoffset: 0;
}

/* Content Panels */
.content-panel {
    background: rgba(232, 228, 217, 0.02);
    border: 1px solid rgba(138, 126, 90, 0.2);
    padding: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease, filter 0.8s ease;
    filter: blur(6px);
}

.content-panel.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--panel-rotate, 0deg));
    filter: blur(0px);
}

.panel-offset-left {
    --panel-rotate: -0.5deg;
    margin-left: -3%;
    margin-right: 5%;
}

.panel-offset-right {
    --panel-rotate: 0.7deg;
    margin-left: 5%;
    margin-right: -3%;
}

.panel-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    display: block;
    margin-bottom: 1rem;
}

.section-heading {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    letter-spacing: 0.04em;
    color: var(--phosphor);
    margin-bottom: 1rem;
    text-shadow:
        -2px 1px 0 rgba(232, 64, 87, 0.15),
        2px 1px 0 rgba(61, 232, 224, 0.15);
}

.body-text {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.85;
    color: rgba(232, 228, 217, 0.65);
}

/* Test Pattern Dividers */
.test-pattern-divider {
    border: none;
    height: 6px;
    margin: 3rem 0;
    background:
        repeating-linear-gradient(
            90deg,
            var(--phosphor) 0px,
            var(--phosphor) 3px,
            var(--obsidian) 3px,
            var(--obsidian) 6px
        );
    opacity: 0.08;
    position: relative;
    mask-image: radial-gradient(ellipse 60% 100% at 50% 50%, black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 50%, black 0%, transparent 100%);
}

/* ============================================
   SECTION 3: THE REFRACTION
   ============================================ */
.section-refraction {
    background: var(--obsidian);
    min-height: 150vh;
    flex-direction: column;
}

.spectral-bands {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.spectral-bands.visible {
    opacity: 1;
}

.spectral-band {
    flex: 1;
    opacity: 0.08;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.band-red { background: var(--red); }
.band-gold { background: var(--gold); }
.band-cyan { background: var(--cyan); }
.band-violet { background: var(--violet); }

.spectral-bands.spread .spectral-band:nth-child(1) { transform: translateY(-8px); }
.spectral-bands.spread .spectral-band:nth-child(2) { transform: translateY(-4px); }
.spectral-bands.spread .spectral-band:nth-child(3) { transform: translateY(0px); }
.spectral-bands.spread .spectral-band:nth-child(4) { transform: translateY(4px); }
.spectral-bands.spread .spectral-band:nth-child(5) { transform: translateY(8px); }
.spectral-bands.spread .spectral-band:nth-child(6) { transform: translateY(12px); }
.spectral-bands.spread .spectral-band:nth-child(7) { transform: translateY(16px); }
.spectral-bands.spread .spectral-band:nth-child(8) { transform: translateY(20px); }

.refraction-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    width: 100%;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.glass-panel {
    background: rgba(11, 12, 16, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(138, 126, 90, 0.2);
    padding: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease, filter 0.8s ease;
    filter: blur(4px);
    box-shadow:
        -3px -2px 0 rgba(232, 64, 87, 0.08),
        3px 2px 0 rgba(61, 232, 224, 0.08);
}

.glass-panel.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
}

.wavelength-readout {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
}

.wavelength-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(138, 126, 90, 0.1);
}

.wl-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(232, 228, 217, 0.4);
}

.wl-value {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

/* ============================================
   SECTION 4: DEEP VISION
   ============================================ */
.section-deep-vision {
    background: linear-gradient(
        180deg,
        var(--obsidian) 0%,
        rgba(107, 91, 138, 0.06) 50%,
        var(--obsidian) 100%
    );
    min-height: 150vh;
    perspective: 1200px;
}

.deep-vision-inner {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    perspective: 1200px;
}

.perspective-panel {
    background: rgba(232, 228, 217, 0.02);
    border: 1px solid rgba(138, 126, 90, 0.2);
    padding: 3rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease, filter 0.8s ease;
    filter: blur(5px);
}

.perspective-panel.visible {
    opacity: 1;
    filter: blur(0px);
}

.panel-tilt-right.visible {
    transform: rotateY(-2deg) translateX(-3%);
}

.panel-tilt-left.visible {
    transform: rotateY(2deg) translateX(3%);
}

.perspective-panel:hover {
    box-shadow:
        -8px -5px 0 rgba(232, 64, 87, 0.15),
        8px 5px 0 rgba(61, 232, 224, 0.15);
}

/* ============================================
   SECTION 5: THE CLOSE
   ============================================ */
.section-close {
    background: linear-gradient(
        180deg,
        var(--obsidian) 0%,
        rgba(107, 91, 138, 0.04) 40%,
        var(--obsidian) 100%
    );
    min-height: 100vh;
    flex-direction: column;
}

.close-content {
    position: relative;
    z-index: 5;
    max-width: 800px;
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.close-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.close-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    letter-spacing: 0.04em;
    color: var(--phosphor);
    margin-bottom: 2rem;
}

.close-body {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.9;
    color: rgba(232, 228, 217, 0.6);
    margin-bottom: 4rem;
}

/* Eye Test Chart */
.eye-test-chart {
    text-align: center;
}

.chart-line {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    text-shadow:
        -2px 1px 0 rgba(232, 64, 87, 0.1),
        2px 1px 0 rgba(61, 232, 224, 0.1);
}

.chart-line-1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--phosphor);
    opacity: 0.85;
}

.chart-line-2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--gold);
    opacity: 0.7;
}

.chart-line-3 {
    font-size: clamp(0.9rem, 1.8vw, 1.5rem);
    color: var(--brass);
    opacity: 0.5;
}

.chart-line-4 {
    font-size: clamp(0.6rem, 1vw, 1rem);
    color: var(--brass);
    opacity: 0.3;
}

/* Closing Iris */
.closing-iris {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 4;
    opacity: 0;
    transition: opacity 1.5s ease 0.8s;
}

.closing-iris.visible {
    opacity: 1;
}

.closing-iris-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--brass);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: iris-ring-pulse 4s ease-in-out infinite;
}

.ring-outer {
    width: 100px;
    height: 100px;
    opacity: 0.15;
    animation-delay: 0s;
}

.ring-mid {
    width: 60px;
    height: 60px;
    opacity: 0.25;
    animation-delay: -1.3s;
}

.ring-inner {
    width: 30px;
    height: 30px;
    opacity: 0.35;
    animation-delay: -2.6s;
}

@keyframes iris-ring-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.15; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}

.closing-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 15px 5px rgba(212, 168, 67, 0.3);
    animation: closing-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes closing-dot-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px 5px rgba(212, 168, 67, 0.3); }
    50% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 25px 10px rgba(212, 168, 67, 0.5); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .etched-diagram {
        display: none;
    }

    .panel-offset-left,
    .panel-offset-right {
        margin-left: 0;
        margin-right: 0;
    }

    .content-panel,
    .glass-panel,
    .perspective-panel {
        padding: 2rem;
    }

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

    .panel-tilt-right.visible {
        transform: rotateY(0deg) translateX(0);
    }

    .panel-tilt-left.visible {
        transform: rotateY(0deg) translateX(0);
    }

    .wavelength-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .aperture-iris {
        width: 40px;
        height: 40px;
        top: 16px;
        right: 16px;
    }

    .site-title {
        font-size: clamp(3rem, 18vw, 6rem);
    }

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