/*
 * Landing page for visitors (templates/Pages/landing.php, behaviour in webroot/js/landing.js).
 * Every class carries the `lp-` prefix so nothing collides with Bootstrap (.card, .lead, .progress ...).
 * Corners stay square like everywhere else; only the play buttons, numbers and avatars are circles.
 */
.landing {
    --lp-lila: #9b4dca;
    --lp-lila-dark: #593196;
    --lp-text: #2b2b33;
    --lp-muted: #606c76;
    color: var(--lp-text);
}

/* blocks snap into place only on large screens; on phones the blocks are taller than the screen and snapping
   fights the finger */
@media (min-width: 768px) and (min-height: 640px) {
    html:has(.landing) {
        scroll-snap-type: y proximity;
    }
}

/* the page background follows the block in view (set by landing.js) */
body:has(.landing) {
    transition: background-color .8s;
}

.lp-section {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - var(--nld-nav-h));
    padding: 64px 16px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.lp-section > * {
    position: relative;
    z-index: 1;
}

.landing h1,
.landing h2 {
    font-weight: 300;
    margin: 0 0 .4em;
}

.landing h1 {
    font-size: clamp(2.3rem, 6.5vw, 4.4rem);
    line-height: 1.1;
}

.landing h2 {
    font-size: clamp(2rem, 5.2vw, 3.4rem);
    line-height: 1.15;
}

.lp-lead {
    max-width: 42rem;
    margin: 0 auto 2.2rem;
    color: var(--lp-muted);
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    line-height: 1.5;
}

.lp-tag {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--lp-lila);
    font-size: clamp(.8rem, 1.6vw, .95rem);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* came through an invitation link (templates/Pages/landing.php): a wide band above the headline */
.lp-invite {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(100%, 56rem);
    margin: 0 auto 2rem;
    padding: 1rem 1.4rem;
    background: linear-gradient(100deg, var(--lp-lila-dark), var(--lp-lila));
    box-shadow: 0 12px 32px rgba(89, 49, 150, .25);
    color: #fff;
    text-align: left;
}

.lp-invite-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, .16);
}

.lp-invite-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    font-size: 1.05rem;
    line-height: 1.4;
}

.lp-invite-text strong {
    font-size: 1.2rem;
}

.lp-note {
    margin-top: .6rem;
    color: #a0a0a8;
    font-size: .75rem;
}

.lp-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s, transform .8s;
}

.lp-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* two soft colour blobs drifting slowly behind every block (colours per block: --lp-b1, --lp-b2) */
.lp-section::before,
.lp-section::after {
    content: "";
    position: absolute;
    width: 55vmax;
    height: 55vmax;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
    animation: lp-drift 22s ease-in-out infinite alternate;
}

