/* persona.quest - Ocean Deep Identity Experience */
/* Design: Ma-negative-space layout, retro-futuristic deep-sea */

:root {
    --hadal-black: #0a1520;
    --bathyal-ink: #112233;
    --abyssal-pearl: #d4dce6;
    --phosphor-bone: #e8eff6;
    --brass-patina: #b8935a;
    --biolume-teal: #2dd4a8;
    --deep-mauve: #4a3560;
    --near-black: #070d14;
    --twilight-bg: #0d1a28;
    --teal-wash: #0d3b3b;
    --brass-dark: #2a1f12;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bathyal-ink);
    color: var(--abyssal-pearl);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =============== SECTIONS =============== */

.quest-section {
    position: relative;
    min-height: 100vh;
    padding: 8vh 6vw;
    overflow: hidden;
}

#section-surface {
    background-color: var(--bathyal-ink);
}

#section-twilight {
    background-color: var(--twilight-bg);
}

#section-midnight {
    background-color: var(--hadal-black);
}

#section-abyssal {
    background-color: var(--hadal-black);
}

#section-hadal {
    background-color: var(--near-black);
}

/* =============== SECTION GRID =============== */

.section-grid {
    display: grid;
    grid-template: repeat(12, 1fr) / repeat(12, 1fr);
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 16vh);
    position: relative;
    z-index: 1;
}

.content-island {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

/* =============== TYPOGRAPHY =============== */

.monumental-title {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(3.5rem, 9vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--phosphor-bone);
    line-height: 1;
}

#section-surface .monumental-title {
    font-size: clamp(5rem, 12vw, 9rem);
}

.dissolving-text {
    opacity: 0.6;
}

.glowing-text {
    text-shadow: 0 0 40px rgba(45, 212, 168, 0.3), 0 0 80px rgba(45, 212, 168, 0.15);
}

.section-heading {
    font-family: "Bebas Neue", Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--phosphor-bone);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.whisper-text {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--abyssal-pearl);
    opacity: 0.8;
    line-height: 1.6;
}

.body-text {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: var(--abyssal-pearl);
    line-height: 1.85;
    letter-spacing: 0.02em;
    margin-bottom: 1.2rem;
}

.pull-quote {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--phosphor-bone);
    line-height: 1.5;
    border: none;
    padding: 0;
    margin: 0;
    opacity: 0.85;
}

/* =============== BLOB CONTAINERS =============== */

.blob-container {
    background: rgba(10, 21, 32, 0.4);
    border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%;
    padding: 3rem;
    animation: blobMorph 12s ease-in-out infinite;
    box-shadow: 0 0 60px rgba(45, 212, 168, 0.08);
}

@keyframes blobMorph {
    0%   { border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%; }
    50%  { border-radius: 55% 45% 35% 65% / 40% 60% 35% 65%; }
    100% { border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%; }
}

/* =============== WATERCOLOR WASHES =============== */

.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Section 1: Surface - mauve bloom from upper-right */
.wash-1a {
    width: 60vw;
    height: 60vh;
    top: -10%;
    right: -10%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.35) 0%, transparent 70%);
    filter: blur(80px);
    mix-blend-mode: multiply;
}

.wash-1b {
    width: 40vw;
    height: 40vh;
    top: 5%;
    right: 5%;
    background: radial-gradient(ellipse at center, rgba(17, 34, 51, 0.5) 0%, transparent 70%);
    filter: blur(60px);
    mix-blend-mode: screen;
}

.wash-1c {
    width: 50vw;
    height: 50vh;
    bottom: -15%;
    left: -10%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.2) 0%, transparent 70%);
    filter: blur(100px);
}

/* Section 2: Twilight - teal seeping upward */
.wash-2a {
    width: 70vw;
    height: 50vh;
    bottom: -15%;
    left: 15%;
    background: radial-gradient(ellipse at center, rgba(13, 59, 59, 0.4) 0%, transparent 70%);
    filter: blur(80px);
    mix-blend-mode: multiply;
}

.wash-2b {
    width: 45vw;
    height: 45vh;
    bottom: 0;
    right: 0;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.2) 0%, transparent 70%);
    filter: blur(90px);
}

.wash-2c {
    width: 35vw;
    height: 35vh;
    top: 10%;
    left: -5%;
    background: radial-gradient(ellipse at center, rgba(13, 59, 59, 0.25) 0%, transparent 70%);
    filter: blur(70px);
}

/* Section 3: Midnight - brass-gold from center */
.wash-3a {
    width: 50vw;
    height: 50vh;
    top: 25%;
    left: 25%;
    background: radial-gradient(ellipse at center, rgba(42, 31, 18, 0.4) 0%, transparent 70%);
    filter: blur(80px);
    mix-blend-mode: multiply;
}

.wash-3b {
    width: 40vw;
    height: 40vh;
    top: 30%;
    left: 30%;
    background: radial-gradient(ellipse at center, rgba(42, 31, 18, 0.25) 0%, transparent 60%);
    filter: blur(60px);
}

.wash-3c {
    width: 60vw;
    height: 45vh;
    bottom: -10%;
    right: -10%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.15) 0%, transparent 70%);
    filter: blur(100px);
}

/* Section 4: Abyssal - deep mauve and teal overlapping */
.wash-4a {
    width: 55vw;
    height: 55vh;
    top: 10%;
    left: -5%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.45) 0%, transparent 70%);
    filter: blur(80px);
    mix-blend-mode: multiply;
}

