/* ============================================
   lrx.sh — Light Refraction Exchange
   Styles
   ============================================ */

:root {
    --deep-ground: #2a1f14;
    --bg-primary: #f5efe6;
    --bg-secondary: #e8dccb;
    --accent-warm: #c47a4a;
    --accent-cool: #5e8a7a;
    --text-primary: #3a2e22;
    --text-secondary: #7a6e5e;
    --highlight: #d4a45e;
    --bokeh-glow: #f0d89c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ---- Typography ---- */

.heading-display {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 7rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.body-text {
    margin-bottom: 1.2rem;
    max-width: 42ch;
}

.tech-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-top: 1rem;
}

.domain-mark {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cool);
    opacity: 0;
    animation: fadeIn 1.2s ease-out 1.5s forwards;
}

.domain-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeIn 1.2s ease-out 2.5s forwards;
    margin-top: 0.8rem;
}

/* ---- Aperture Ring (persistent reticle) ---- */

.aperture-ring {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(60vh, 60vw);
    height: min(60vh, 60vw);
    border-radius: 50%;
    border: 1px solid rgba(94, 138, 122, 0.4);
    pointer-events: none;
    z-index: 10;
    transition: border-color 0.8s ease;
}

.aperture-ring.on-dark {
    border-color: rgba(240, 216, 156, 0.2);
}

/* ---- Section Base ---- */

.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* ---- Aperture Section ---- */

.aperture-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: var(--bg-primary);
    z-index: 2;
}

.aperture-mask {
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    mask-image: radial-gradient(circle at center, transparent 0%, black 0%);
    -webkit-mask-image: radial-gradient(circle at center, transparent 0%, black 0%);
    z-index: 1;
    animation: apertureOpen 3s ease-in-out 0.2s forwards;
    pointer-events: none;
}

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

@keyframes apertureOpen {
    0% {
        mask-image: radial-gradient(circle at center, transparent 0px, black 0px);
        -webkit-mask-image: radial-gradient(circle at center, transparent 0px, black 0px);
    }
    100% {
        mask-image: radial-gradient(circle at center, transparent 200vmax, black 200vmax);
        -webkit-mask-image: radial-gradient(circle at center, transparent 200vmax, black 200vmax);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- Spectrum Sections ---- */

.spectrum-section {
    background: var(--bg-primary);
}

.spectrum-section:nth-child(even) {
    background: var(--bg-secondary);
}

.spectrum-dark {
    background: #d9c9b3;
}

.spectrum-darker {
    background: #c9b89f;
}

.section-inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2vw;
    min-height: 100vh;
    align-items: center;
    padding: 6vh 4vw;
    position: relative;
    z-index: 2;
    transition: filter 0.3s ease-out;
}

.text-block {
    grid-column: 2 / 7;
}

.text-block-center {
    grid-column: 1 / -1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.imagery-block {
    grid-column: 8 / 12;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.diagram {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* ---- SVG Draw Animation ---- */

.svg-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.svg-draw.drawn {
    stroke-dashoffset: 0;
}

/* ---- Watercolor Washes ---- */

.wash {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.wash::before,
.wash::after {
    content: '';
    position: absolute;
    border-radius: 48% 52% 62% 38% / 41% 59% 44% 56%;
    mix-blend-mode: multiply;
}

.wash-1::before {
    width: 120%;
    height: 80%;
    top: 10%;
    left: -10%;
    background: radial-gradient(ellipse at 30% 50%, rgba(196, 122, 74, 0.15) 0%, transparent 70%);
}

.wash-1::after {
    width: 80%;
    height: 60%;
    bottom: 5%;
    right: -5%;
    background: radial-gradient(ellipse at 70% 60%, rgba(240, 216, 156, 0.2) 0%, transparent 65%);
}

.wash-2::before {
    width: 100%;
    height: 90%;
    top: 5%;
    left: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(212, 164, 94, 0.18) 0%, transparent 60%);
}

.wash-2::after {
    width: 70%;
    height: 70%;
    bottom: 0;
    left: 15%;
    background: radial-gradient(ellipse at 40% 70%, rgba(94, 138, 122, 0.1) 0%, transparent 55%);
    border-radius: 52% 48% 38% 62% / 59% 41% 56% 44%;
}

.wash-3::before {
    width: 130%;
    height: 100%;
    top: 0;
    left: -15%;
    background: radial-gradient(ellipse at 50% 50%, rgba(196, 122, 74, 0.2) 0%, transparent 65%);
}

.wash-4::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: conic-gradient(from 45deg at 30% 60%, rgba(212, 164, 94, 0.15), transparent 40%, rgba(196, 122, 74, 0.1), transparent 80%);
    border-radius: 38% 62% 52% 48% / 56% 44% 59% 41%;
}

.wash-5::before {
    width: 110%;
    height: 100%;
    top: 0;
    left: -5%;
    background: radial-gradient(ellipse at 40% 50%, rgba(232, 220, 203, 0.5) 0%, transparent 60%);
}

.wash-6::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(ellipse at 60% 40%, rgba(196, 122, 74, 0.12) 0%, transparent 55%);
}

.wash-7::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(ellipse at 50% 60%, rgba(212, 164, 94, 0.15) 0%, transparent 50%);
}

.wash-8::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(240, 216, 156, 0.12) 0%, transparent 60%);
}

