@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --ink: #20332f;
    --muted-ink: #64746d;
    --paper: #f4f1e9;
    --paper-bright: #fffdf8;
    --sage: #9db9a6;
    --sage-deep: #55796d;
    --clay: #c9785d;
    --line: rgba(32, 51, 47, 0.14);
    --shadow: 0 24px 70px rgba(54, 76, 65, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    color: var(--ink);
    background: var(--paper);
    font-family: 'Raleway', sans-serif;
}

body::before,
body::after {
    position: fixed;
    z-index: -1;
    display: block;
    width: 42vw;
    height: 42vw;
    border-radius: 50%;
    content: '';
    filter: blur(2px);
    pointer-events: none;
}

body::before {
    top: -22vw;
    right: -12vw;
    background: rgba(157, 185, 166, 0.32);
}

body::after {
    bottom: -28vw;
    left: -16vw;
    background: rgba(201, 120, 93, 0.16);
}

#container,
#webgl-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

#webgl-canvas {
    z-index: 0;
    display: block;
}

#home-screen,
#mobile-screen,
#mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 4vw, 4rem);
    transition:
        opacity 700ms ease,
        visibility 700ms ease;
}

#home-screen {
    opacity: 1;
    visibility: visible;
}

#home-screen > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.7fr);
    gap: clamp(2.5rem, 7vw, 7rem);
    width: min(1040px, 100%);
    min-height: min(600px, calc(100vh - 3rem));
    padding: clamp(2rem, 7vw, 6rem);
    border: 1px solid rgba(255, 253, 248, 0.9);
    border-radius: 12px;
    background: rgba(255, 253, 248, 0.5);
    box-shadow: var(--shadow);
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

#home-screen h1,
#mobile-screen h1,
#mobile-panel h1 {
    margin: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    color: var(--sage-deep);
    font-size: clamp(4rem, 11vw, 9rem);
    letter-spacing: 0.02em;
    line-height: 0.82;
}

#home-screen > div > p,
#mobile-screen p {
    max-width: 31rem;
    margin: 1.25rem 0 0;
    color: var(--muted-ink);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.55;
}

.hero-copy {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 360px;
    isolation: isolate;
}

.hero-panel {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    gap: 0.3rem;

    #mode-description {
        margin: 0;
        color: var(--muted-ink);
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

.eyebrow,
.panel-label {
    color: var(--clay);
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy p {
    margin: 2rem 0 0;
    color: var(--muted-ink);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.55;
}

#room-panel {
    display: none;
    align-content: center;
    gap: 1rem;
    min-width: 0;
    padding: 1.5rem 0 1.5rem clamp(1rem, 4vw, 3rem);
    border-left: 1px solid var(--line);
    text-align: left;
}

body.has-room #room-panel {
    display: grid;
}

#room-status {
    min-height: 2.8em;
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.95rem;
    line-height: 1.45;
}

.panel-label {
    color: var(--sage-deep);
}

#mode-select {
    width: 100%;
}

#mode-select,
#mode-select::picker(select) {
    appearance: base-select;
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0.75em 1em;
    color: #333;
    transition:
        border-color 0.25s,
        box-shadow 0.25s;
    margin-block: 8px;
}

#mode-select::picker(select) {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5em;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        display 0.25s allow-discrete,
        overlay 0.25s allow-discrete;
}

#mode-select:not(:open)::picker(select) {
    opacity: 0;
    transform: scale(0.95);
}

#mode-select:open::picker(select) {
    opacity: 1;
    transform: scale(1);
}

#mode-select option {
    cursor: pointer;
    gap: 0.6em;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

#mode-select option div {
    gap: 0.6em;
    padding: 15px 0;
    display: flex;
    align-items: center;
}

#mode-select option:hover {
    background: #f2f2f2;
    border-radius: 6px;
}

#mode-select option:checked {
    background: #eaf5ff;
    border-radius: 6px;
}

#mode-select option::checkmark {
    display: none;
}

#mode-select selectedcontent div {
    gap: 0.6em;
    display: flex;
    align-items: center;
}