.lp-section::before {
    top: -20vmax;
    left: -15vmax;
    background: var(--lp-b1, #e6d8f5);
}

.lp-section::after {
    right: -15vmax;
    bottom: -25vmax;
    background: var(--lp-b2, #fbe3ef);
    animation-duration: 28s;
    animation-direction: alternate-reverse;
}

@keyframes lp-drift {
    to { transform: translate(8vmax, 6vmax) scale(1.15); }
}

/* dark block: own background - on phones two blocks share the screen and the page colour belongs to the other */
.lp-section.is-dark {
    background: #2a1846;
    color: #f1ecf8;
}

.lp-section.is-dark .lp-lead {
    color: #cdbfe3;
}

.lp-section.is-dark .lp-tag {
    color: #c86bfa;
}

/* 1 hero */
.lp-hero-stage {
    width: 100%;
    max-width: 1050px;
    margin-top: -1rem;
}

.lp-hero-stage svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* side by side from 768 px on, one card above the other on phones */
.lp-hero-stage .lp-hero-tall {
    display: none;
}

@media (max-width: 767.98px) {
    .lp-hero-stage {
        max-width: 440px;
        margin-top: 0;
    }

    .lp-hero-stage .lp-hero-wide {
        display: none;
    }

    .lp-hero-stage .lp-hero-tall {
        display: block;
    }
}

.lp-float-a,
.lp-float-b {
    transform-box: fill-box;
    transform-origin: center;
    animation: lp-float 6s ease-in-out infinite;
}

.lp-float-b {
    animation-duration: 7.5s;
    animation-delay: -3s;
}

@keyframes lp-float {
    50% { transform: translateY(-14px) rotate(1.5deg); }
}

.lp-dash {
    animation: lp-march 1.6s linear infinite;
}

@keyframes lp-march {
    to { stroke-dashoffset: -32; }
}

.lp-shine {
    background: linear-gradient(90deg, var(--lp-lila-dark), #c86bfa, #e05fd0, var(--lp-lila-dark));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lp-shine 6s linear infinite;
}

@keyframes lp-shine {
    to { background-position: 300% 0; }
}

/* 2 listen */
.lp-player {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 680px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(89, 49, 150, .12);
}

.lp-play {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--lp-lila);
    color: #fff;
}

.lp-play:hover {
    background: var(--lp-lila-dark);
}

.lp-play svg,
.lp-vplay svg {
    width: 50%;
    height: 50%;
    fill: currentColor;
}

.lp-wave {
    flex: 1;
    min-width: 0;
    height: 72px;
    cursor: pointer;
}

.lp-time {
    width: 3.5em;
    color: var(--lp-muted);
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

.lp-player-label {
    margin-top: .8rem;
    color: var(--lp-muted);
    font-size: clamp(.95rem, 1.8vw, 1.1rem);
}

.lp-unlocked {
    margin-top: 1.2rem;
    color: var(--lp-lila-dark);
    font-weight: 600;
    opacity: 0;
    transition: opacity .5s;
}

.lp-unlocked.is-shown {
    opacity: 1;
}

/* 3 unlock */
.lp-frame {
    position: relative;
    width: min(420px, 86vw);
    aspect-ratio: 4 / 5;
    border: 6px solid var(--lp-lila);
    box-shadow: 0 0 0 3px #fff, 0 0 40px rgba(155, 77, 202, .45);
}

.lp-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
}

.lp-pieces {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.lp-pieces div {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .7);
    background: rgba(240, 236, 246, .55);
    -webkit-backdrop-filter: blur(14px) grayscale(1);
    backdrop-filter: blur(14px) grayscale(1);
    color: var(--lp-lila-dark);
    font-size: 1.4rem;
    transition: backdrop-filter 1s, background 1s;
}

.lp-pieces div.is-open {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-size: 0;
}

.lp-count {
    margin-top: 1.2rem;
    color: var(--lp-muted);
}

/* 4 chat */
.lp-chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 620px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .08);
    text-align: left;
}

.lp-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 85%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .5s, transform .5s;
}

.lp-msg.is-in {
    opacity: 1;
    transform: none;
}

.lp-msg.is-me {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.lp-avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-position: center 20%;
    background-size: cover;
}

.lp-bubble {
    padding: 12px 16px;
    background: #f0ebf7;
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.45;
}

.lp-msg.is-me .lp-bubble {
    background: var(--lp-lila);
    color: #fff;
}

.lp-voice {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(300px, 62vw);
}

.lp-vplay {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--lp-lila);
}

.lp-vbars {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 2px;
    height: 30px;
    overflow: hidden;
}

.lp-vbars i {
    flex: 1;
    background: rgba(255, 255, 255, .5);
}

.lp-voice small {
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}

/* 5 more */
.lp-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    text-align: left;
}

.lp-card {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
}

.lp-card b {
    display: flex;
    align-items: center;
    gap: .5em;
    margin-bottom: .4rem;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
}

/* own icon before the title (IconHelper, webroot/img/icons/) */
.lp-card b .nld-icon {
    flex: none;
    width: 1.35em;
    height: 1.35em;
    color: #c86bfa;
}

.lp-card small {
    display: block;
    color: #cdbfe3;
    font-size: clamp(.95rem, 1.6vw, 1.05rem);
    line-height: 1.45;
}

@media (max-width: 900px) {
    .lp-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .lp-cards { grid-template-columns: 1fr; }
}

/* "just look around" note below the cards of the dark block: a card (.lp-card) over the full width, highlighted */
.lp-browse {
    width: 100%;
    max-width: 1100px;
    margin-top: 20px;
    border: 2px solid #c86bfa;
    background: rgba(200, 107, 250, .14);
    text-align: left;
}

/* 6 join */
.lp-trust .nld-icon,
.lp-code-hint .nld-icon {
    width: 1.25em;
    height: 1.25em;
    margin-right: .4em;
    vertical-align: -.25em;
    color: var(--lp-lila);
}

