/* ===================================================
   mystical.day — Surreal Jewel-Toned Portal
   Layered depth, magnetic interactions, watercolor textures
   =================================================== */

@charset "UTF-8";

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

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

body {
    background: #140C1E;
    color: #B0A0C0;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    cursor: none;
}

::selection {
    background: rgba(128, 192, 160, 0.3);
    color: #E0D0F0;
}

/* --- Custom Cursor --- */
.cursor-field {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 192, 160, 0.06) 0%, rgba(128, 192, 160, 0.02) 40%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
    opacity: 0;
    mix-blend-mode: screen;
}

body:hover .cursor-field {
    opacity: 1;
}

/* --- Depth Layers --- */
.depth-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.depth-bg {
    z-index: 0;
}

.depth-content {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.depth-float {
    z-index: 2;
}

/* --- Watercolor Washes --- */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0;
    animation: washFadeIn 4s ease forwards;
}

.wash-ruby {
    width: 55vw;
    height: 55vw;
    top: -10%;
    right: -15%;
    background: radial-gradient(ellipse, rgba(180, 60, 80, 0.15), transparent 70%);
    animation-delay: 0.5s;
}

.wash-emerald {
    width: 45vw;
    height: 45vw;
    bottom: 10%;
    left: -10%;
    background: radial-gradient(ellipse, rgba(60, 160, 120, 0.12), transparent 70%);
    animation-delay: 1.2s;
}

.wash-amethyst {
    width: 50vw;
    height: 50vw;
    top: 40%;
    right: 20%;
    background: radial-gradient(ellipse, rgba(100, 60, 160, 0.1), transparent 70%);
    animation-delay: 1.8s;
}

@keyframes washFadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- Glyph Field --- */
.glyph-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
}

/* --- Portal Opening (First 100vh) --- */
.portal-opening {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 12vw;
    overflow: hidden;
}

.portal-title-group {
    opacity: 0;
    animation: portalReveal 2.5s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

@keyframes portalReveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.portal-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 9vw, 8rem);
    color: #E0D0F0;
    letter-spacing: 0.04em;
    line-height: 0.95;
    margin-bottom: 0.3em;
}

.title-dot {
    color: #80C0A0;
}

.portal-subtitle-line {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: 0.5em;
}

.portal-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.4vw, 1.15rem);
    color: #B0A0C0;
    letter-spacing: 0.12em;
    text-transform: lowercase;
}

.subtitle-glyph {
    color: #D0A860;
    font-size: 0.6em;
    opacity: 0.6;
}

.portal-depth-indicator {
    position: absolute;
    bottom: 4vh;
    left: 12vw;
    display: flex;
    align-items: center;
    gap: 1em;
    opacity: 0;
    animation: fadeInUp 1.5s ease 3s forwards;
}

.depth-bar {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #80C0A0, transparent);
}

.depth-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #80C0A0;
    letter-spacing: 0.15em;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Mystical Label (reusable) --- */
.mystical-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: #80C0A0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-block;
}

