/* lordly.dev - Surreal Dreamscape Design */

/* Custom property for animated border angle */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

:root {
    --color-deep-void: #0d0a2e;
    --color-mid-void: #1a1445;
    --color-lavender-mist: #e0dff4;
    --color-ice-blue: #4de8ff;
    --color-mint-glow: #7dffc7;
    --color-violet-crown: #b47dff;
    --color-hot-pink: #ff6eb4;
    --color-pale-sky: #c4f0ff;
    --color-white: #ffffff;

    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Nunito', sans-serif;
    --font-mono: 'Inconsolata', monospace;
}

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

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

body {
    background: var(--color-deep-void);
    color: var(--color-white);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* === BUBBLE FIELD (Global) === */
#bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid;
    border-image-source: linear-gradient(135deg, var(--color-ice-blue), var(--color-mint-glow), var(--color-violet-crown), var(--color-hot-pink));
    border-image-slice: 1;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent 60%);
    animation: float-up linear infinite;
    pointer-events: none;
}

.bubble::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(77, 232, 255, 0.04);
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-120vh) translateX(var(--drift-x, 30px)) scale(var(--end-scale, 0.8));
        opacity: 0;
    }
}

/* === STRATA (Sections) === */
.stratum {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.stratum-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.stratum-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    padding: 60px 24px;
}

/* === STRATUM 1: The Arrival === */
#stratum-1 {
    background: radial-gradient(ellipse at 50% 80%, var(--color-mid-void) 0%, var(--color-deep-void) 70%);
}

#stratum-1 .aurora-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(77, 232, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(180, 125, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(255, 110, 180, 0.05) 0%, transparent 50%);
    z-index: 1;
    pointer-events: none;
}

.crown-icon {
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInDown 1.5s ease-out 0.3s forwards;
}

.domain-title {
    font-family: var(--font-display);
    font-size: clamp(80px, 15vw, 160px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 0.92;
    color: var(--color-white);
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.6s forwards;
}

.domain-dot {
    color: var(--color-hot-pink);
}

.tagline {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: 300;
    color: var(--color-lavender-mist);
    margin-top: 20px;
    letter-spacing: 0.12em;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1s forwards;
}

.scroll-indicator {
    margin-top: 60px;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1.4s forwards;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--color-ice-blue), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === STRATUM 2: Sovereign Architecture === */
#stratum-2 {
    background: linear-gradient(180deg, var(--color-deep-void) 0%, #0f0c35 50%, var(--color-deep-void) 100%);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 0.92;
    color: var(--color-white);
    margin-bottom: 40px;
}

/* Aurora animated border box */
.aurora-border-box {
    position: relative;
    padding: 40px;
    max-width: 700px;
    background: rgba(13, 10, 46, 0.8);
    border-radius: 4px;
    margin-bottom: 50px;
}

.aurora-border-box::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    background: conic-gradient(from var(--border-angle), var(--color-ice-blue), var(--color-mint-glow), var(--color-violet-crown), var(--color-hot-pink), var(--color-ice-blue));
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
}

.aurora-border-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: rgba(13, 10, 46, 0.95);
    z-index: -1;
}

@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 300;
    line-height: 1.75;
    color: var(--color-lavender-mist);
}

.chess-piece-group {
    display: flex;
    gap: 50px;
    align-items: flex-end;
    margin-top: 10px;
}

.chess-piece {
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: floatGentle 6s ease-in-out infinite;
}

.chess-king { animation-delay: 0s; }
.chess-queen { animation-delay: -2s; }
.chess-bishop { animation-delay: -4s; }

.chess-piece:hover {
    opacity: 1;
    transform: translateY(-10px);
}

@keyframes floatGentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* === STRATUM 3: The Luminous Field === */
#stratum-3 {
    background: radial-gradient(ellipse at 50% 50%, #12103a 0%, var(--color-deep-void) 80%);
}

.bubble-cluster {
    position: relative;
    width: 500px;
    height: 300px;
    margin-bottom: 40px;
}