.lp-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    margin: 0 0 1.8rem;
    padding: 0;
    list-style: none;
    text-align: left;
}

.lp-steps li {
    padding: 28px 24px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(89, 49, 150, .1);
}

.lp-steps li:last-child {
    box-shadow: 0 0 0 2px var(--lp-lila), 0 8px 30px rgba(89, 49, 150, .2);
}

.lp-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--lp-lila);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.lp-steps b {
    display: block;
    margin-bottom: .35rem;
    font-size: clamp(1.15rem, 2vw, 1.35rem);
}

.lp-steps small {
    display: block;
    color: var(--lp-muted);
    font-size: clamp(.98rem, 1.6vw, 1.08rem);
    line-height: 1.45;
}

@media (max-width: 760px) {
    .lp-steps { grid-template-columns: 1fr; }
}

.lp-trust {
    max-width: 40rem;
    margin: 0 auto 1.8rem;
    color: var(--lp-muted);
    font-size: clamp(1rem, 1.8vw, 1.1rem);
}

.lp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 28px;
}

.lp-cta {
    display: inline-block;
    padding: 16px 40px;
    background: var(--lp-lila);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
}

.lp-cta:hover {
    background: var(--lp-lila-dark);
    color: #fff;
}

.lp-login {
    color: var(--lp-lila-dark);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
}

.lp-login:hover {
    text-decoration: underline;
}

.lp-code-hint {
    margin-top: 1.8rem;
    padding: 10px 16px;
    background: rgba(155, 77, 202, .08);
    color: var(--lp-lila-dark);
    font-size: .98rem;
}

/* phones: tighter blocks, smaller type, compact boxes */
@media (max-width: 575.98px) {
    .lp-section {
        min-height: 0;
        padding: 48px 16px;
    }

    .lp-section:first-child {
        padding-top: 28px;
    }

    .landing h1 {
        font-size: 2rem;
    }

    .lp-invite {
        gap: .8rem;
        margin-bottom: 1.5rem;
        padding: .8rem 1rem;
    }

    .lp-invite-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

    .lp-invite-text {
        font-size: .95rem;
    }

    .lp-invite-text strong {
        font-size: 1.05rem;
    }

    .landing h2 {
        font-size: 1.65rem;
    }

    .lp-lead {
        margin-bottom: 1.5rem;
        font-size: 1.05rem;
    }

    .lp-tag {
        margin-bottom: .6rem;
    }

    .lp-player {
        gap: 12px;
        padding: 14px;
    }

    .lp-play {
        width: 52px;
        height: 52px;
    }

    .lp-wave {
        height: 56px;
    }

    .lp-time {
        width: 2.8em;
    }

    .lp-frame {
        width: min(320px, 80vw);
    }

    .lp-chat {
        padding: 14px;
    }

    .lp-msg {
        max-width: 92%;
    }

    .lp-bubble {
        padding: 9px 12px;
        font-size: .98rem;
    }

    .lp-avatar {
        width: 28px;
        height: 28px;
    }

    .lp-voice {
        width: min(240px, 60vw);
    }

    .lp-cards,
    .lp-steps {
        gap: 12px;
    }

    .lp-card {
        padding: 16px 18px;
    }

    .lp-browse {
        margin-top: 12px;
    }

    .lp-card b {
        font-size: 1.08rem;
    }

    .lp-card small,
    .lp-steps small {
        font-size: .95rem;
    }

    /* steps as rows: number on the left, text on the right */
    .lp-steps li {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        align-items: start;
        padding: 16px 18px;
    }

    .lp-steps .lp-num {
        grid-row: span 2;
        width: 38px;
        height: 38px;
        margin: 0;
        font-size: 1.05rem;
    }

    .lp-steps b {
        margin-bottom: .2rem;
        font-size: 1.1rem;
    }

    .lp-trust {
        font-size: .98rem;
    }

    .lp-cta {
        width: 100%;
        padding: 14px 24px;
        text-align: center;
    }

    .lp-code-hint {
        font-size: .92rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lp-reveal,
    .lp-msg { transition: none; }
    .lp-float-a,
    .lp-float-b,
    .lp-dash,
    .lp-shine,
    .lp-section::before,
    .lp-section::after { animation: none; }
}
