/**
 * Roomzic — "product story" blocks shared by the home page and /how-it-works
 * (pillars, before/during timeline, with/without comparison, role cards,
 * callout, use cases, provider status badges).
 *
 * Built on the landing-v2.css tokens (--primary, --secondary, --success, ...).
 * CSS only: no JS, no images. Animations are light and disabled under
 * prefers-reduced-motion. Mobile-first: everything is one column until 768px.
 */

.story-section {
    padding-top: 64px;
    padding-bottom: 64px;
}

.story-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 40px;
}

.story-head .section-title {
    margin-bottom: 16px;
}

.story-head .section-subtitle {
    margin-bottom: 0;
    max-width: 640px;
}

.story-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(124, 58, 237, 0.12);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ---------- Hero: pillars strip ---------- */

.story-pillars {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 36px auto 0;
    padding: 0;
    max-width: 720px;
}

.story-pillar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(250, 250, 250, 0.9);
}

.story-pillar-icon {
    font-size: 16px;
    line-height: 1;
}

.hero .story-hero-desc {
    font-size: clamp(17px, 2.4vw, 21px);
    line-height: 1.55;
    max-width: 700px;
    margin-bottom: 36px;
}

.hero .story-hero-tagline {
    margin: 22px auto 0;
    max-width: 640px;
    font-size: 16px;
    font-style: italic;
    font-weight: 500;
    color: var(--gray);
}

.hero .story-reassurance {
    margin: 14px auto 0;
    max-width: 560px;
    font-size: 14px;
    font-weight: 400;
    color: var(--gray);
}

/* ---------- Home: "how it works" in 5 steps ---------- */

.story-how {
    list-style: none;
    margin: 48px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-how-step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 16px;
    align-items: start;
    text-align: left;
}

.story-how-step .step-number {
    width: 56px;
    height: 56px;
    margin: 0;
    font-size: 24px;
    border-radius: 16px;
}

.story-how-step h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 19px;
    font-weight: 700;
    margin: 4px 0 6px;
}

.story-how-step p {
    margin: 0;
    color: var(--gray);
    font-size: 15px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .story-how {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 36px 24px;
        margin-top: 64px;
    }

    .story-how-step {
        display: block;
        flex: 1 1 200px;
        max-width: 320px;
        text-align: center;
    }

    .story-how-step .step-number {
        width: 64px;
        height: 64px;
        margin: 0 auto 18px;
        font-size: 28px;
    }
}

/* ---------- Before / during ---------- */

.story-phases {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.story-phase {
    position: relative;
    padding: 28px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-phase--during {
    border-color: rgba(255, 61, 113, 0.35);
    background: linear-gradient(160deg, rgba(255, 61, 113, 0.08), rgba(124, 58, 237, 0.08));
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.12);
}

.story-phase-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.story-phase-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(250, 250, 250, 0.9);
}

.story-phase--during .story-phase-badge {
    background: var(--gradient);
    color: #fff;
}

.story-phase-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

/* Equalizer bars, "music is playing" cue on the DURING card */
.story-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.story-eq span {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: currentColor;
    transform-origin: bottom;
    animation: story-eq 1s ease-in-out infinite;
}

.story-eq span:nth-child(2) { animation-delay: .2s; }
.story-eq span:nth-child(3) { animation-delay: .4s; }

@keyframes story-eq {
    0%, 100% { transform: scaleY(.35); }
    50% { transform: scaleY(1); }
}

.story-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: story-step;
}

.story-step {
    position: relative;
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 14px;
    padding-bottom: 20px;
    counter-increment: story-step;
}

.story-step:last-child {
    padding-bottom: 0;
}

.story-step::before {
    content: counter(story-step);
    grid-row: 1 / span 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Clash Display', sans-serif;
    font-weight: 700;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    z-index: 1;
}

.story-phase--during .story-step::before {
    background: var(--gradient);
    border-color: transparent;
}

/* vertical connector between the number bubbles */
.story-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.story-step-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.35;
    padding-top: 6px;
    margin: 0;
}

.story-step-text {
    margin: 4px 0 0;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.55;
}

.story-note {
    margin: 28px auto 0;
    max-width: 720px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray);
}

/* ---------- With / without comparison ---------- */

