/* loves.quest — Swiss Punk Gradient Abstractions */
/* Colors: #f4f1de, #1a1a2e, #0d0d0d, #e63946, #e76f51, #00b4d8 */
/* Fonts: Space Grotesk, Inter, JetBrains Mono */

:root {
    --cream: #f4f1de;
    --dark-blue: #1a1a2e;
    --black: #0d0d0d;
    --red: #e63946;
    --coral: #e76f51;
    --cyan: #00b4d8;
}

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

html {
    font-size: 16px;
    scroll-behavior: auto;
}

body {
    background: var(--black);
    color: var(--cream);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ============================================
   PARALLAX CONTAINER
   ============================================ */

#parallax-container {
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 1px;
    transform-style: preserve-3d;
    scroll-snap-type: y mandatory;
}

/* ============================================
   PANELS (Sections)
   ============================================ */

.panel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    scroll-snap-align: start;
    transform-style: preserve-3d;
}

.panel-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: translateZ(-2px) scale(3);
    transform-style: preserve-3d;
}

.panel-fg {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    transform: translateZ(0);
}

/* ============================================
   GRID OVERLAYS
   ============================================ */

.grid-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--cream) 1px, transparent 1px),
        linear-gradient(to bottom, var(--cream) 1px, transparent 1px);
    background-size: 60px 60px;
    transition: opacity 0.6s ease;
}

.grid-overlay--call {
    opacity: 0.08;
    background-image:
        linear-gradient(to right, var(--red) 1px, transparent 1px),
        linear-gradient(to bottom, var(--red) 1px, transparent 1px);
    background-size: 80px 80px;
}

.grid-overlay--grid {
    opacity: 0.25;
    background-image:
        linear-gradient(to right, var(--cyan) 1px, transparent 1px),
        linear-gradient(to bottom, var(--cyan) 1px, transparent 1px);
    background-size: 40px 40px;
}

.grid-overlay--pulse {
    opacity: 0.1;
    background-image:
        linear-gradient(to right, var(--coral) 1px, transparent 1px),
        linear-gradient(to bottom, var(--coral) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-breathe 3s ease-in-out infinite;
}

.grid-overlay--fracture {
    opacity: 0.2;
    background-image:
        linear-gradient(45deg, var(--red) 1px, transparent 1px),
        linear-gradient(-45deg, var(--red) 1px, transparent 1px);
    background-size: 30px 30px;
}

.grid-overlay--resolve {
    opacity: 0.12;
    background-image:
        linear-gradient(to right, var(--cream) 1px, transparent 1px),
        linear-gradient(to bottom, var(--cream) 1px, transparent 1px);
    background-size: 100px 100px;
}

@keyframes grid-breathe {
    0%, 100% { opacity: 0.05; }
    50% { opacity: 0.2; }
}

/* ============================================
   GRADIENT LAYERS
   ============================================ */

.gradient-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gradient-layer--call {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(230, 57, 70, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, var(--black) 0%, var(--dark-blue) 100%);
}

.gradient-layer--grid {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(0, 180, 216, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, var(--dark-blue) 0%, var(--black) 50%, var(--dark-blue) 100%);
}

.gradient-layer--pulse {
    background:
        radial-gradient(circle at 50% 50%, rgba(231, 111, 81, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(230, 57, 70, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(0, 180, 216, 0.15) 0%, transparent 40%),
        linear-gradient(180deg, var(--black) 0%, #1a0a0e 50%, var(--black) 100%);
}

.gradient-layer--fracture {
    background:
        linear-gradient(45deg, rgba(230, 57, 70, 0.4) 0%, transparent 30%),
        linear-gradient(225deg, rgba(0, 180, 216, 0.3) 0%, transparent 30%),
        linear-gradient(135deg, var(--black) 0%, var(--dark-blue) 50%, var(--black) 100%);
}

.gradient-layer--resolve {
    background:
        radial-gradient(circle at 50% 50%, rgba(244, 241, 222, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 70%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, var(--dark-blue) 0%, var(--black) 100%);
}

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

.domain-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 12vw, 200px);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 0.9;
    position: relative;
}

.domain-word {
    color: var(--cream);
    display: inline-block;
}

.domain-dot {
    color: var(--red);
    display: inline-block;
}

.domain-tld {
    color: var(--cyan);
    display: inline-block;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 8vw, 120px);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--cream);
}

.section-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 1.8vw, 20px);
    line-height: 1.7;
    max-width: 600px;
    color: rgba(244, 241, 222, 0.8);
    margin-bottom: 2rem;
}

.mono-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(10px, 1.2vw, 14px);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--cyan);
    text-transform: uppercase;
}