.wash-4b {
    width: 50vw;
    height: 50vh;
    bottom: 5%;
    right: 10%;
    background: radial-gradient(ellipse at center, rgba(13, 59, 59, 0.4) 0%, transparent 70%);
    filter: blur(80px);
    mix-blend-mode: multiply;
}

.wash-4c {
    width: 40vw;
    height: 40vh;
    top: 30%;
    right: 20%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.3) 0%, transparent 60%);
    filter: blur(70px);
}

.wash-4d {
    width: 35vw;
    height: 35vh;
    bottom: 10%;
    left: 20%;
    background: radial-gradient(ellipse at center, rgba(13, 59, 59, 0.25) 0%, transparent 65%);
    filter: blur(90px);
}

/* Section 5: Hadal - near black with subtle wash */
.wash-5a {
    width: 60vw;
    height: 60vh;
    top: 20%;
    left: 20%;
    background: radial-gradient(ellipse at center, rgba(74, 53, 96, 0.15) 0%, transparent 70%);
    filter: blur(100px);
}

.wash-5b {
    width: 45vw;
    height: 45vh;
    bottom: 10%;
    right: 15%;
    background: radial-gradient(ellipse at center, rgba(13, 59, 59, 0.12) 0%, transparent 65%);
    filter: blur(80px);
}

/* =============== MASK SVGS =============== */

.mask-svg {
    width: 100%;
    max-width: 250px;
    height: auto;
    opacity: 0.4;
    transition: opacity 0.8s ease;
}

.venetian-mask {
    max-width: 280px;
    opacity: 0.4;
}

.noh-mask {
    max-width: 200px;
    opacity: 0.5;
}

.wireframe-mask {
    max-width: 220px;
    opacity: 0.45;
}

.crack-mask {
    max-width: 260px;
    opacity: 0.5;
}

.dissolving-mask {
    max-width: 100%;
    width: 100%;
    height: 100%;
    opacity: 1;
}

.dissolving-face-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============== BRASS CIRCLES =============== */

.brass-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--brass-patina);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* =============== DEPTH PARTICLES =============== */

#depth-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.depth-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--biolume-teal);
    animation: particleFall linear infinite, particleGlow ease-in-out infinite alternate;
}

@keyframes particleFall {
    0% {
        transform: translateY(-10px) translateX(0);
    }
    100% {
        transform: translateY(calc(100vh + 10px)) translateX(var(--drift, 20px));
    }
}

@keyframes particleGlow {
    0% { opacity: 0.2; }
    100% { opacity: 0.7; }
}

/* =============== PRESSURE LINES =============== */

#pressure-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 500vh;
    pointer-events: none;
    z-index: 0;
}

.pressure-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    border-top: 0.5px solid rgba(184, 147, 90, 0.15);
}

/* =============== FADE REVEAL =============== */

.fade-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* =============== COMPASS NAVIGATION =============== */

#compass-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

#compass-toggle {
    width: 48px;
    height: 48px;
    background: rgba(10, 21, 32, 0.8);
    border: 1px solid var(--brass-patina);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: compassPulse 3s ease-in-out infinite;
}

#compass-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(184, 147, 90, 0.3);
}

#compass-toggle svg {
    width: 100%;
    height: 100%;
}

@keyframes compassPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(184, 147, 90, 0.1); }
    50% { box-shadow: 0 0 20px rgba(184, 147, 90, 0.25); }
}

#compass-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 220px;
    height: 220px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.compass-menu-hidden {
    opacity: 0;
    transform: scale(0.3);
    pointer-events: none;
}

.compass-menu-visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.compass-link {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transform: rotate(var(--angle)) translateY(-90px) rotate(calc(-1 * var(--angle)));
    transition: transform 0.3s ease;
}

.compass-label {
    font-family: "Space Grotesk", monospace;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--brass-patina);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.compass-link:hover .compass-label {
    color: var(--biolume-teal);
}

/* =============== SECTION TRANSITIONS =============== */

.quest-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to bottom, transparent, rgba(10, 21, 32, 0.5));
    pointer-events: none;
    z-index: 0;
}

.quest-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(to top, transparent, rgba(10, 21, 32, 0.3));
    pointer-events: none;
    z-index: 0;
}

#section-surface::before {
    display: none;
}

/* =============== WIREFRAME ANIMATION =============== */

.wireframe-mask ellipse,
.wireframe-mask line,
.wireframe-mask path {
    transition: all 0.5s ease;
}

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

.wireframe-mask.drifting ellipse:first-of-type {
    animation: wireframeDrift 20s ease-in-out infinite;
}

.wireframe-mask.drifting ellipse:nth-of-type(2) {
    animation: wireframeDrift 18s ease-in-out infinite reverse;
}

.wireframe-mask.drifting ellipse:nth-of-type(3) {
    animation: wireframeDrift 22s ease-in-out infinite;
    animation-delay: -5s;
}

/* =============== RESPONSIVE =============== */

@media (max-width: 768px) {
    .quest-section {
        padding: 4vh 4vw;
    }

    .section-grid {
        min-height: calc(100vh - 8vh);
    }

    .monumental-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    #section-surface .monumental-title {
        font-size: clamp(3.5rem, 15vw, 6rem);
    }

    .content-island {
        padding: 1rem;
    }

    .blob-container {
        padding: 2rem;
    }

    .mask-svg {
        max-width: 150px;
    }

    #compass-menu {
        width: 180px;
        height: 180px;
    }

    .compass-link {
        transform: rotate(var(--angle)) translateY(-70px) rotate(calc(-1 * var(--angle)));
    }
}