.static-bubble {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
    background-image: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.12), transparent 60%),
        linear-gradient(135deg, rgba(77, 232, 255, 0.04), rgba(180, 125, 255, 0.02));
    background-clip: padding-box;
    box-shadow: 
        inset 0 0 20px rgba(77, 232, 255, 0.05),
        0 0 15px rgba(180, 125, 255, 0.03);
    animation: bubblePulse 4s ease-in-out infinite;
}

.static-bubble::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-ice-blue), var(--color-mint-glow), var(--color-violet-crown), var(--color-hot-pink));
    z-index: -1;
    mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
}

.sb-1 { width: 120px; height: 120px; top: 20px; left: 30px; animation-delay: 0s; }
.sb-2 { width: 80px; height: 80px; top: 60px; left: 200px; animation-delay: -1s; }
.sb-3 { width: 160px; height: 160px; top: 80px; left: 320px; animation-delay: -2s; }
.sb-4 { width: 50px; height: 50px; top: 10px; left: 350px; animation-delay: -0.5s; }
.sb-5 { width: 90px; height: 90px; top: 180px; left: 100px; animation-delay: -3s; }
.sb-6 { width: 40px; height: 40px; top: 150px; left: 280px; animation-delay: -1.5s; }
.sb-7 { width: 70px; height: 70px; top: 200px; left: 400px; animation-delay: -2.5s; }

@keyframes bubblePulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.luminous-text {
    max-width: 600px;
}

.code-fragment {
    font-family: var(--font-mono);
    font-size: clamp(14px, 1.6vw, 18px);
    font-weight: 400;
    margin-top: 40px;
    padding: 20px 30px;
    background: rgba(26, 20, 69, 0.6);
    border-radius: 4px;
    border-left: 2px solid var(--color-violet-crown);
}

.code-keyword { color: var(--color-violet-crown); }
.code-var { color: var(--color-ice-blue); }
.code-fn { color: var(--color-mint-glow); }
.code-string { color: var(--color-hot-pink); }

/* === STRATUM 4: The Aurora Throne === */
#stratum-4 {
    background: linear-gradient(180deg, var(--color-deep-void) 0%, #0e0b30 50%, var(--color-deep-void) 100%);
}

.aurora-bands {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.aurora-band {
    position: absolute;
    width: 200%;
    height: 40%;
    left: -50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: auroraSway 12s ease-in-out infinite;
}

.band-1 {
    top: 10%;
    background: radial-gradient(ellipse, var(--color-ice-blue) 0%, transparent 70%);
    animation-delay: 0s;
}

.band-2 {
    top: 30%;
    background: radial-gradient(ellipse, var(--color-violet-crown) 0%, transparent 70%);
    animation-delay: -4s;
}

.band-3 {
    top: 55%;
    background: radial-gradient(ellipse, var(--color-hot-pink) 0%, transparent 70%);
    animation-delay: -8s;
}

@keyframes auroraSway {
    0%, 100% { transform: translateX(-10%) skewY(-2deg); }
    33% { transform: translateX(5%) skewY(1deg); }
    66% { transform: translateX(-5%) skewY(-1deg); }
}

.throne-box {
    margin-bottom: 60px;
}

.throne-symbol {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.throne-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid;
    animation: throneRotate linear infinite;
}

.ring-outer {
    width: 200px;
    height: 200px;
    border-color: var(--color-ice-blue);
    opacity: 0.4;
    animation-duration: 20s;
}

.ring-middle {
    width: 140px;
    height: 140px;
    border-color: var(--color-violet-crown);
    opacity: 0.5;
    animation-duration: 15s;
    animation-direction: reverse;
}

.ring-inner {
    width: 80px;
    height: 80px;
    border-color: var(--color-hot-pink);
    opacity: 0.6;
    animation-duration: 10s;
}

.throne-core {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-mint-glow), var(--color-ice-blue));
    box-shadow: 0 0 30px rgba(125, 255, 199, 0.4), 0 0 60px rgba(77, 232, 255, 0.2);
    animation: corePulse 3s ease-in-out infinite;
}

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