.section-label {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    color: rgba(0, 180, 216, 0.4);
}

.subtitle-line {
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 1.5s forwards;
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 2.5s forwards;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--red);
    border-bottom: 2px solid var(--red);
    transform: rotate(45deg);
    animation: bounce-arrow 2s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

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

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

.section-wipe {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 80px;
    z-index: 10;
    pointer-events: none;
}

.wipe-diagonal {
    background: linear-gradient(
        to bottom right,
        transparent 0%,
        transparent 40%,
        var(--black) 40%,
        var(--black) 100%
    );
    transform: translateX(-25%);
}

.wipe-reverse {
    background: linear-gradient(
        to bottom left,
        transparent 0%,
        transparent 40%,
        var(--black) 40%,
        var(--black) 100%
    );
    transform: translateX(-25%);
}

/* ============================================
   GRID VISUALIZATION (Section 1)
   ============================================ */

.grid-visualization {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: clamp(150px, 30vw, 300px);
    margin: 1rem auto 2rem;
}

.grid-node {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--cyan);
    background: transparent;
    position: relative;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-node.active {
    opacity: 1;
    transform: scale(1);
    background: rgba(0, 180, 216, 0.1);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.2);
}

.grid-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.grid-node.active::after {
    opacity: 1;
}

/* ============================================
   BOKEH LAYER (Section 2)
   ============================================ */

.bokeh-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    animation: bokeh-float 8s ease-in-out infinite;
}

.bokeh-1 {
    width: 200px; height: 200px;
    background: var(--red);
    top: 20%; left: 10%;
    animation-delay: 0s;
}

.bokeh-2 {
    width: 150px; height: 150px;
    background: var(--cyan);
    top: 60%; right: 15%;
    animation-delay: -2s;
}

.bokeh-3 {
    width: 250px; height: 250px;
    background: var(--coral);
    top: 40%; left: 50%;
    animation-delay: -4s;
}

.bokeh-4 {
    width: 100px; height: 100px;
    background: var(--red);
    bottom: 20%; left: 30%;
    animation-delay: -1s;
}

.bokeh-5 {
    width: 180px; height: 180px;
    background: var(--cyan);
    top: 10%; right: 30%;
    animation-delay: -6s;
}

@keyframes bokeh-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
    75% { transform: translate(20px, 20px) scale(1.05); }
}

/* ============================================
   PULSE RINGS (Section 2)
   ============================================ */

.pulse-ring-container {
    position: relative;
    width: clamp(120px, 20vw, 250px);
    height: clamp(120px, 20vw, 250px);
    margin: 1rem auto 2rem;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border: 1px solid var(--coral);
    border-radius: 50%;
    animation: pulse-expand 3s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.pulse-ring-1 { animation-delay: 0s; }
.pulse-ring-2 { animation-delay: 1s; }
.pulse-ring-3 { animation-delay: 2s; }

@keyframes pulse-expand {
    0% {
        transform: scale(0.3);
        opacity: 1;
        border-color: var(--red);
    }
    100% {
        transform: scale(2);
        opacity: 0;
        border-color: var(--coral);
    }
}

/* ============================================
   FRACTURE SHARDS (Section 3)
   ============================================ */

.fracture-shards {
    position: relative;
    width: clamp(200px, 40vw, 400px);
    height: clamp(150px, 25vw, 300px);
    margin: 1rem auto 2rem;
}

.shard {
    position: absolute;
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.3), rgba(0, 180, 216, 0.1));
    border: 1px solid rgba(230, 57, 70, 0.4);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.shard-1 {
    width: 60px; height: 80px;
    top: 20%; left: 10%;
    clip-path: polygon(20% 0%, 100% 10%, 80% 100%, 0% 80%);
}

.shard-2 {
    width: 80px; height: 60px;
    top: 10%; left: 35%;
    clip-path: polygon(0% 20%, 100% 0%, 90% 100%, 10% 80%);
}

.shard-3 {
    width: 50px; height: 90px;
    top: 30%; right: 20%;
    clip-path: polygon(50% 0%, 100% 30%, 80% 100%, 0% 70%);
}

.shard-4 {
    width: 70px; height: 50px;
    bottom: 20%; left: 20%;
    clip-path: polygon(10% 0%, 90% 20%, 100% 100%, 0% 80%);
}

.shard-5 {
    width: 90px; height: 70px;
    bottom: 10%; left: 50%;
    clip-path: polygon(0% 10%, 100% 0%, 80% 100%, 20% 90%);
}

