/* The wall preview and the paywall behind it.
 *
 * Loads after display.css (which owns the tokens and the .ad-* tile styles) and
 * site.css. Nothing here restyles a tile — tiles come from the shared renderer
 * and must look identical to the ones on a real board, or the preview is
 * advertising a product that does not exist.
 */

/* ── The wall ────────────────────────────────────────────────────────────── */
.wall { max-width: 980px; margin: 0 auto; }

.wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}

/* Each tile needs its own size container: the shared renderer sizes everything
   in cqmin so one tile is legible small and on a wall TV. Without this the
   container units have nothing to resolve against and the type collapses. */
.wall-cell { animation: wall-in 0.45s ease both; }
.wall-cell:nth-child(2) { animation-delay: 0.06s; }
.wall-cell:nth-child(3) { animation-delay: 0.12s; }
.wall-cell:nth-child(4) { animation-delay: 0.18s; }

.wall-tile {
    position: relative;
    container-type: size;
    height: 176px;
    background: #131316;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}

@keyframes wall-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}

/* Their own agent, first and marked. The point of the preview is "this is
   YOUR wall", which fails if their display is indistinguishable from the
   demo ones beside it. */
.wall-tile--mine {
    border-color: rgba(79, 195, 247, 0.45);
    box-shadow: 0 0 0 1px rgba(79, 195, 247, 0.18);
}

/* Above the tile, never over it. The ghost variant keeps the other cells the
   same height so the grid stays aligned. */
.wall-tag {
    display: block;
    font-family: var(--ad-mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ad-running);
    margin: 0 0 5px 2px;
    line-height: 1.4;
}

.wall-tag--ghost { visibility: hidden; }

/* ── The paywall ─────────────────────────────────────────────────────────── */
.pay {
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Held back for a beat so the wall is what gets looked at first. Land them
   together and the whole thing reads as a paywall with decoration. */
.pay.is-pending {
    opacity: 0;
    transform: translateY(8px);
}

.pay h2 {
    font-family: var(--ad-head);
    font-size: clamp(20px, 3vw, 27px);
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.pay-note {
    font-size: 14.5px;
    color: var(--ad-dim);
    max-width: 52ch;
    margin: 0 auto 26px;
    line-height: 1.6;
}

.pay-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    max-width: 640px;
    margin: 0 auto 18px;
    text-align: left;
}

.pay-card {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 13px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}

.pay-card[data-tier="personal"] { border-color: rgba(79, 195, 247, 0.35); }

.pay-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.pay-name {
    font-family: var(--ad-head);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.pay-price {
    font-family: var(--ad-head);
    font-size: 26px;
    font-weight: 700;
    color: var(--ad-running);
    line-height: 1;
}
.pay-price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--ad-dim);
}

.pay-card[data-tier="team"] .pay-price { color: var(--ad-text); }

.pay-pitch {
    font-size: 13.5px;
    color: var(--ad-text-2);
    line-height: 1.55;
    margin-bottom: 14px;
}

.pay-features {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    flex: 1;
}

.pay-features li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ad-dim);
    margin-bottom: 7px;
}

.pay-features li::before {
    content: '';
    position: absolute;
    left: 3px; top: 7px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

.pay-go { width: 100%; justify-content: center; }
.pay-go[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Shown only if checkout fails to open. The reassurance matters more than the
   error: someone who just clicked a price button needs to know their card was
   not touched. */
.pay-error {
    margin-top: 9px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #f7c667;
}

.pay-small {
    font-family: var(--ad-mono);
    font-size: 11px;
    color: var(--ad-dim);
    opacity: 0.75;
}

/* ── Overlay (display page) ──────────────────────────────────────────────── */
.wall-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(4, 4, 9, 0.86);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    animation: pay-fade 0.25s ease both;
}

@keyframes pay-fade { from { opacity: 0; } to { opacity: 1; } }

.wall-sheet {
    position: relative;
    width: 100%;
    max-width: 1020px;
    background: var(--ad-bg);
    border: 1px solid var(--ad-border);
    border-radius: 18px;
    padding: 34px 30px 30px;
}

.wall-close {
    position: absolute;
    top: 14px; right: 16px;
    background: transparent;
    border: 1px solid var(--ad-border);
    color: var(--ad-dim);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}
.wall-close:hover { color: var(--ad-text); border-color: rgba(255, 255, 255, 0.25); }

@media (max-width: 640px) {
    .wall-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .wall-tile { height: 150px; }
    .wall-sheet { padding: 30px 16px 22px; border-radius: 14px; }
    .pay-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .wall-tile, .wall-overlay { animation: none; }
    .pay { transition: none; }
    .pay.is-pending { opacity: 1; transform: none; }
}
