/* Listen page: a wheel of languages. Click one, hear the Zensia voice say hello in it.
   Layout ported from the music-style explorer, in the site's light theme. */
.ls-page {
    --ls-bg: #f8fafc;
    --ls-ink: #0f172a;
    --ls-muted: #64748b;
    --ls-line: #e2e8f0;
    --ls-accent: #00A896;
    --ls-accent-deep: #007f72;

    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(360px, 42%) 1fr;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 50% 70% at 0% 50%, #ffffff 0%, transparent 70%),
        radial-gradient(ellipse 45% 60% at 80% 50%, rgba(0, 168, 150, .07), transparent 70%),
        var(--ls-bg);
    color: var(--ls-ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.ls-page *, .ls-page *::before, .ls-page *::after { box-sizing: border-box; }
.ls-page button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ls-page :focus-visible { outline: 2px solid var(--ls-accent); outline-offset: 3px; }

/* the site header floats over the full-screen page, as on the home hero */
body:has(.ls-page) .site-header { position: fixed; top: 0; left: 0; right: 0; }

/* ── left: heading, player, button ── */
.ls-left {
    position: relative; z-index: 2;
    width: 100%; max-width: 660px;
    padding-left: clamp(24px, 9vw, 160px);
    padding-right: 24px;
}
.ls-title {
    margin: 0 0 26px;
    font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
    font-size: clamp(28px, 2.6vw, 40px);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.022em;
    color: var(--ls-ink);
}
.ls-player {
    padding: 38px 40px 42px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--ls-line);
    border-radius: 16px;
    box-shadow: 0 30px 60px -34px rgba(15, 23, 42, .35), 0 2px 8px rgba(15, 23, 42, .05);
}
.ls-genre {
    margin: 0; min-height: 20px;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; letter-spacing: .02em;
    color: var(--ls-accent-deep);
}
.ls-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.ls-eq i { width: 3px; height: 100%; background: var(--ls-accent); transform-origin: bottom; transform: scaleY(.3); }
.ls-player.is-playing .ls-eq i { animation: ls-eq .8s ease-in-out infinite alternate; }
.ls-eq i:nth-child(2) { animation-delay: -.3s !important; }
.ls-eq i:nth-child(3) { animation-delay: -.6s !important; }
.ls-eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes ls-eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.ls-name {
    margin: 8px 0 0;
    font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
    font-size: 30px; font-weight: 500; letter-spacing: -0.022em; line-height: 1.15;
    overflow-wrap: anywhere;
}
.ls-line {
    margin: 10px auto 0; max-width: 40ch; min-height: 3.1em;
    font-size: 13px; line-height: 1.55; color: var(--ls-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ls-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 24px; }
.ls-ctl {
    width: 50px; height: 50px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ls-accent); color: #fff;
    transition: transform .15s ease, background .15s ease;
}
.ls-ctl:hover { transform: scale(1.06); background: var(--ls-accent-deep); }
.ls-ctl--big { width: 70px; height: 70px; box-shadow: 0 14px 26px -10px rgba(0, 168, 150, .7); }
.ls-ctl svg { width: 16px; height: 16px; }
.ls-ctl--big svg { width: 22px; height: 22px; }
.ls-ghost {
    width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; color: #94a3b8;
    transition: background .15s ease, color .15s ease;
}
.ls-ghost:hover { background: #f1f5f9; color: var(--ls-ink); }
.ls-ghost svg { width: 18px; height: 18px; }
.ls-controls .ls-ghost:first-child { margin-right: 18px; }
.ls-controls .ls-ghost:last-child { margin-left: 18px; }
.ls-progress { position: relative; margin-top: 34px; height: 6px; border-radius: 99px; background: #e5e9ef; cursor: pointer; }
.ls-progress::before { content: ''; position: absolute; inset: -10px 0; }   /* bigger hit area */
.ls-progress span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--ls-accent); }
.ls-progress span::after { content: ''; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; translate: 0 -50%; border-radius: 50%; background: var(--ls-accent); }

.ls-cta {
    display: flex; align-items: center; justify-content: center;
    width: 100%; margin-top: 18px; padding: .95rem 1.7rem;
    border-radius: 8px;                               /* same rectangle as the hero buttons */
    background: #0b1020; color: #fff;
    font-size: 1rem; font-weight: 600; text-decoration: none;
    box-shadow: 0 8px 24px rgba(11, 16, 32, .18);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ls-cta:hover { transform: translateY(-2px); background: #1e293b; box-shadow: 0 12px 30px rgba(11, 16, 32, .25); }

/* ── right: the fanned wall of languages ── */
.ls-field {
    position: absolute; inset: 0; z-index: 1;
    touch-action: none; cursor: grab;
    -webkit-mask: linear-gradient(90deg, transparent 42%, #000 54%);
            mask: linear-gradient(90deg, transparent 42%, #000 54%);
}
.ls-field.is-dragging { cursor: grabbing; }
.ls-fan {
    position: absolute; left: var(--px); top: 50%;
    width: 0; height: 0;
    transform: rotate(var(--spin, 0deg));
}
.ls-row {
    position: absolute; left: 0; top: 0; white-space: nowrap;
    transform-origin: 0 50%;
    transform: rotate(var(--a)) translateX(var(--r)) translateY(-50%);
}
.ls-track { display: inline-flex; gap: 18px; transform: translateX(var(--off, 0px)); }
.ls-tag {
    font-size: var(--fs, 17px); font-weight: 500;
    color: var(--c);
    padding: 2px 6px; border-radius: 999px;
    transition: color .2s ease, background .2s ease;
}
.ls-tag:hover { background: rgba(0, 168, 150, .14); }
.ls-tag.is-selected {
    position: relative; z-index: 2;
    padding: 4px 14px; margin: -2px -6px;
    color: #fff; background: var(--ls-accent);
    font-size: calc(var(--fs, 17px) * 1.25);
    box-shadow: 0 10px 26px -10px rgba(0, 168, 150, .85);
}
.ls-tag.is-selected:hover { background: var(--ls-accent); }
.ls-tag.pop { animation: ls-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes ls-pop { from { scale: .6; opacity: 0; } to { scale: 1; opacity: 1; } }
.ls-anchor { position: absolute; left: var(--pillx); top: 50%; width: 0; height: 0; pointer-events: none; }

.ls-empty { grid-column: 1 / -1; text-align: center; color: var(--ls-muted); }

/* hidden on desktop; used by the pop-up player below */
.ls-close, .ls-hint, .ls-scrim { display: none; }

/* Tablet and phone: the whole page is the wall of languages. Tapping one opens the player
   as a pop-up window, with a cross to close it. */
@media (max-width: 900px) {
    .ls-page { display: block; padding: 0; }
    .ls-left { position: static; max-width: none; padding: 0; margin: 0; }
    .ls-field {
        -webkit-mask: linear-gradient(180deg, transparent 20%, #000 34%);
                mask: linear-gradient(180deg, transparent 20%, #000 34%);
    }
    .ls-tag { opacity: .85; }
    .ls-title {
        position: absolute; z-index: 3; top: 92px; left: 20px; right: 20px; margin: 0;
        font-size: clamp(24px, 6vw, 34px); pointer-events: none;
    }
    .ls-hint {
        display: block; position: absolute; z-index: 3; top: calc(92px + 2.3 * clamp(24px, 6vw, 34px) + 8px); left: 20px; right: 20px; margin: 0;
        font-size: 13px; color: var(--ls-muted); pointer-events: none;
    }
    .ls-cta {
        position: absolute; z-index: 3; left: 16px; bottom: 16px; width: auto;
        margin: 0; padding: .75rem 1.2rem; font-size: .95rem;
    }

    .ls-scrim {
        display: block; position: fixed; inset: 0; z-index: 60;
        background: rgba(15, 23, 42, .4);
        opacity: 0; pointer-events: none; transition: opacity .25s ease;
    }
    .ls-page.is-open .ls-scrim { opacity: 1; pointer-events: auto; }

    .ls-player {
        position: fixed; z-index: 61; left: 50%; top: 50%;
        width: min(92vw, 420px); max-height: 92vh; max-height: 92svh; overflow: auto;
        padding: 40px 22px 26px;
        transform: translate(-50%, -46%) scale(.96);
        opacity: 0; visibility: hidden; pointer-events: none;
        transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .3s;
    }
    .ls-page.is-open .ls-player {
        opacity: 1; visibility: visible; pointer-events: auto;
        transform: translate(-50%, -50%) scale(1);
        transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .3, 1);
    }
    .ls-close {
        display: grid; place-items: center;
        position: absolute; top: 10px; right: 10px;
        width: 38px; height: 38px; border-radius: 50%;
        background: #f1f5f9; color: var(--ls-muted);
        transition: background .15s ease, color .15s ease;
    }
    .ls-close:hover { background: #e2e8f0; color: var(--ls-ink); }
    .ls-close svg { width: 18px; height: 18px; }
    .ls-name { font-size: 26px; }
    .ls-controls { gap: 14px; margin-top: 18px; }
    .ls-ctl--big { width: 62px; height: 62px; }
    .ls-controls .ls-ghost:first-child { margin-right: 4px; }
    .ls-controls .ls-ghost:last-child { margin-left: 4px; }
    .ls-progress { margin-top: 24px; }
}
@media (min-width: 700px) and (max-width: 900px) and (min-height: 521px) {
    /* the site header wraps to two lines here */
    .ls-title { top: 128px; }
    .ls-hint { top: calc(128px + 2.3 * clamp(24px, 6vw, 34px) + 8px); }
    .ls-field { -webkit-mask: linear-gradient(180deg, transparent 24%, #000 38%); mask: linear-gradient(180deg, transparent 24%, #000 38%); }
}
@media (max-width: 900px) and (max-height: 520px) {
    /* landscape phones: no room for a heading above the wall; keep it for screen readers */
    .ls-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .ls-hint { top: 84px; }
    .ls-field { -webkit-mask: none; mask: none; }
    .ls-line { display: none; }
    .ls-player { padding: 34px 20px 18px; }
    .ls-controls { margin-top: 10px; }
    .ls-progress { margin-top: 16px; }
    .ls-cta { padding: .55rem 1rem; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ls-eq i, .ls-tag.pop { animation: none !important; }
}