.story-compare {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.story-compare-col {
    padding: 26px 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.story-compare-col--with {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(160deg, rgba(16, 185, 129, 0.08), rgba(124, 58, 237, 0.06));
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.08);
}

.story-compare-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 16px;
    color: var(--gray);
}

.story-compare-col--with .story-compare-title {
    color: var(--success);
}

.story-compare-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.story-compare-list li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 16px;
    line-height: 1.45;
}

.story-compare-list li::before {
    content: '✕';
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 61, 113, 0.14);
    color: #ff8fa8;
}

.story-compare-col--with .story-compare-list li::before {
    content: '✓';
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
}

.story-compare-col--without .story-compare-list li {
    color: rgba(250, 250, 250, 0.7);
}

/* ---------- Role cards (guests / moderators / owner) ---------- */

.story-roles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.story-role {
    padding: 26px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-role-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    background: rgba(124, 58, 237, 0.15);
}

.story-role h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.story-role > p {
    margin: 0 0 14px;
    color: var(--gray);
    font-size: 15px;
    line-height: 1.6;
}

.story-role-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.story-role-list li {
    position: relative;
    padding-left: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.story-role-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success);
    font-weight: 800;
}

.story-role-tag {
    display: inline-block;
    margin-bottom: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(252, 211, 77, 0.35);
    color: #FCD34D;
}

/* ---------- Callout (no-DJ block) ---------- */

.story-callout {
    padding: 32px 22px;
    border-radius: 28px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    background: linear-gradient(135deg, rgba(255, 61, 113, 0.1), rgba(124, 58, 237, 0.14));
    text-align: center;
}

.story-callout h2 {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(28px, 6vw, 44px);
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0 0 16px;
}

.story-callout p {
    margin: 0 auto 14px;
    max-width: 700px;
    font-size: 17px;
    line-height: 1.65;
    color: rgba(250, 250, 250, 0.85);
}

.story-callout p:last-child {
    margin-bottom: 0;
    font-size: 15px;
    color: var(--gray);
}

/* ---------- Use cases ---------- */

.story-usecases {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.story-usecase {
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: border-color .3s ease, transform .3s ease;
}

.story-usecase:hover {
    border-color: rgba(255, 61, 113, 0.3);
    transform: translateY(-3px);
}

.story-usecase-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 10px;
}

.story-usecase h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
}

