/* ================================================================
   /demo page — standalone showcase styles
   Layered on top of styles.css + legal-page.css + bw-demo.css.
   Scoped under .demo-page so changes don't leak to other subpages.
   ================================================================ */

/* Header fix is now in styles.css under .subpage-body — keeps
   all subpages consistent without per-page duplication. */

/* ── Demo stage ── */
.demo-page .demo-stage {
    /* Pull the demo up so its chrome bar overlaps the hero gradient
       — removes the hard horizontal edge at the section boundary. */
    margin-top: calc(-1 * var(--space-6));
    padding: var(--space-3) 0 var(--space-8);
    position: relative;
    z-index: 1;
}

.demo-page .demo-stage .container {
    max-width: 1180px;
}

.demo-page .demo-frame {
    position: relative;
    border-radius: 14px;
    /* No overflow:hidden — lets the inner bw-demo own its corners
       and avoids the double-radius ring against light backgrounds. */
    box-shadow:
        0 24px 64px rgba(10, 10, 10, 0.08),
        0 4px 12px rgba(10, 10, 10, 0.06);
}

.demo-page .demo-frame .bw-demo {
    /* Match the wrapper's radius so the demo fills its frame cleanly. */
    border-radius: 14px;
}

/* ── CTA buttons: keep "pandō" in its lowercase form ── */
.demo-btn-natural {
    text-transform: none;
    letter-spacing: 0.02em;
}

/* ── Three-up cards ── */
.demo-page .demo-aside {
    max-width: 880px;
    margin: var(--space-6) auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.demo-page .demo-aside-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-3) var(--space-4);
    background: var(--surface-glass);
}

.demo-page .demo-aside-card .lbl {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: var(--tracking-spread);
    color: var(--color-text-tertiary);
    margin: 0 0 4px;
}

.demo-page .demo-aside-card .val {
    /* Sans here — keeps serif privileged for H1 + CTA heading,
       so card titles read as support copy not sub-headlines. */
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--color-ink);
    margin: 0 0 6px;
}

.demo-page .demo-aside-card .note {
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.45;
    margin: 0;
}

/* ── CTA box: trim padding & align width with the cards ── */
.demo-page .legal-cta-box {
    max-width: 880px;
    padding: var(--space-4) var(--space-5);
}

.demo-page .legal-cta-box h2 {
    margin-bottom: var(--space-3);
}

.demo-page .legal-cta-box p {
    margin-bottom: var(--space-3);
}

/* ── Tablet: 3 cards → 2 cards ── */
@media (max-width: 880px) {
    .demo-page .demo-aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .demo-page .demo-aside-card:last-child {
        grid-column: 1 / -1;
    }
}

/* ── Mobile: stack everything ── */
@media (max-width: 560px) {
    .demo-page .demo-aside {
        grid-template-columns: 1fr;
    }
    .demo-page .demo-aside-card:last-child {
        grid-column: auto;
    }

    /* Stack the bw-demo's two panes vertically so neither pane
       gets squeezed to ~150px (where C# code becomes unreadable). */
    .demo-page .bw-demo .bw-viewport {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1px 1fr;
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .demo-page .bw-demo .bw-pane {
        min-height: 200px;
    }
    .demo-page .bw-demo .bw-divider {
        width: 100%;
        height: 1px;
    }
    .demo-page .bw-demo .bw-band {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        row-gap: var(--space-2);
    }
    .demo-page .bw-demo .bw-band-divider {
        display: none;
    }
}
