/* lrx.st - Neon-Electric Cottagecore on Horizontal Scroll */

:root {
    --bg-primary: #0B0B1A;
    --bg-secondary: #141428;
    --bg-porch: #0B0B1A;
    --bg-kitchen: #0D0B1A;
    --bg-garden: #0B0D1A;
    --bg-library: #0F0D1A;
    --bg-workshop: #0B0B1F;
    --bg-roof: #0D0D22;

    --neon-cyan: #00F5D4;
    --neon-magenta: #FF006E;
    --neon-lime: #B8FF00;
    --neon-amber: #FFB800;
    --stroke-lavender: #A0A0C8;
    --text-primary: #F0F0F0;
    --text-secondary: #8888AA;
    --text-mid: #D0D0D0;
    --text-soft: #E0E0E0;

    --font-display: "Bebas Neue", "Space Grotesk", "Inter", sans-serif;
    --font-body: "Quicksand", "Inter", system-ui, sans-serif;
}

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

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    /* subtle grain via gradient overlay */
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 245, 212, 0.04), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 110, 0.04), transparent 50%);
}

/* === Cottage Walk - horizontal scroll container === */

.cottage-walk {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100vw;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cottage-walk::-webkit-scrollbar { display: none; }

/* === Rooms === */

.room {
    position: relative;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background: var(--room-bg);
    overflow: hidden;
    transition: background 800ms ease;
}

.room--wide {
    flex: 0 0 200vw;
    width: 200vw;
    min-width: 200vw;
}

.room__scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.scene-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scene-svg .hover-target {
    pointer-events: auto;
    cursor: pointer;
    transition: transform 400ms ease, filter 400ms ease;
    transform-box: fill-box;
    transform-origin: center;
}

.scene-svg .hover-target:hover {
    filter: drop-shadow(0 0 12px var(--room-accent));
}

/* === Title typography === */

.room__title-wrap {
    position: absolute;
    z-index: 4;
    top: 14%;
    left: 8%;
    pointer-events: none;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.room__title-wrap--right {
    left: auto;
    right: 8%;
    text-align: right;
}

.room__title-wrap--garden {
    left: 50%;
    transform: translate(-50%, 24px);
    text-align: center;
}

.room.is-active .room__title-wrap {
    opacity: 1;
    transform: translateY(0);
}
.room.is-active .room__title-wrap--garden {
    transform: translate(-50%, 0);
}

.room__display {
    font-family: var(--font-display);
    font-size: clamp(80px, 13vw, 180px);
    line-height: 0.92;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--room-accent);
    text-shadow:
        0 0 0 var(--room-accent),
        0 0 18px color-mix(in srgb, var(--room-accent) 50%, transparent);
    transition: text-shadow 600ms ease;
}

.room.is-active .room__display {
    animation: title-glow-pulse 1400ms ease-out 600ms 1;
}

@keyframes title-glow-pulse {
    0%   { text-shadow: 0 0 0 transparent, 0 0 0 transparent; }
    50%  { text-shadow: 0 0 8px var(--room-accent), 0 0 28px color-mix(in srgb, var(--room-accent) 60%, transparent); }
    100% { text-shadow: 0 0 4px color-mix(in srgb, var(--room-accent) 70%, transparent), 0 0 16px color-mix(in srgb, var(--room-accent) 40%, transparent); }
}

.room__display .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.room__display .letter.is-on {
    opacity: 1;
    transform: translateY(0);
}

.room__label {
    margin-top: 14px;
    font-family: var(--font-display);
    font-size: clamp(14px, 1.4vw, 20px);
    letter-spacing: 0.36em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* === Bubble cards (text containers) === */

.bubble-card {
    position: absolute;
    z-index: 5;
    top: var(--card-y, 20%);
    left: var(--card-x, 60%);
    max-width: 320px;
    padding: 28px 32px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--room-accent) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--room-accent) 50%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
    box-shadow: 0 0 30px color-mix(in srgb, var(--room-accent) 25%, transparent), inset 0 0 18px color-mix(in srgb, var(--room-accent) 10%, transparent);
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: opacity 800ms ease 300ms, transform 800ms ease 300ms;
}

.bubble-card--lg {
    max-width: 380px;
    padding: 32px 38px;
    font-size: 16px;
}

.room.is-active .bubble-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bubble-card__text {
    margin: 0;
    color: var(--text-soft);
}

/* === Ambient floating bubbles === */