@keyframes corePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(125, 255, 199, 0.4), 0 0 60px rgba(77, 232, 255, 0.2); }
    50% { transform: scale(1.2); box-shadow: 0 0 50px rgba(125, 255, 199, 0.6), 0 0 100px rgba(77, 232, 255, 0.3); }
}

/* === STRATUM 5: Dissolution === */
#stratum-5 {
    background: radial-gradient(ellipse at 50% 60%, #100d38 0%, var(--color-deep-void) 80%);
}

.dissolution-text {
    max-width: 600px;
    margin-bottom: 60px;
}

.domain-echo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 60px;
}

.echo {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1;
}

.echo-1 {
    font-size: 60px;
    color: var(--color-white);
    opacity: 0.8;
}

.echo-2 {
    font-size: 48px;
    color: var(--color-lavender-mist);
    opacity: 0.5;
}

.echo-3 {
    font-size: 36px;
    color: var(--color-violet-crown);
    opacity: 0.35;
}

.echo-4 {
    font-size: 28px;
    color: var(--color-ice-blue);
    opacity: 0.2;
}

.echo-5 {
    font-size: 20px;
    color: var(--color-hot-pink);
    opacity: 0.1;
}

.final-crown {
    opacity: 0.5;
    animation: floatGentle 8s ease-in-out infinite;
}

/* === SCROLL REVEAL ANIMATIONS === */
.stratum-content > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.stratum-content.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

.stratum-content.revealed > *:nth-child(1) { transition-delay: 0s; }
.stratum-content.revealed > *:nth-child(2) { transition-delay: 0.15s; }
.stratum-content.revealed > *:nth-child(3) { transition-delay: 0.3s; }
.stratum-content.revealed > *:nth-child(4) { transition-delay: 0.45s; }
.stratum-content.revealed > *:nth-child(5) { transition-delay: 0.6s; }

/* Stratum 1 is always revealed */
#stratum-1 .stratum-content > * {
    opacity: 1;
    transform: translateY(0);
}

#stratum-1 .crown-icon {
    opacity: 0;
    animation: fadeInDown 1.5s ease-out 0.3s forwards;
}

#stratum-1 .domain-title {
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.6s forwards;
}

#stratum-1 .tagline {
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1s forwards;
}

#stratum-1 .scroll-indicator {
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1.4s forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .bubble-cluster {
        width: 300px;
        height: 200px;
    }
    
    .sb-1 { width: 70px; height: 70px; top: 10px; left: 10px; }
    .sb-2 { width: 50px; height: 50px; top: 40px; left: 120px; }
    .sb-3 { width: 100px; height: 100px; top: 50px; left: 180px; }
    .sb-4 { width: 35px; height: 35px; top: 5px; left: 200px; }
    .sb-5 { width: 60px; height: 60px; top: 120px; left: 60px; }
    .sb-6 { width: 30px; height: 30px; top: 100px; left: 160px; }
    .sb-7 { width: 45px; height: 45px; top: 130px; left: 240px; }

    .chess-piece-group {
        gap: 25px;
    }

    .chess-king svg { width: 40px; height: 68px; }
    .chess-queen svg { width: 34px; height: 57px; }
    .chess-bishop svg { width: 28px; height: 48px; }

    .throne-symbol {
        width: 140px;
        height: 140px;
    }

    .ring-outer { width: 140px; height: 140px; }
    .ring-middle { width: 100px; height: 100px; }
    .ring-inner { width: 60px; height: 60px; }

    .echo-1 { font-size: 40px; }
    .echo-2 { font-size: 32px; }
    .echo-3 { font-size: 24px; }
    .echo-4 { font-size: 18px; }
    .echo-5 { font-size: 14px; }

    .aurora-border-box {
        padding: 24px;
    }
}
