/* =============================================
   eyes.cash - Surreal Optometric Fever Dream
   ============================================= */

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

:root {
    --bg-primary: #0B0D11;
    --bg-secondary: #161A24;
    --text-primary: #E8E0D4;
    --accent-mint: #7ECFC0;
    --accent-copper: #C47A5A;
    --accent-violet: #B8A9C4;
    --accent-gold: #D4A24C;
    --lens-flare: #F0E8DC;
    --pure-black: #000000;
    --ease-optical: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-mint) var(--bg-primary);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Instrument Serif', serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Bokeh Background Layer --- */
.bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    will-change: transform;
}

/* --- Lens Reticle Foreground Layer --- */
.reticle-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    overflow: hidden;
}

.reticle {
    position: absolute;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.reticle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    right: 15%;
    animation: reticle-drift-1 20s linear infinite;
}

.reticle-2 {
    width: 250px;
    height: 250px;
    bottom: 20%;
    left: 10%;
    animation: reticle-drift-2 25s linear infinite;
}

.reticle-3 {
    width: 400px;
    height: 400px;
    top: 40%;
    right: 5%;
    animation: reticle-drift-3 30s linear infinite;
}

.reticle-4 {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 25%;
    animation: reticle-drift-4 22s linear infinite;
}

.reticle-5 {
    width: 280px;
    height: 280px;
    top: 25%;
    left: 40%;
    animation: reticle-drift-5 28s linear infinite;
}

.reticle-6 {
    width: 350px;
    height: 350px;
    bottom: 10%;
    right: 30%;
    animation: reticle-drift-6 35s linear infinite;
}

@keyframes reticle-drift-1 {
    0% { transform: rotate(0deg) translate(0, 0); }
    25% { transform: rotate(90deg) translate(30px, -20px); }
    50% { transform: rotate(180deg) translate(-10px, 40px); }
    75% { transform: rotate(270deg) translate(-30px, -10px); }
    100% { transform: rotate(360deg) translate(0, 0); }
}

@keyframes reticle-drift-2 {
    0% { transform: rotate(0deg) translate(0, 0); }
    50% { transform: rotate(-180deg) translate(40px, 20px); }
    100% { transform: rotate(-360deg) translate(0, 0); }
}

@keyframes reticle-drift-3 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes reticle-drift-4 {
    0% { transform: rotate(0deg) translate(0, 0); }
    33% { transform: rotate(120deg) translate(-20px, 30px); }
    66% { transform: rotate(240deg) translate(25px, -15px); }
    100% { transform: rotate(360deg) translate(0, 0); }
}

@keyframes reticle-drift-5 {
    0% { transform: rotate(0deg) translate(0, 0); }
    50% { transform: rotate(180deg) translate(-15px, -25px); }
    100% { transform: rotate(360deg) translate(0, 0); }
}

@keyframes reticle-drift-6 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* --- Navigation Strip --- */
.nav-strip {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 200;
}

.nav-dot {
    border-radius: 50%;
    border: 1px solid var(--accent-mint);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s var(--ease-optical);
    position: relative;
}

.nav-dot.active {
    background: var(--accent-mint);
    box-shadow: 0 0 12px rgba(126, 207, 192, 0.3);
    animation: dot-pulse 2s var(--ease-optical) infinite alternate;
}

.nav-dot:hover {
    background: rgba(126, 207, 192, 0.3);
}

@keyframes dot-pulse {
    0% { box-shadow: 0 0 8px rgba(126, 207, 192, 0.2); }
    100% { box-shadow: 0 0 20px rgba(126, 207, 192, 0.5); }
}

