/* Fun Lab phone app. The printed card is the loud thing on every screen; everything around it stays quiet. */
:root {
    --ground: #EEF0F6;
    --surface: #FFFFFF;
    --ink: #151A33;
    --muted: #5B6282;
    --line: #D5D9E6;
    --accent: #2747F5;
    --accent-ink: #FFFFFF;
    --ok: #0E8F6A;
    --demo-bg: #FFEFCF;
    --demo-ink: #6B3900;
    --danger: #B3261E;
    --gutter: 20px;
    --card-radius: 3.7% / 5.9%; /* CR80 corner: 3.18 mm on an 85.6 x 54 mm card */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--ground);
    color: var(--ink);
    font: 400 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
    background: var(--ink);
    color: #fff;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.proto {
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--demo-bg);
    color: var(--demo-ink);
    font-size: 13px;
    font-weight: 650;
}

main {
    max-width: 460px;
    margin: 0 auto;
    padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    outline: none;
}

h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.05;
    font-weight: 760;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; font-weight: 720; letter-spacing: -0.015em; }

p { margin: 0 0 14px; }

.lede { color: var(--muted); max-width: 34ch; }

.small { font-size: 15px; color: var(--muted); }

.step { margin: 0 0 6px; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── The card ─────────────────────────────────────────────────────────────── */

.card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2022 / 1274;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: #C9CEDD;
    box-shadow: 0 1px 1px rgba(21, 26, 51, .18), 0 10px 24px -8px rgba(21, 26, 51, .38);
}

.card img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* A moving gloss so the artwork reads as a physical card, not a picture. --gx is set by tilt or touch. */
.card.gloss::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .34) 48%, transparent 62%);
    transform: translateX(calc((var(--gx, .5) - .5) * 120%));
    pointer-events: none;
}

.fan { position: relative; height: 250px; margin: 26px 0 30px; }
.fan .card { position: absolute; left: 9%; width: 82%; }
.fan .card:nth-child(1) { top: 0; transform: rotate(-9deg); }
.fan .card:nth-child(2) { top: 26px; transform: rotate(-2deg); }
.fan .card:nth-child(3) { top: 54px; transform: rotate(6deg); }

.designs { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 22px; }

.design { display: block; color: inherit; text-decoration: none; border-radius: 14px; }
.design .name { display: flex; justify-content: space-between; align-items: baseline; margin-top: 9px; font-weight: 650; }
.design .name span { font-size: 15px; font-weight: 400; color: var(--muted); }

.thumb { width: 124px; flex: none; }

/* ── Controls ─────────────────────────────────────────────────────────────── */

.btn {
    display: block;
    width: 100%;
    min-height: 54px;
    padding: 14px 18px;
    border: 2px solid var(--accent);
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 680;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn.quiet { background: transparent; color: var(--accent); }
.btn.plain { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; min-height: 44px; }
.btn[disabled] { opacity: .5; cursor: default; }

.actions { display: grid; gap: 10px; margin-top: 24px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* main takes focus on each screen change so a screen reader starts at the top; it is not a control and needs no ring. */
main:focus-visible { outline: none; }

.choices { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }

.choice { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice strong { display: block; }

/* ── Summary, pass, status ────────────────────────────────────────────────── */

.sheet { margin-top: 18px; padding: 4px 16px; border-radius: 14px; background: var(--surface); }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--muted); }
.row dd { margin: 0; font-weight: 600; text-align: right; }
dl { margin: 0; }
s { color: var(--muted); font-weight: 400; }

.demo {
    margin: 18px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--demo-bg);
    color: var(--demo-ink);
    font-weight: 600;
}
.demo span { display: block; font-weight: 400; }

.picked { display: flex; gap: 14px; align-items: center; margin-top: 18px; }

.pass { margin-top: 18px; padding: 22px 22px 18px; border-radius: 18px; background: var(--surface); text-align: center; }
.qr { width: min(100%, 300px); margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.ref { margin: 14px 0 2px; font-size: 22px; font-weight: 720; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.code { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
.code summary { min-height: 32px; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; }
.code p { margin: 8px 0 4px; }
.code p:first-of-type { font: 600 20px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; word-spacing: .3em; }

.stages { list-style: none; margin: 22px 0 0; padding: 0; }
.stages li { position: relative; padding: 0 0 22px 38px; color: var(--muted); }
.stages li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--ground);
}
.stages li::after { content: ""; position: absolute; left: 13px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.stages li:last-child { padding-bottom: 0; }
.stages li:last-child::after { display: none; }
.stages li.done { color: var(--ink); }
.stages li.done::before { border-color: var(--ok); background: var(--ok); }
.stages li.now { color: var(--ink); font-weight: 680; }
.stages li.now::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(39, 71, 245, .18); }

.notice { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); border-left: 5px solid var(--danger); }

.foot { margin-top: 30px; font-size: 14px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
    .card.gloss::after { transition: transform .18s ease-out; }
    .stages li.now::before { animation: pulse 1.8s ease-in-out infinite; }
    @keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(39, 71, 245, .08); } }
}