.shard-6 {
    width: 40px; height: 60px;
    top: 50%; left: 5%;
    clip-path: polygon(30% 0%, 100% 20%, 70% 100%, 0% 80%);
}

.shard-7 {
    width: 55px; height: 45px;
    top: 5%; right: 10%;
    clip-path: polygon(0% 0%, 100% 30%, 90% 100%, 10% 70%);
}

.shard.shattered {
    opacity: 0.6;
}

.section-title--glitch {
    position: relative;
}

.section-title--glitch::before,
.section-title--glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.section-title--glitch::before {
    color: var(--red);
    clip-path: inset(0 0 60% 0);
    transform: translate(-3px, -2px);
    opacity: 0.7;
    animation: glitch-top 3s ease-in-out infinite;
}

.section-title--glitch::after {
    color: var(--cyan);
    clip-path: inset(60% 0 0 0);
    transform: translate(3px, 2px);
    opacity: 0.7;
    animation: glitch-bottom 3s ease-in-out infinite;
}

@keyframes glitch-top {
    0%, 90%, 100% { transform: translate(-3px, -2px); }
    92% { transform: translate(5px, -1px); }
    94% { transform: translate(-8px, 3px); }
    96% { transform: translate(2px, -4px); }
    98% { transform: translate(-3px, 1px); }
}

@keyframes glitch-bottom {
    0%, 90%, 100% { transform: translate(3px, 2px); }
    91% { transform: translate(-4px, 3px); }
    93% { transform: translate(6px, -2px); }
    95% { transform: translate(-2px, 4px); }
    97% { transform: translate(4px, -1px); }
}

/* ============================================
   RESOLVE SIGIL (Section 4)
   ============================================ */

.resolve-sigil {
    width: clamp(120px, 20vw, 200px);
    height: clamp(120px, 20vw, 200px);
    margin: 2rem auto;
}

.sigil-svg {
    width: 100%;
    height: 100%;
}

.sigil-ring {
    transform-origin: center;
}

.sigil-ring-outer {
    animation: sigil-rotate 20s linear infinite;
}

.sigil-ring-mid {
    animation: sigil-rotate 15s linear infinite reverse;
}

.sigil-ring-inner {
    animation: sigil-rotate 10s linear infinite;
}

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

.sigil-cross {
    opacity: 0.4;
}

.final-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 5vw, 60px);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-top: 1rem;
    opacity: 0.6;
}

.section-text--final {
    font-style: italic;
    color: rgba(244, 241, 222, 0.9);
}

/* ============================================
   PERSISTENT GRID
   ============================================ */

.persistent-grid {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.03;
    background-image:
        linear-gradient(to right, var(--cream) 1px, transparent 1px),
        linear-gradient(to bottom, var(--cream) 1px, transparent 1px);
    background-size: 60px 60px;
    mix-blend-mode: overlay;
    transition: opacity 0.5s ease;
}

/* ============================================
   PROGRESS TRACK
   ============================================ */

.progress-track {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border: 1px solid var(--cream);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.progress-dot.active {
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
    transform: scale(1.3);
}

.progress-dot:hover {
    border-color: var(--cyan);
    background: rgba(0, 180, 216, 0.3);
}

/* ============================================
   SECTION REVEAL ANIMATIONS
   ============================================ */

.panel-fg .section-title,
.panel-fg .section-text,
.panel-fg .grid-visualization,
.panel-fg .pulse-ring-container,
.panel-fg .fracture-shards,
.panel-fg .resolve-sigil,
.panel-fg .final-domain {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel.in-view .section-title {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.panel.in-view .section-text {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.panel.in-view .grid-visualization,
.panel.in-view .pulse-ring-container,
.panel.in-view .fracture-shards,
.panel.in-view .resolve-sigil {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.panel.in-view .final-domain {
    opacity: 0.6;
    transform: translateY(0);
    transition-delay: 0.7s;
}

/* Section 0 always visible initially */
.panel-0 .domain-title {
    opacity: 0;
    animation: titleReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ============================================
   SECTION-SPECIFIC BACKGROUND COLORS
   ============================================ */

.panel-0 { background: var(--black); }
.panel-1 { background: var(--dark-blue); }
.panel-2 { background: var(--black); }
.panel-3 { background: #120a0d; }
.panel-4 { background: var(--dark-blue); }

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

@media (max-width: 768px) {
    .section-text {
        max-width: 90%;
    }

    .progress-track {
        right: 0.75rem;
    }

    .section-label {
        bottom: 1rem;
        left: 1rem;
        font-size: 10px;
    }

    .grid-visualization {
        gap: 10px;
    }

    .fracture-shards {
        transform: scale(0.8);
    }
}