/* ---- Bokeh Circles ---- */

.bokeh {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.bokeh-1 {
    width: 200px;
    height: 200px;
    top: 20%;
    right: 15%;
    background: rgba(240, 216, 156, 0.12);
    box-shadow: 0 0 40px 20px rgba(240, 216, 156, 0.15);
}

.bokeh-2 {
    width: 120px;
    height: 120px;
    bottom: 25%;
    left: 10%;
    background: rgba(240, 216, 156, 0.08);
    box-shadow: 0 0 30px 15px rgba(240, 216, 156, 0.1);
}

.bokeh-3 {
    width: 280px;
    height: 280px;
    top: 10%;
    left: 60%;
    background: rgba(240, 216, 156, 0.1);
    box-shadow: 0 0 50px 25px rgba(240, 216, 156, 0.12);
}

.bokeh-4 {
    width: 100px;
    height: 100px;
    bottom: 30%;
    left: 20%;
    background: rgba(212, 164, 94, 0.08);
    box-shadow: 0 0 25px 12px rgba(212, 164, 94, 0.1);
}

.bokeh-5 {
    width: 240px;
    height: 240px;
    top: 30%;
    right: 10%;
    background: rgba(240, 216, 156, 0.1);
    box-shadow: 0 0 40px 20px rgba(240, 216, 156, 0.15);
}

/* ---- Refraction Sections ---- */

.refraction-section {
    background: var(--bg-secondary);
}

.refraction-outer {
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.refraction-inner {
    width: 100%;
    padding: 10vh 6vw;
    transition: filter 0.3s ease-out;
}

.rotate-neg {
    transform: rotate(-7deg) scale(1.1);
}

.rotate-pos {
    transform: rotate(7deg) scale(1.1);
}

.refraction-band {
    max-width: 55ch;
}

.refraction-band.text-heavy {
    margin-left: 8vw;
}

.refraction-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ---- Focus Point Section ---- */

.focus-section {
    background: var(--deep-ground);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.focus-content {
    text-align: center;
    max-width: 80vw;
    transition: filter 0.3s ease-out;
}

.focus-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--bg-primary);
}

/* ---- Dispersion Sections ---- */

.dispersion-section {
    background: var(--deep-ground);
    color: var(--bg-primary);
}

.dispersion-section .heading-display {
    color: var(--bg-primary);
}

.dispersion-section .body-text {
    color: rgba(245, 239, 230, 0.9);
}

.dispersion-far {
    margin-top: 8vh;
}

.dispersion-far .body-text {
    opacity: 0.85;
}

.dispersion-final {
    margin-top: 12vh;
    min-height: 60vh;
}

.dispersion-final .body-text {
    opacity: 0.8;
}

.domain-mark-final {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cool);
    margin-bottom: 0.5rem;
}

.faded {
    color: var(--text-secondary);
    font-style: italic;
}

/* ---- Blur Target (initial state) ---- */

.blur-target {
    filter: blur(12px);
    transition: filter 0.3s ease-out;
}

.blur-target-deep {
    filter: blur(20px);
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
    .blur-target,
    .blur-target-deep {
        filter: none !important;
    }

    .aperture-mask {
        animation: none;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .domain-mark,
    .domain-subtitle {
        opacity: 1;
        animation: none;
    }

    .svg-draw {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
    .text-block {
        grid-column: 1 / -1;
    }

    .imagery-block {
        grid-column: 1 / -1;
    }

    .section-inner {
        padding: 4vh 5vw;
    }

    .refraction-band.text-heavy {
        margin-left: 2vw;
    }

    .focus-heading {
        font-size: clamp(2rem, 6vw, 4rem);
    }
}