.room__bubble-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.32), transparent 60%);
    border: 1px solid color-mix(in srgb, var(--room-accent) 35%, transparent);
    animation: float-up var(--duration, 12s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    will-change: transform, opacity;
}

@keyframes float-up {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50%      { transform: translateY(-80px) scale(1.1); opacity: 0.55; }
}

/* === Porch arrow nudge === */

.porch-arrow {
    transform-box: fill-box;
    transform-origin: center;
    animation: arrow-nudge 2200ms ease-in-out infinite;
}
@keyframes arrow-nudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(20px); }
}

/* Subtle wobble on jars/teacups when active */
.room.is-active .jar,
.room.is-active .teacup,
.room.is-active .mushroom,
.room.is-active .bee,
.room.is-active .butterfly,
.room.is-active .ladybug {
    animation: gentle-bob 6s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}
.room.is-active .bee.hover-target { animation-duration: 4s; }
.room.is-active .butterfly { animation-duration: 5s; }

@keyframes gentle-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* Reading lamp soft pulse */
.room.is-active .reading-lamp { animation: lamp-pulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lamp-pulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 184, 0, 0.4)); }
    50%      { filter: drop-shadow(0 0 22px rgba(255, 184, 0, 0.8)); }
}

/* === Bubble Navigation === */

.bubble-nav {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.bubble-nav__list {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    padding: 14px 26px;
    background: rgba(11, 11, 26, 0.6);
    border-radius: 999px;
    border: 1px solid rgba(160, 160, 200, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bubble-nav__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 300ms ease;
}

.bubble-nav__item:hover {
    transform: translateY(-3px);
}

.bubble-nav__dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--stroke-lavender);
    background: transparent;
    transition: background 400ms ease, border-color 400ms ease, box-shadow 400ms ease, transform 400ms ease;
}

.bubble-nav__item.is-active .bubble-nav__dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent);
    transform: scale(1.3);
}

.bubble-nav__label {
    position: absolute;
    bottom: 22px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.24em;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    white-space: nowrap;
}

.bubble-nav__item:hover .bubble-nav__label,
.bubble-nav__item.is-active .bubble-nav__label {
    opacity: 1;
    transform: translateY(0);
    color: var(--accent);
}

.bubble-nav__hint {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.36em;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* === Transition burst (when changing rooms) === */

.transition-burst {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    overflow: hidden;
}

.transition-burst .burst-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 60%);
    border: 1px solid currentColor;
    animation: burst-fly 900ms ease-out forwards;
    will-change: transform, opacity;
}

@keyframes burst-fly {
    0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
    20%  { opacity: 0.9; }
    100% { transform: translate(var(--bx, 60px), var(--by, -120px)) scale(1.2); opacity: 0; }
}

/* === Hover-burst bubbles on objects === */

.hover-bubble-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 35;
    overflow: hidden;
}

.hover-bubble-layer .pop-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), transparent 60%);
    border: 1px solid currentColor;
    animation: bubble-burst 800ms ease-out forwards;
    will-change: transform, opacity;
}

@keyframes bubble-burst {
    0%   { transform: translate(0, 0) scale(0.5); opacity: 0.85; }
    100% { transform: translate(var(--hx, 0), -60px) scale(1.1); opacity: 0; }
}

/* === Garden-specific rendering: motion of bee trails === */

.scene-garden .bee {
    animation-duration: 4s !important;
}

/* === Library lamp glow halo === */

.scene-library .reading-lamp path[fill="#FFB800"] { filter: drop-shadow(0 0 14px rgba(255, 184, 0, 0.6)); }

/* === Mobile fallback - vertical scroll === */

@media (max-width: 768px) {
    html, body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }
    .cottage-walk {
        flex-direction: column;
        width: 100vw;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }
    .room, .room--wide {
        flex: 0 0 100vh;
        width: 100vw;
        min-width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
    }
    .room--wide {
        height: 130vh;
        flex-basis: 130vh;
    }
    .room__display {
        font-size: clamp(64px, 16vw, 120px);
    }
    .room__title-wrap {
        top: 8%;
        left: 6%;
    }
    .room__title-wrap--right {
        right: 6%;
    }
    .bubble-card {
        max-width: 76vw;
    }
    .bubble-nav {
        bottom: 16px;
    }
    .bubble-nav__list {
        gap: 14px;
        padding: 10px 18px;
    }
    .bubble-nav__hint {
        display: none;
    }
}
