/* ── The ask sheet — js/ask-sheet.js (shared) ─────────────────────────────
   One sheet for every signed-out surface (planner via js/planner/preview-ask.js,
   grocery via js/grocery/shop-window.js). Class names stay .pl-ask* so the
   planner's measured contrast work carries over unchanged. Relies on
   .planner__action from css/planner.css — every page that links this file
   links planner.css too. No lock glyph: strangers see no padlocks (AGENTS.md).
   A tap on the surface opens ONE sheet over it: the whole table goes
   soft behind the card on the house scrim glass (founder-locked 2026-09-06 —
   the earlier "keep the table lit, no blur" call was rejected), the card names
   what was touched and offers Sign up / Log in / close. Desktop = centred
   card; ≤768px = bottom sheet on the house .rasa-sheet motion. Closed by
   default; nothing here paints until a plate is tapped. */
.pl-ask-scrim {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: var(--scrim-tint, rgba(4, 6, 10, 0.5));
    -webkit-backdrop-filter: blur(0) saturate(100%);
    backdrop-filter: blur(0) saturate(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* The blur arrives WITH the tint, not after it — a scrim that fades in and
       then snaps sharp-to-soft reads as two events. */
    transition: opacity 0.35s ease, visibility 0.35s,
                backdrop-filter 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                -webkit-backdrop-filter 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.pl-ask-scrim.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-backdrop-filter: var(--scrim-glass, blur(24px) saturate(150%));
    backdrop-filter: var(--scrim-glass, blur(24px) saturate(150%));
}

.pl-ask {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 9600;
    width: min(460px, calc(100vw - 32px));
    padding: 36px 36px 28px;
    background: rgba(14, 17, 24, 0.97);
    border: 1px solid rgba(245, 166, 35, 0.16);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.97);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}
.pl-ask.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.pl-ask:focus { outline: none; }

.pl-ask__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: inherit;
    transition: background 0.3s ease, transform 0.3s ease;
}
.pl-ask__close svg { width: 24px; height: 24px; }
.pl-ask__close:hover { background: rgba(245, 166, 35, 0.08); transform: rotate(90deg); }
.pl-ask__close:focus-visible { outline: 2px solid var(--color-science, #F5A623); outline-offset: 2px; }

.pl-ask__eyebrow {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-science, #F5A623);
    margin-bottom: 10px;
}

.pl-ask__title {
    font-family: var(--font-editorial);
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1.15;
    color: var(--color-text-primary);
    margin: 0 0 12px;
}

.pl-ask__body {
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin: 0 0 24px;
}

.pl-ask__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pl-ask__row .planner__action { text-decoration: none; min-height: 44px; }

.pl-ask__foot {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--color-text-subtle, rgba(255, 255, 255, 0.4));
    margin: 18px 0 0;
}

@media (max-width: 768px) {
    .pl-ask {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: auto;
        border-radius: 16px 16px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
        transform: translateY(105%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
        opacity: 1;
    }
    .pl-ask.open { transform: translateY(0); }
    .pl-ask__row { flex-direction: column; }
    .pl-ask__row .planner__action { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .pl-ask, .pl-ask-scrim, .pl-ask__close { transition: none; }
}

/* The ask's own states — measured 2026-09-05 against the card surface
   (#0E1118): the generic .planner__action hover/focus rule was giving the
   primary door a 12% fill under dark text (unreadable) and the browser's
   blue ring; body/foot text measured 3.81:1 and 2.23:1. Every line here
   must clear 4.5:1 — the same floor as everywhere else. */
.pl-ask__body { color: rgba(255, 255, 255, 0.8); }
.pl-ask__foot { color: rgba(255, 255, 255, 0.62); }
.pl-ask .planner__action--primary:hover,
.pl-ask .planner__action--primary:focus-visible {
    background: linear-gradient(135deg, #FFB63A, #E09420); /* the primary's own hover, not the generic 12% wash */
    color: #080C14;
}
.pl-ask .planner__action:focus-visible {
    outline: 2px solid rgba(245, 166, 35, 0.9);
    outline-offset: 3px;
    box-shadow: none;
}
.pl-ask .planner__action--primary:focus-visible {
    outline-color: var(--color-text-primary, #F2DDD0);
}