/* --- Refractions (Sections) --- */
.refraction {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Refraction 1: Accommodation (Hero) --- */
.refraction-1 {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.refraction-1-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

.iris-mandala {
    position: absolute;
    width: min(80vh, 80vw);
    height: min(80vh, 80vw);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mandala-svg {
    width: 100%;
    height: 100%;
    animation: mandala-rotate 720s linear infinite;
}

.mandala-ring {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw-ring 3s var(--ease-optical) forwards;
}

.ring-1 { animation-delay: 0.8s; }
.ring-2 { animation-delay: 0.95s; }
.ring-3 { animation-delay: 1.1s; }
.ring-4 { animation-delay: 1.25s; }
.ring-5 { animation-delay: 1.4s; }
.ring-6 { animation-delay: 1.55s; }
.ring-7 { animation-delay: 1.7s; }
.ring-8 { animation-delay: 1.85s; }
.ring-9 { animation-delay: 2.0s; }
.ring-10 { animation-delay: 2.15s; }
.ring-11 { animation-delay: 2.3s; }
.ring-12 { animation-delay: 2.45s; }

@keyframes draw-ring {
    to { stroke-dashoffset: 0; }
}

@keyframes mandala-rotate {
    to { transform: rotate(360deg); }
}

.mandala-line {
    opacity: 0;
    animation: line-fade-in 1.5s var(--ease-optical) forwards;
    animation-delay: 2.5s;
}

@keyframes line-fade-in {
    to { opacity: 0.08; }
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 72px;
    letter-spacing: 0.2em;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: title-fade-in 1.5s var(--ease-optical) forwards;
    animation-delay: 2s;
}

@keyframes title-fade-in {
    to { opacity: 1; }
}

.hero-subtitle {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 19px;
    color: var(--accent-violet);
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 16px;
    opacity: 0;
    animation: title-fade-in 1.5s var(--ease-optical) forwards;
    animation-delay: 2.8s;
}

/* --- Split Screen Layout --- */
.split-screen {
    display: grid;
    min-height: 100vh;
    position: relative;
    transition: grid-template-columns 0.6s var(--ease-optical);
}

.split-38-62 {
    grid-template-columns: 38% 62%;
}

.split-50-50 {
    grid-template-columns: 50% 50%;
}

.split-62-38 {
    grid-template-columns: 62% 38%;
}

.panel-left {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.panel-right {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    filter: blur(1.2px);
    transition: filter 0.2s var(--ease-optical);
    overflow: hidden;
}

.panel-right:hover {
    filter: blur(0px);
}

.panel-content {
    padding: 60px 48px;
    max-width: 640px;
}

.panel-left .panel-content {
    margin-left: auto;
    margin-right: 40px;
}

.right-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
}

/* --- Section Labels --- */
.section-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--accent-violet);
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
    opacity: 0.7;
}

/* --- Chromatic Aberration Divider --- */
.chromatic-aberration-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 38%;
    width: 8px;
    z-index: 3;
    pointer-events: none;
    transform: translateX(-50%);
}

.chromatic-aberration-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 4px;
    height: 100%;
    background: rgba(126, 207, 192, 0.08);
    filter: blur(1px);
}

.chromatic-aberration-divider::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 4px;
    height: 100%;
    background: rgba(196, 122, 90, 0.08);
    filter: blur(1px);
}

.split-50-50 .chromatic-aberration-divider {
    left: 50%;
}

.split-62-38 .chromatic-aberration-divider {
    left: 62%;
}

.aberration-intense::before {
    width: 6px;
    left: -3px;
    background: rgba(126, 207, 192, 0.12);
    filter: blur(2px);
}

.aberration-intense::after {
    width: 6px;
    right: -3px;
    background: rgba(196, 122, 90, 0.12);
    filter: blur(2px);
}

/* --- Typography --- */
.section-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 32px;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.narrative-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.narrative-text:last-child {
    margin-bottom: 0;
}

.gold-highlight {
    color: var(--accent-gold);
}

/* --- Currency Glyphs --- */
.currency-glyph {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    position: absolute;
    opacity: 0.08;
    color: var(--text-primary);
    pointer-events: none;
    transition: filter 1s var(--ease-optical);
    filter: blur(8px);
}

.currency-glyph.resolved {
    filter: blur(0px);
}

.currency-glyph-dollar {
    font-size: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.currency-glyph-euro {
    font-size: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.currency-glyph-pound {
    font-size: 380px;
    top: 40%;
    left: 45%;
    transform: translate(-50%, -50%);
}

.currency-glyph-yen {
    font-size: 300px;
    top: 60%;
    left: 55%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
}

/* --- Section Reticle --- */
.section-reticle {
    width: 260px;
    height: 260px;
    position: relative;
    z-index: 1;
    animation: reticle-drift-3 25s linear infinite;
}

/* --- Astigmatism Pattern --- */
.astigmatism-pattern {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.astigmatism-pattern svg {
    width: 100%;
    height: auto;
}

.astig-ellipse {
    transform-origin: 200px 200px;
}

.e1 { animation: astig-morph-1 8s var(--ease-optical) infinite alternate; }
.e2 { animation: astig-morph-2 10s var(--ease-optical) infinite alternate; }
.e3 { animation: astig-morph-3 7s var(--ease-optical) infinite alternate; }
.e4 { animation: astig-morph-1 9s var(--ease-optical) infinite alternate; }
.e5 { animation: astig-morph-2 11s var(--ease-optical) infinite alternate; }
.e6 { animation: astig-morph-3 12s var(--ease-optical) infinite alternate; }
.e7 { animation: astig-morph-1 8.5s var(--ease-optical) infinite alternate; }

@keyframes astig-morph-1 {
    0% { transform: rotate(0deg) scale(1, 1); }
    50% { transform: rotate(15deg) scale(0.85, 1.15); }
    100% { transform: rotate(-10deg) scale(1.1, 0.9); }
}

@keyframes astig-morph-2 {
    0% { transform: rotate(0deg) scale(1, 1); }
    50% { transform: rotate(-20deg) scale(1.1, 0.85); }
    100% { transform: rotate(10deg) scale(0.9, 1.1); }
}

@keyframes astig-morph-3 {
    0% { transform: rotate(0deg) scale(1, 1); }
    50% { transform: rotate(10deg) scale(1.15, 0.9); }
    100% { transform: rotate(-15deg) scale(0.85, 1.1); }
}

/* --- Prescription Card --- */
.prescription-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(184, 169, 196, 0.3);
    padding: 32px;
    max-width: 420px;
    margin-top: 20px;
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(184, 169, 196, 0.2);
    margin-bottom: 20px;
}

.prescription-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--accent-violet);
    text-transform: uppercase;
}