.story-usecase p {
    margin: 0;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Provider status (landing integrations + how-it-works) ---------- */

.integration-status-badge--available {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.integration-status-badge--beta {
    background: rgba(252, 211, 77, 0.12);
    border: 1px solid rgba(252, 211, 77, 0.4);
    color: #FCD34D;
}

.integrations-footnote {
    max-width: 640px;
    margin: 28px auto 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray);
}

.story-provider-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.story-provider {
    padding: 24px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-provider-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.story-provider-head h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.story-provider-head .integration-status-badge {
    margin-top: 0;
}

.story-provider > p {
    margin: 0 0 12px;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.6;
}

.story-provider-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #c4b5fd;
    text-decoration: none;
}

.story-provider-link:hover {
    text-decoration: underline;
}

/* ---------- Tablet / desktop ---------- */

@media (min-width: 768px) {
    .story-section {
        padding-top: 88px;
        padding-bottom: 88px;
    }

    .story-phases,
    .story-compare {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .story-phase,
    .story-compare-col {
        padding: 36px 32px;
    }

    .story-roles {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-usecases {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-provider-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-callout {
        padding: 56px 48px;
    }
}

@media (min-width: 1024px) {
    .story-usecases {
        grid-template-columns: repeat(3, 1fr);
    }

    .story-provider-grid.story-provider-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .story-roles.story-roles--3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 400px) {
    .story-pillar {
        font-size: 12px;
        padding: 8px 12px;
    }

    .story-phase-title {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-eq span {
        animation: none;
        transform: scaleY(.7);
    }

    .story-usecase {
        transition: none;
    }
}

/* h2 inherit a dark heading colour from the global reset on some pages */
.story-section .section-title,
.solution .section-title,
.story-callout h2 {
    color: var(--light);
}

.story-provider .story-role-list {
    gap: 10px;
}

.story-provider .story-role-list li {
    color: rgba(250, 250, 250, 0.85);
}

/* ---------- Integrations grid: statuses wrap instead of overflowing ---------- */

.integration-logo-card .integration-status-badge,
.integration-logo-card .integration-premium-badge {
    white-space: normal;
    text-align: center;
    justify-content: center;
    max-width: 100%;
    line-height: 1.25;
    font-size: 11px;
}

/* available / beta first, coming soon last */
.integration-logo-card.is-soon {
    order: 2;
}

@media (max-width: 480px) {
    .integration-logos-grid {
        gap: 24px 12px;
    }

    .integration-logo-card {
        width: 100px;
    }
}

/* ==========================================================================
   /how-playback-works — tagline, playback/moderation diagram, comparison table
   ========================================================================== */

.pb-tagline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 28px auto 0;
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(17px, 2.6vw, 22px);
    font-weight: 600;
    line-height: 1.35;
}

.pb-tagline span:nth-child(1) { color: #c4b5fd; }
.pb-tagline span:nth-child(2) { color: #f9a8d4; }
.pb-tagline span:nth-child(3) { color: #93c5fd; }

.pb-teaser-cta {
    text-align: center;
    margin: 28px 0 0;
}

.pb-teaser-cta .story-provider-link {
    margin-top: 0;
    font-size: 16px;
}

/* ---------- Diagram ---------- */

.pb-diagram {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.pb-lane {
    padding: 24px 20px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.pb-lane--playback {
    border-color: rgba(124, 58, 237, 0.45);
    background: linear-gradient(160deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.05));
}

.pb-lane--moderation {
    border-color: rgba(59, 130, 246, 0.35);
    background: linear-gradient(160deg, rgba(59, 130, 246, 0.08), rgba(124, 58, 237, 0.05));
}

.pb-lane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 18px;
}

.pb-lane-head h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 19px;
    font-weight: 700;
    margin: 0;
    color: var(--light);
}

.pb-lane-badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.18);
}

.pb-flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.pb-node {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pb-node + .pb-node {
    margin-top: 26px;
}

/* arrow between two nodes */
.pb-node + .pb-node::before {
    content: '↓';
    position: absolute;
    top: -24px;
    left: 28px;
    width: 20px;
    text-align: center;
    font-size: 18px;
    line-height: 22px;
    color: #c4b5fd;
}

.pb-node-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.2);
}

.pb-node-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pb-node-body strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--light);
}

.pb-node-body span {
    font-size: 13px;
    line-height: 1.45;
    color: var(--gray);
}

.pb-caption {
    margin-top: 24px;
    text-align: center;
}

/* ---------- Comparison table: cards on mobile, table from 768px ---------- */

.pb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.pb-table,
.pb-table tbody,
.pb-table tr,
.pb-table th,
.pb-table td {
    display: block;
}

.pb-table {
    width: 100%;
    border-collapse: collapse;
}

.pb-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.pb-table tbody tr {
    margin-bottom: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.pb-table tbody th {
    margin-bottom: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #c4b5fd;
}

.pb-table td {
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    line-height: 1.5;
    color: rgba(250, 250, 250, 0.88);
}

.pb-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray);
}

.pb-table-status {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--success);
}

@media (min-width: 768px) {
    .pb-diagram {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .pb-lane {
        padding: 28px 26px;
    }

    .pb-table {
        display: table;
        border-spacing: 0;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 20px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.02);
    }

    .pb-table thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .pb-table tbody { display: table-row-group; }
    .pb-table tr { display: table-row; }
    .pb-table th,
    .pb-table td { display: table-cell; }

    .pb-table tbody tr {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
    }

    .pb-table thead th {
        padding: 18px 16px;
        text-align: left;
        font-family: 'Clash Display', sans-serif;
        font-size: 17px;
        font-weight: 700;
        color: var(--light);
        background: rgba(124, 58, 237, 0.12);
        vertical-align: top;
    }

    .pb-table tbody th {
        margin: 0;
        width: 22%;
        padding: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        font-size: 13px;
        letter-spacing: 0.4px;
        text-transform: none;
        color: var(--light);
        vertical-align: top;
    }

    .pb-table td {
        padding: 16px;
        vertical-align: top;
    }

    .pb-table td::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pb-node { transition: none; }
}