.vertical-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* --- Section Heading --- */
.section-heading {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: #E0D0F0;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

/* --- Manifesto Section --- */
.manifesto-section {
    position: relative;
    padding: 15vh 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.manifesto-layout {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    gap: 3vw;
    width: 75%;
    margin-left: 18vw;
    align-items: start;
}

.manifesto-left-margin {
    padding-top: 2rem;
    display: flex;
    justify-content: center;
}

.manifesto-body {
    max-width: 600px;
}

.manifesto-lead {
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    color: #E0D0F0;
    line-height: 1.4;
    margin-bottom: 1.8em;
}

.manifesto-text {
    color: #B0A0C0;
    font-weight: 300;
    line-height: 1.95;
}

.manifesto-right-accent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}

.accent-line-vertical {
    width: 1px;
    height: 120px;
    background: linear-gradient(180deg, #D0A860, transparent);
    opacity: 0.4;
}

/* --- Depth Cards Section --- */
.depth-cards-section {
    position: relative;
    padding: 12vh 0 18vh;
    min-height: 100vh;
}

.cards-heading-area {
    padding-left: 8vw;
    margin-bottom: 8vh;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cards-field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5vw;
    padding: 0 8vw 0 15vw;
    max-width: 1400px;
}

.depth-card {
    background: rgba(26, 16, 48, 0.92);
    border: 1px solid rgba(128, 192, 160, 0.08);
    padding: 2.8rem 2.4rem;
    position: relative;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Sapphire Deep base: #1A1030 */

.depth-card:hover {
    border-color: rgba(128, 192, 160, 0.2);
    box-shadow: 0 0 60px rgba(128, 192, 160, 0.04);
}

.card-offset-1 {
    margin-top: 0;
}

.card-offset-2 {
    margin-top: 8vh;
}

.card-offset-3 {
    margin-top: -4vh;
}

.card-offset-4 {
    margin-top: 4vh;
}

.card-index {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #D0A860;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.card-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: #E0D0F0;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

.card-body {
    color: #B0A0C0;
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.card-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #80C0A0;
    letter-spacing: 0.2em;
    opacity: 0.6;
}

/* --- Apparatus Section --- */
.apparatus-section {
    position: relative;
    padding: 15vh 0 20vh;
    min-height: 90vh;
}

.apparatus-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 6vw;
    padding: 0 8vw;
    align-items: center;
}

.apparatus-panel-left {
    background: #1A1030;
    border: 1px solid rgba(128, 192, 160, 0.08);
    padding: 2.5rem 2.2rem;
}

.apparatus-readout {
    margin-top: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.readout-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(128, 192, 160, 0.05);
}

.readout-key {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    color: #B0A0C0;
    letter-spacing: 0.12em;
    opacity: 0.7;
}

.readout-val {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: #80C0A0;
    letter-spacing: 0.08em;
}

.apparatus-wave {
    margin-top: 1.5rem;
    height: 80px;
    overflow: hidden;
}

.apparatus-wave svg {
    width: 100%;
    height: 100%;
}

.apparatus-text-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.apparatus-desc {
    color: #B0A0C0;
    font-weight: 300;
    max-width: 500px;
    line-height: 1.9;
}

/* --- Codex Section --- */
.codex-section {
    position: relative;
    padding: 18vh 0 15vh;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codex-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    max-width: 600px;
}

.codex-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #E0D0F0;
    letter-spacing: 0.03em;
    line-height: 1.05;
}

.codex-text {
    color: #B0A0C0;
    font-weight: 300;
    line-height: 1.95;
    max-width: 480px;
}

.codex-sigil {
    margin: 2rem 0;
    opacity: 0.7;
}

.sigil-svg {
    width: 120px;
    height: 120px;
    animation: sigilRotate 60s linear infinite;
}

@keyframes sigilRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.codex-domain {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #D0A860;
    letter-spacing: 0.25em;
    opacity: 0.5;
}

/* --- Floating Elements (Z-2) --- */
.floating-glyph {
    position: fixed;
    font-family: 'Space Mono', monospace;
    color: #80C0A0;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* --- Scroll Reveal --- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
    .portal-opening {
        padding-left: 8vw;
    }

    .manifesto-layout {
        grid-template-columns: 1fr;
        margin-left: 8vw;
        width: 84%;
        gap: 2rem;
    }

    .manifesto-left-margin {
        display: none;
    }

    .manifesto-right-accent {
        flex-direction: row;
        padding-top: 0;
    }

    .accent-line-vertical {
        width: 60px;
        height: 1px;
        background: linear-gradient(90deg, #D0A860, transparent);
    }

    .cards-field {
        grid-template-columns: 1fr;
        padding: 0 8vw;
    }

    .card-offset-1,
    .card-offset-2,
    .card-offset-3,
    .card-offset-4 {
        margin-top: 0;
    }

    .apparatus-layout {
        grid-template-columns: 1fr;
        gap: 4vh;
    }

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

@media (max-width: 600px) {
    .portal-opening {
        padding-left: 6vw;
    }

    .manifesto-layout {
        margin-left: 6vw;
        width: 88%;
    }

    .cards-field {
        padding: 0 6vw;
    }

    .apparatus-layout {
        padding: 0 6vw;
    }
}