.prescription-id {
    font-family: 'Azeret Mono', monospace;
    font-size: 12px;
    color: var(--accent-mint);
}

.prescription-grid {
    display: grid;
    gap: 12px;
}

.prescription-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(184, 169, 196, 0.1);
}

.prescription-field-label {
    font-family: 'Azeret Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--accent-violet);
}

.prescription-field-value {
    font-family: 'Azeret Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--accent-mint);
}

.prescription-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(184, 169, 196, 0.2);
}

.prescription-note {
    font-family: 'Azeret Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--accent-violet);
    opacity: 0.6;
}

/* --- Refraction 4 Right Panel Bokeh Pulse --- */
.refraction-4-right .bokeh-circle-local {
    position: absolute;
    border-radius: 50%;
    animation: bokeh-pulse 4s var(--ease-optical) infinite alternate;
}

@keyframes bokeh-pulse {
    0% { transform: scale(1); opacity: 0.06; }
    100% { transform: scale(1.05); opacity: 0.09; }
}

/* --- Refraction 5: Dark Adaptation --- */
.refraction-5 {
    background: var(--pure-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-adaptation-content {
    max-width: 800px;
    width: 100%;
    padding: 40px;
    text-align: center;
}

.poem-line {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: 28px;
    text-align: center;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease-optical), transform 0.6s var(--ease-optical);
}

.poem-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.line-mint { color: var(--accent-mint); }
.line-copper { color: var(--accent-copper); }
.line-violet { color: var(--accent-violet); }
.line-gold { color: var(--accent-gold); }

/* Dim accents in dark adaptation -- 60% opacity */
.refraction-5 .line-mint { color: rgba(126, 207, 192, 0.6); }
.refraction-5 .line-copper { color: rgba(196, 122, 90, 0.6); }
.refraction-5 .line-violet { color: rgba(184, 169, 196, 0.6); }
.refraction-5 .line-gold { color: rgba(212, 162, 76, 0.6); }

/* --- Refraction 6: 20/20 Final --- */
.refraction-6 {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.refraction-6-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

.iris-mandala-final {
    width: min(80vh, 80vw);
    height: min(80vh, 80vw);
}

.iris-mandala-final .mandala-svg {
    animation: none;
}

.mandala-final circle,
.mandala-final line {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
}

.mandala-final line {
    opacity: 0.06;
}

.final-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 48px;
    letter-spacing: 0.2em;
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.final-subtitle {
    font-family: 'Azeret Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.3em;
    color: var(--accent-mint);
    margin-top: 12px;
    position: relative;
    z-index: 2;
    opacity: 0.6;
}

.cta-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid var(--accent-mint);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 32px;
    position: relative;
    z-index: 2;
    transition: background 0.3s var(--ease-optical);
}

.cta-button:hover {
    background: rgba(126, 207, 192, 0.2);
}

.arrow-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s var(--ease-optical);
}

.cta-button:hover .arrow-icon {
    transform: translateX(4px);
}

/* --- Section Reveal Animations --- */
.panel-left .panel-content {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s var(--ease-optical), transform 0.8s var(--ease-optical);
}

.panel-left.revealed .panel-content {
    opacity: 1;
    transform: translateX(0);
}

.panel-right .panel-content {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.8s var(--ease-optical) 0.2s, transform 0.8s var(--ease-optical) 0.2s;
}

.panel-right.revealed .panel-content {
    opacity: 1;
    transform: translateX(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 42px;
        letter-spacing: 0.12em;
    }

    .final-title {
        font-size: 32px;
    }

    .split-screen {
        grid-template-columns: 1fr !important;
    }

    .panel-right {
        filter: none;
        min-height: 50vh;
    }

    .panel-content {
        padding: 40px 24px;
    }

    .panel-left .panel-content {
        margin-left: 0;
        margin-right: 0;
    }

    .section-heading {
        font-size: 26px;
    }

    .narrative-text {
        font-size: 16px;
    }

    .currency-glyph-dollar,
    .currency-glyph-euro,
    .currency-glyph-pound,
    .currency-glyph-yen {
        font-size: 200px;
    }

    .nav-strip {
        display: none;
    }

    .chromatic-aberration-divider {
        display: none;
    }

    .poem-line {
        font-size: 20px;
    }

    .prescription-card {
        padding: 20px;
    }

    .prescription-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .reticle-layer {
        display: none;
    }
}