#mode-select selectedcontent > * {
    transition:
        transform 0.6s ease,
        opacity 0.6s,
        display 0.6s allow-discrete;
    @starting-style {
        opacity: 0;
        transform: translateY(8px);
    }
    opacity: 1;
}
#qr-code {
    display: block;
    width: min(180px, 100%);
    height: auto;
    margin: 0;
    border: 10px solid var(--paper-bright);
    border-radius: 12px;
}

body:not(.has-room) #qr-code:empty {
    display: none;
}

#mobile-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 2rem 1.5rem;
    justify-content: start;
    align-content: center;
    gap: 1rem;
    min-width: 0;
    border-left: 1px solid var(--line);
    text-align: left;

    & > div {
        display: flex;
        flex-direction: column;
        gap: clamp(2.5rem, 7vw, 7rem);
        padding: clamp(2rem, 7vw, 6rem);
        border: 1px solid rgba(255, 253, 248, 0.9);
        border-radius: 12px;
        background: rgba(255, 253, 248, 0.5);
        box-shadow: var(--shadow);
        pointer-events: auto;
        backdrop-filter: blur(10px);
    }

    button {
        position: absolute;
        bottom: 3rem;
        padding: 1rem 1.45rem;
        height: 12rem;
        width: 12rem;
        border: 1px solid var(--sage-deep);
        margin: 2rem 0 0;
        border-radius: 100px;
        color: var(--paper-bright);
        background: var(--sage-deep);
        box-shadow: 0 8px 18px rgba(85, 121, 109, 0.2);
        font: inherit;
        cursor: pointer;
        transition:
            background 180ms ease,
            transform 180ms ease,
            box-shadow 180ms ease;

        &:active {
            transform: scale(0.96);
        }
    }

    p {
        font-family: 'Raleway', sans-serif;
        font-weight: 400;
    }
}

#mobile-screen {
    z-index: 20;
    align-content: center;
    justify-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
}

#mobile-screen p {
    max-width: 26rem;
}

body.is-mobile #mobile-screen {
    opacity: 1;
    visibility: visible;
}

body.is-mobile #home-screen,
body.is-experience-active #home-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#progress-bar-bg,
#progress-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    height: 6px;
}

#progress-bar-bg {
    z-index: 19;
    background: rgba(32, 51, 47, 0.12);
}

#progress-bar {
    z-index: 20;
    width: 0%;
    background: var(--clay);
    transition: width 100ms linear;
}

#progress-text {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    z-index: 21;
    margin: 0;
    color: var(--muted-ink);
    font-size: 0.9rem;
    transform: translateX(-50%);
}

/* CSS */
.button-33 {
    background-color: #c2fbd7;
    border-radius: 8px;
    box-shadow:
        rgba(44, 187, 99, 0.2) 0 -25px 18px -14px inset,
        rgba(44, 187, 99, 0.15) 0 1px 2px,
        rgba(44, 187, 99, 0.15) 0 2px 4px,
        rgba(44, 187, 99, 0.15) 0 4px 8px,
        rgba(44, 187, 99, 0.15) 0 8px 16px,
        rgba(44, 187, 99, 0.15) 0 16px 32px;
    color: green;
    cursor: pointer;
    display: inline-block;
    font-family:
        CerebriSans-Regular,
        -apple-system,
        system-ui,
        Roboto,
        sans-serif;
    padding: 16px 0;
    text-align: center;
    text-decoration: none;
    transition: all 250ms;
    border: 0;
    font-size: 16px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.button-33:hover {
    box-shadow:
        rgba(44, 187, 99, 0.35) 0 -25px 18px -14px inset,
        rgba(44, 187, 99, 0.25) 0 1px 2px,
        rgba(44, 187, 99, 0.25) 0 2px 4px,
        rgba(44, 187, 99, 0.25) 0 4px 8px,
        rgba(44, 187, 99, 0.25) 0 8px 16px,
        rgba(44, 187, 99, 0.25) 0 16px 32px;
    transform: scale(1.05);
}

@media (max-width: 700px) {
    #home-screen > div {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }

    .hero-copy {
        min-height: 300px;
    }

    .hero-orbit {
        right: 0;
        bottom: -2rem;
    }

    #room-panel {
        padding: 1.5rem 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    #qr-code {
        width: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
