/* The interactive demo: a MacBook mockup whose menu bar runs CalTransact.
   Everything inside the mockup sizes in em against .macbook's font-size, so the
   whole illustration scales with the viewport instead of breaking. */

/* ── The site's two appearances ─────────────────────
   The landing page's look now lives in Tailwind utilities (assets/tw.css) that
   reference these variables, so flipping data-site-theme re-skins everything.
   Only what utilities cannot express stays in this file: the variables, the
   theme toggle's icon swap, card surfaces with theme-dependent shadows, the
   privacy list's marks — and the whole mockup below. */

body.demo-page {
    --site-bg-a: #161a24;
    --site-bg-b: #0d0f14;
    --site-text: #ffffff;
    --site-secondary: rgba(255, 255, 255, 0.74);
    --site-faint: rgba(255, 255, 255, 0.56);
    --site-line: rgba(255, 255, 255, 0.14);
    --site-card: rgba(255, 255, 255, 0.07);
    --site-icon: rgba(255, 255, 255, 0.86);
    --site-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --site-card-shadow-hover: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 26px rgba(0, 0, 0, 0.35);
    --blue: #5b8dff;
    --blue-dark: #7ba4ff;
    /* The brand accent: the app's own amber. It marks every signpost on the
       page — eyebrows, step numbers, feature chips, checkmarks — and it fills
       the one hot element, the download button. Blue stays inside the demo
       panel, where it belongs to the app. */
    --site-accent: #ffb026;
    --site-accent-soft: rgba(255, 176, 38, 0.13);
    --site-cta: #f7a418;
    --site-cta-hover: #ffb52e;
    --site-cta-text: #221403;
    --site-cta-glow: rgba(247, 164, 24, 0.38);
    --site-h1-from: #ffffff;
    --site-h1-to: #c9cedb;
    /* site.css's own variables, re-skinned for the dark (the FAQ and any other
       element-level rule from site.css paints with these). */
    --text: var(--site-text);
    --text-secondary: var(--site-secondary);
    --card: var(--site-card);
    --border: var(--site-line);
    /* The hero's halo: one full-bleed backdrop washing over the headline and
       the mockup together, fading before the fold. */
    --site-halo-a: rgba(122, 155, 235, 0.16);
    --site-halo-b: rgba(151, 122, 225, 0.11);
    background-color: var(--site-bg-b);
    background-image:
        radial-gradient(620px 340px at 78% -60px, var(--site-halo-b), transparent 72%),
        radial-gradient(860px 460px at 40% -100px, var(--site-halo-a), transparent 74%),
        radial-gradient(1100px 520px at 50% -80px, var(--site-bg-a), var(--site-bg-b) 62%);
    color: var(--site-text);
    min-height: 100vh;
}

/* Chromium samples a fixed element's backdrop-filter input from the root — and
   a background that reaches the canvas only by propagation from <body> is left
   out, so the frosted masthead blurred a white void (its square input box
   showed at the pill's rounded caps). Painting the same layers on <html>
   itself puts them inside the sampled root; <body> keeps its copy, so every
   engine sees the same picture. */
html:has(body.demo-page) {
    background-color: var(--site-bg-b, #0d0f14);
    background-image:
        radial-gradient(620px 340px at 78% -60px, rgba(151, 122, 225, 0.11), transparent 72%),
        radial-gradient(860px 460px at 40% -100px, rgba(122, 155, 235, 0.16), transparent 74%),
        radial-gradient(1100px 520px at 50% -80px, #161a24, #0d0f14 62%);
}

html:has(body.demo-page[data-site-theme="light"]) {
    background-color: #f7f8fa;
    background-image:
        radial-gradient(620px 340px at 78% -60px, rgba(214, 186, 248, 0.34), transparent 72%),
        radial-gradient(860px 460px at 40% -100px, rgba(176, 212, 253, 0.5), transparent 74%),
        radial-gradient(1100px 520px at 50% -80px, #eef1f6, #f7f8fa 62%);
}

body.demo-page[data-site-theme="light"] {
    --site-bg-a: #eef1f6;
    --site-bg-b: #f7f8fa;
    --site-text: #101418;
    --site-secondary: rgba(16, 20, 24, 0.72);
    --site-faint: rgba(16, 20, 24, 0.5);
    --site-line: rgba(16, 20, 24, 0.12);
    --site-card: #ffffff;
    --site-icon: rgba(16, 20, 24, 0.62);
    --site-card-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 2px 8px rgba(16, 24, 40, 0.06);
    --site-card-shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.08), 0 10px 24px rgba(16, 24, 40, 0.1);
    --blue: #3F86F7;
    --blue-dark: #1F63DE;
    --site-accent: #9a5b00;
    --site-accent-soft: rgba(194, 120, 26, 0.12);
    --site-cta: #f59e0b;
    --site-cta-hover: #e8890c;
    --site-cta-text: #2b1903;
    --site-cta-glow: rgba(245, 158, 11, 0.35);
    --site-h1-from: #0b0e13;
    --site-h1-to: #454c58;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --card: #f5f5f7;
    --border: rgba(0, 0, 0, 0.07);
    --site-halo-a: rgba(176, 212, 253, 0.5);
    --site-halo-b: rgba(214, 186, 248, 0.34);
    background-color: var(--site-bg-b);
    background-image:
        radial-gradient(620px 340px at 78% -60px, var(--site-halo-b), transparent 72%),
        radial-gradient(860px 460px at 40% -100px, var(--site-halo-a), transparent 74%),
        radial-gradient(1100px 520px at 50% -80px, var(--site-bg-a), var(--site-bg-b) 62%);
}

/* The theme toggle: utilities shape it; these swap its icon per appearance. */
[data-site-theme-toggle] svg {
    width: 17px;
    height: 17px;
}

[data-site-theme-toggle] .theme-sun { display: none; }
[data-site-theme-toggle] .theme-moon { display: block; }
body.demo-page[data-site-theme="light"] [data-site-theme-toggle] .theme-sun { display: block; }
body.demo-page[data-site-theme="light"] [data-site-theme-toggle] .theme-moon { display: none; }

/* The display headline: a vertical light gradient clipped to the glyphs, so
   the type reads lit-from-above instead of flat white. */
body.demo-page h1 {
    color: var(--site-h1-from);
}

@supports (-webkit-background-clip: text) {
    body.demo-page h1 {
        background: linear-gradient(180deg, var(--site-h1-from), var(--site-h1-to));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* The brand's amber, even on selection. */
body.demo-page ::selection {
    background: rgba(247, 164, 24, 0.3);
}
body.demo-page[data-site-theme="light"] ::selection {
    background: rgba(217, 119, 6, 0.24);
}

/* Keyboard chips: ⇧⌥E and friends. */
body.demo-page kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: var(--site-card);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.86em;
    font-weight: 600;
    line-height: 1.5;
    color: var(--site-text);
    white-space: nowrap;
}

/* The step-1 shortcut tray: real keycaps with the word each symbol means, then what
   the combo does. Scoped under .shortcut (two classes) so the plain kbd rule above
   keeps winning for inline mentions elsewhere. */
.shortcut {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    margin-top: auto; /* pins the tray to the card's bottom edge */
    padding: 13px 15px 11px;
    border: 1px solid var(--site-line);
    border-radius: 12px;
    background: var(--site-accent-soft);
}
.shortcut-keys {
    display: flex;
    gap: 11px;
}
.key-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.shortcut .key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 37px;
    padding: 0;
    border: 1px solid var(--site-line);
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: var(--site-text);
    white-space: nowrap;
}
.shortcut .key-word {
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--site-faint);
}
.shortcut-action {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--site-secondary);
}
.shortcut .shortcut-arrow {
    color: var(--site-accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}
body.demo-page[data-site-theme="light"] .shortcut .key {
    border-color: rgba(15, 23, 42, 0.18);
    background: linear-gradient(180deg, #ffffff, #eef0f5);
    box-shadow: 0 2px 0 rgba(15, 23, 42, 0.16), inset 0 1px 0 #ffffff;
}

/* Film grain over the whole stage: the large halo gradients band otherwise,
   and a whisper of noise reads as material rather than render. */
body.demo-page::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* The hero badge's live dot: a quiet amber heartbeat. */
.badge-dot {
    position: relative;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--site-accent);
}

.badge-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 1px solid var(--site-accent);
    opacity: 0.55;
    animation: badge-ping 2.4s ease-out infinite;
}

@keyframes badge-ping {
    0% { transform: scale(0.6); opacity: 0.55; }
    70%, 100% { transform: scale(1.5); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .badge-dot::after {
        animation: none;
        opacity: 0.35;
    }
}

/* The closing download band's warm ceiling. */
.cta-band::before {
    content: "";
    position: absolute;
    inset: -45% -18% auto;
    height: 130%;
    pointer-events: none;
    background: radial-gradient(50% 60% at 50% 0%, var(--site-cta-glow), transparent 70%);
    opacity: 0.55;
}

/* Card surfaces: fill plus a theme-dependent material — a hairline top light
   in the dark, paper with a shadow in the light. */
body.demo-page .surface {
    background: var(--site-card);
    box-shadow: var(--site-card-shadow);
}

body.demo-page .card-lift {
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body.demo-page .card-lift:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--site-text) 22%, transparent);
    box-shadow: var(--site-card-shadow-hover);
}

/* FAQ disclosure: the legacy marker was a "+" swapping to an en-dash with no
   fixed box — the dash read as a stray hyphen and the row shifted on toggle.
   A fixed chip holds a true plus/minus, so nothing moves but the glyph.
   The flex row is restated here because Tailwind's unlayered preflight resets
   summary to display: list-item, which otherwise stacks the chip below. */
body.demo-page summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 2px 0;
}
body.demo-page summary::after {
    content: "+";
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--site-line);
    border-radius: 9px;
    font-size: 17px;
    font-weight: 400;
    line-height: 1;
    color: var(--site-secondary);
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
body.demo-page summary:hover::after {
    color: var(--site-text);
    border-color: color-mix(in srgb, var(--site-text) 30%, transparent);
}
body.demo-page details[open] summary::after {
    content: "−";
    color: var(--site-text);
    background-color: color-mix(in srgb, var(--site-accent) 15%, transparent);
    border-color: transparent;
}

/* ── The masthead ────────────────────────────────────
   nagbar.app's floating pill: one dark glass bar, fixed with a breath of sky
   above it, centered — not a full-width strip. Frosted, ringed by a hairline,
   with a soft drop beneath. */

/* The pill floats free: neutralize site.css's generic frosted `nav` rule,
   which paints a full-width whitish band (fill + blur + hairline) behind it. */
.mast {
    position: fixed;
    inset: 12px 12px auto;
    z-index: 40;
    display: flex;
    justify-content: center;
    pointer-events: none;
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* No backdrop-filter here, deliberately: on a fixed element the owner's
   Chromium engine renders the blur's input as an opaque square box (white in
   dark mode, halo-tinted in light) instead of a frost — the pill's rounded
   ends betrayed it as a stray background band. A near-opaque fill looks the
   same at a glance and has nothing for any engine to mangle. */
.mast-row {
    pointer-events: auto;
    width: min(1060px, 100%);
    height: 52px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 8px 0 14px;
    border-radius: 18px;
    background: rgba(13, 15, 20, 0.92);
    color: var(--site-text);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 10px 30px -14px rgba(0, 0, 0, 0.5);
}

/* Light mode drops the bar at the top of the sky; once the page scrolls
   beneath it the pane fades back in (demo.js sets data-scrolled), so the
   links stay readable over content. Near-opaque, not frosted — the same
   fixed-element blur bug the dark pill dodges. */
body.demo-page[data-site-theme="light"] .mast-row {
    background: none;
    box-shadow: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

body.demo-page[data-site-theme="light"] .mast[data-scrolled] .mast-row {
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 10px 30px -14px rgba(0, 0, 0, 0.18);
}

.mast .mark {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--site-text);
}

.mast .mark img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.mast-links {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    font-size: 14px;
}

.mast-links a {
    text-decoration: none;
    color: var(--site-secondary);
    transition: color 0.15s ease;
    white-space: nowrap;
}

.mast-links a:hover {
    color: var(--site-text);
}

.mast-links .try-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--site-accent);
}

.mast-links .try-live:hover {
    color: var(--site-accent);
    opacity: 0.75;
}

.mast-end {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 18px;
}

.mast .iconbtn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: transparent;
    cursor: pointer;
    color: var(--site-secondary);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mast .iconbtn:hover {
    background: color-mix(in srgb, var(--site-text) 10%, transparent);
    color: var(--site-text);
}

.mast .act {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 15px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
    white-space: nowrap;
    background: var(--site-cta);
    color: var(--site-cta-text);
    transition: background-color 0.15s ease;
}

.mast .act:hover {
    background: var(--site-cta-hover);
}

/* Room for the brand and the pill's ends on smaller widths: the section links
   fold first, then the Try it live action; the download stays. */
@media (max-width: 899px) {
    .mast-links a:not(.try-live) {
        display: none;
    }
}

@media (max-width: 639px) {
    .mast-links {
        display: none;
    }

    .mast-end {
        margin-left: auto;
    }
}

/* ── Nagbar-style editorial pieces ───────────────────
   The numbered kicker, the amber headline fragment, beats lists and numbered
   points — the structural vocabulary of nagbar.app, in this site's tokens. */

/* The kicker: the section's number in amber tabular figures beside a muted
   label. Not uppercase — it reads as a contents line, not a shout. */
.kicker {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--site-secondary);
    margin-bottom: 10px;
}

.kicker .no {
    font-variant-numeric: tabular-nums;
    color: var(--site-accent);
    font-weight: 700;
}

/* The amber fragment inside a headline — one phrase carries the accent. */
.hl {
    color: var(--site-accent);
}

/* Beats: editorial bullet lists — an amber dot, a bold lead-in, a quiet
   description. The feature blocks speak in these, not icon cards. */
.beats {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.beats li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--site-secondary);
}

.beats li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.58em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--site-accent);
}

.beats b {
    color: var(--site-text);
    font-weight: 600;
}

/* Numbered points, as the privacy section tells its facts. */
.pn-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.pn-item .pn {
    flex: none;
    font-variant-numeric: tabular-nums;
    color: var(--site-accent);
    font-weight: 700;
    font-size: 17px;
}

/* "The app itself": real panel screenshots, dark beside light. The images carry
   their own rounded corners on transparency, so a drop-shadow (not a box one)
   follows the panel's shape; the light shot gets a hairline edge so its near-
   white panel reads against a light stage. */
.app-shots {
    display: grid;
    gap: 32px;
}

.app-shot-pair {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2.5vw, 18px);
}

.app-shot-pair img {
    display: block;
    width: min(300px, 42vw);
    height: auto;
    filter: drop-shadow(0 22px 40px rgba(4, 8, 16, 0.45));
}

body.demo-page[data-site-theme="light"] .app-shot-pair img {
    filter:
        drop-shadow(0 1px 0 rgba(16, 24, 40, 0.2))
        drop-shadow(0 18px 34px rgba(16, 24, 40, 0.2));
}

.app-shot figcaption {
    margin: 12px auto 0;
    max-width: 36em;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    color: var(--site-secondary);
}

.app-shot figcaption strong {
    color: var(--site-text);
    font-weight: 600;
}

#demo {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 24px 0;
    width: 100%;
}

/* Anchored sections and the first-open FAQ entry land clear of the floating
   masthead when jumped to. */
body.demo-page :is(section, details)[id] {
    scroll-margin-top: 88px;
}

.macbook {
    /* A ~28px menu bar and ~18px screen corners at the 16px base size. */
    --menu-height: 1.75em;
    --screen-radius: 1.4em;
    --glass-radius: 0.9em;
    font-size: clamp(8px, 1.25vw, 16px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0 auto;
    width: min(64em, 100%);
    position: relative;
    z-index: 0;
}

/* Depth: a soft halo behind the lid and a floor shadow under the hinge, so
   the mockup sits in light instead of floating on the page. */
/* No horizontal bleed on the halo: a positioned child sticking past its
   parent widens the page's scroll area (the phone pass caught it). */
.macbook::before {
    content: "";
    position: absolute;
    inset: -14% 0 -22%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(52% 46% at 42% 30%, rgba(247, 164, 24, 0.1), transparent 70%),
        radial-gradient(48% 44% at 66% 24%, rgba(91, 141, 255, 0.09), transparent 70%);
}

.macbook::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -1.6em;
    height: 1.8em;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(50% 50% at 50% 50%, rgba(4, 8, 16, 0.42), transparent 72%);
}

body.demo-page[data-site-theme="light"] .macbook::before {
    background:
        radial-gradient(52% 46% at 42% 30%, rgba(245, 158, 11, 0.14), transparent 70%),
        radial-gradient(48% 44% at 66% 24%, rgba(63, 134, 247, 0.1), transparent 70%);
}

body.demo-page[data-site-theme="light"] .macbook::after {
    background: radial-gradient(50% 50% at 50% 50%, rgba(30, 39, 62, 0.22), transparent 72%);
}

/* The lid: dark aluminum bezel around a rounded display. */
.macbook-screen {
    position: relative;
    padding: 1.15em 1.15em 1.3em;
    border-radius: calc(var(--screen-radius) + 0.5em);
    background: linear-gradient(180deg, #2a2d31, #1a1c1f 30%, #141619);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.08),
        0 1.5em 3em -1em rgba(15, 23, 42, 0.5);
}

.macbook-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16%;
    height: 1.05em;
    background: #0b0c0e;
    border-radius: 0 0 0.75em 0.75em;
}

/* The display: a quiet, near-black desktop — deep graphite with a whisper of
   warm light low on the screen and a cool breath high right, so the panel sits
   in light without any wallpaper competing with it. */
.macbook-desktop {
    position: relative;
    aspect-ratio: 16 / 10.4;
    border-radius: var(--glass-radius);
    overflow: hidden;
    background:
        radial-gradient(120% 85% at 50% 115%, rgba(247, 164, 24, 0.07), transparent 58%),
        radial-gradient(95% 70% at 84% -12%, rgba(101, 126, 190, 0.08), transparent 62%),
        linear-gradient(180deg, #111318 0%, #0b0d11 55%, #07080a 100%);
}

/* A faint edge vignette, so the desktop reads as a lit display rather than a
   flat fill. ::before, not ::after: it must paint beneath the menu bar and the
   popover, which come later in the same stacking level. */
.macbook-desktop::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(140% 120% at 50% 42%, transparent 62%, rgba(0, 0, 0, 0.28));
}

/* The hinge lip below the lid. */
.macbook-hinge {
    height: 0.85em;
    margin: 0 4%;
    border-radius: 0 0 1.4em 1.4em;
    background: linear-gradient(180deg, #7d838c, #555a61 55%, #3f4348);
    box-shadow:
        inset 0 0.15em 0.2em rgba(255, 255, 255, 0.25),
        0 0.8em 1.6em -0.4em rgba(15, 23, 42, 0.55);
}

/* The menu bar: frosted glass over the wallpaper, with a specular highlight
   along its top edge rather than a flat fill. */
.menubar {
    position: absolute;
    inset: 0 0 auto 0;
    height: var(--menu-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.8em;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95em;
    background: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(1.4em) saturate(1.7);
    backdrop-filter: blur(1.4em) saturate(1.7);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

.menubar-side {
    display: flex;
    align-items: center;
    gap: 0.25em;
    min-width: 0;
}

.menubar-left {
    gap: 0.55em;
}

.menubar-app {
    font-weight: 600;
}

.menubar-app,
.menubar-item {
    font-size: 0.9em;
    padding: 0 0.45em;
    white-space: nowrap;
}

/* A generic rounded-square glyph — an abstract mark, not any real vendor's. */
.menubar-glyph {
    width: 1.1em;
    height: 1.1em;
    border-radius: 0.32em;
    background: linear-gradient(135deg, #a7c4ff 0 50%, #4d7dff 50% 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.menubar-icon {
    display: inline-flex;
    align-items: center;
    width: 1.15em;
    height: 1.15em;
}

.menubar-icon svg {
    width: 100%;
    height: 100%;
}

.menubar-battery {
    width: 1.7em;
}

/* The one interactive item in the bar: the CalTransact icon. */
.menubar-caltransact {
    display: inline-flex;
    width: 1.6em;
    height: 1.6em;
    padding: 0.14em;
    margin: 0 0.15em;
    border: 0;
    border-radius: 0.42em;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.menubar-caltransact img {
    width: 100%;
    height: 100%;
    border-radius: 0.3em;
    display: block;
}

.menubar-caltransact:hover,
.menubar-caltransact:focus-visible {
    transform: scale(1.12);
    background-color: rgba(255, 255, 255, 0.25);
}

.menubar-caltransact:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.6);
    outline-offset: 1px;
}

.menubar-clock {
    font-size: 0.9em;
    padding-left: 0.2em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The icon keeps its highlight while its popover is open. */
.menubar-caltransact.is-active {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Attention: until the visitor has opened the panel once, the icon carries a
   slow ripple so the demo invites the click. */
.menubar-caltransact.needs-attention::after {
    content: "";
    position: absolute;
    inset: -0.3em;
    border-radius: 0.6em;
    border: 2px solid rgba(255, 255, 255, 0.9);
    animation: attention-ripple 1.8s ease-out infinite;
    pointer-events: none;
}

@keyframes attention-ripple {
    0% { transform: scale(0.85); opacity: 0.9; }
    70% { transform: scale(1.25); opacity: 0; }
    100% { transform: scale(1.25); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .menubar-caltransact.needs-attention::after {
        animation: none;
        opacity: 0.5;
    }
}

/* The first-visit guide: a "Try it live" chip hanging under the CalTransact icon
   with an arrow that draws itself pointing up at the icon. It is a child of
   the icon's button, so the whole guide is clickable and opens the demo, and
   it is removed for good (localStorage) at the first open. Sizes in em, so it
   scales with the mockup; the whole thing bobs gently after the draw. */
.menubar-caltransact {
    position: relative;
}

.demo-callout {
    position: absolute;
    top: calc(100% + 0.3em);
    right: -0.35em;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    animation: callout-bob 2.8s ease-in-out 1.6s infinite;
}

/* Hidden while the demo panel is open; returns the moment it closes. */
.demo-callout.is-hidden {
    display: none;
}

/* The Support card's right half: a soft amber stage for the cup. */
.coffee-panel {
    background:
        radial-gradient(120% 90% at 50% 0%, var(--site-accent-soft), transparent 70%);
}

/* Steam curls rise off the cup, one after another; reduced motion keeps them still. */
.coffee-steam path {
    stroke: var(--site-accent);
    opacity: 0;
    animation: coffee-steam-rise 3.4s ease-in-out infinite;
}

.coffee-steam path:nth-child(2) {
    animation-delay: 1.1s;
}

.coffee-steam path:nth-child(3) {
    animation-delay: 2.2s;
}

@keyframes coffee-steam-rise {
    0% { opacity: 0; transform: translateY(7px); }
    35% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(-9px); }
}

@media (prefers-reduced-motion: reduce) {
    .coffee-steam path {
        animation: none;
        opacity: 0.35;
    }
}

.demo-callout-arrow {
    width: 4.6em;
    height: auto;
    margin-bottom: 0.1em;
}

.demo-callout-arrow path {
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.demo-callout-arrow .arrow-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: callout-draw 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.35s forwards;
}

.demo-callout-arrow .arrow-head {
    opacity: 0;
    animation: callout-head 0.25s ease-out 1.05s forwards;
}

.demo-callout-note {
    padding: 0.32em 0.85em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #171a21;
    font-size: 0.92em;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow:
        0 0.25em 0.8em rgba(6, 10, 20, 0.35),
        0 0 0 0 rgba(255, 255, 255, 0.55);
    animation: callout-ping 2.2s ease-out 1.4s infinite;
}

@keyframes callout-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes callout-head {
    to { opacity: 1; }
}

@keyframes callout-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-0.22em); }
}

@keyframes callout-ping {
    0% { box-shadow: 0 0.25em 0.8em rgba(6, 10, 20, 0.35), 0 0 0 0 rgba(255, 255, 255, 0.55); }
    70%, 100% { box-shadow: 0 0.25em 0.8em rgba(6, 10, 20, 0.35), 0 0 0 0.45em rgba(255, 255, 255, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .demo-callout {
        animation: none;
    }
    .demo-callout-arrow .arrow-line {
        animation: none;
        stroke-dashoffset: 0;
    }
    .demo-callout-arrow .arrow-head {
        animation: none;
        opacity: 1;
    }
    .demo-callout-note {
        animation: none;
    }
}

/* The popover: anchored under the icon's tray, the real panel's 332x600 shape
   scaled with the mockup. It is the sizing container for everything inside:
   the screens position themselves in cqw, so 100cqw = the panel's 332. */
.menubar-right {
    position: relative;
}

/* The popover: the app panel at its true 332×600. The app's 16pt corner radius
   and near-solid window-background fill; JS aligns its right edge to the icon's,
   like macOS. It is the sizing container for the screens: 100cqw = the panel's
   332 design pixels.
   The font-size undoes the menubar's 0.95em so the panel's em = the mockup
   base; the height is explicit (not aspect-ratio) because a ratio-derived
   height is not definite for percentage children in every engine — the panel's
   own children size from it. */
.popover {
    /* The panel's two appearances, as variables: the app's Tokens.swift and
       CategoryHue tables, dark (default) and light. The moon button in the
       panel's bottom bar flips data-mode, and every colour follows. */
    --accent-blue: #2F6BFF;
    --accent-red: #E2574C;
    --accent-green: #3DBE6B;
    --accent-amber: #E2A33D;
    --hue-coral: #E2574C;
    --hue-amber: #E2A33D;
    --hue-blue: #2F6BFF;
    --hue-green: #3DBE6B;
    --hue-teal: #0CA678;
    --hue-violet: #845EF7;
    --hue-pink: #E64980;
    --hue-gray: #868E96;
    --on-strong: #212121;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.35);
    --fill-subtle: rgba(255, 255, 255, 0.04);
    --fill-field: rgba(255, 255, 255, 0.055);
    --row-hover: rgba(255, 255, 255, 0.06);
    --bar-track: rgba(255, 255, 255, 0.08);
    --border-chip: rgba(255, 255, 255, 0.15);
    --divider: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: calc(100% + 0.4em);
    right: 0;
    font-size: 1.0526em;
    width: 20.75em;
    height: 37.5em;
    container-type: inline-size;
    border-radius: 1em;
    background: rgba(30, 30, 32, 0.88);
    -webkit-backdrop-filter: blur(1.6em) saturate(1.4);
    backdrop-filter: blur(1.6em) saturate(1.4);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        0 1.2em 2.4em rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: top right;
    z-index: 5;
    transition: opacity 160ms ease, transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1), visibility 160ms;
}

.popover[data-mode="light"] {
    --accent-blue: #1B4EDB;
    --accent-red: #BE3730;
    --accent-green: #188042;
    --accent-amber: #94680E;
    --hue-coral: #BE3730;
    --hue-amber: #94680E;
    --hue-blue: #1B4EDB;
    --hue-green: #188042;
    --hue-teal: #097A58;
    --hue-violet: #603CCD;
    --hue-pink: #BC2A60;
    --hue-gray: #58626E;
    --on-strong: #ffffff;
    --text-primary: #000000;
    --text-secondary: rgba(0, 0, 0, 0.62);
    --text-muted: rgba(0, 0, 0, 0.42);
    --fill-subtle: rgba(0, 0, 0, 0.05);
    --fill-field: rgba(0, 0, 0, 0.055);
    --row-hover: rgba(0, 0, 0, 0.06);
    --bar-track: rgba(0, 0, 0, 0.09);
    --border-chip: rgba(0, 0, 0, 0.12);
    --divider: rgba(0, 0, 0, 0.12);
    background: rgba(238, 238, 235, 0.92);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.12),
        0 1.2em 2.4em rgba(0, 0, 0, 0.35);
}

.popover.is-open {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

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

/* ── Responsive ──────────────────────────────────────
   Above 1024px the mockup renders at its full 16px base. Between 768 and 1024
   the clamp() on .macbook's font-size scales the whole illustration
   proportionally — every internal size is in em — so nothing is re-laid-out,
   and the popover's tail is re-measured in real pixels on any resize while
   open. Below 768px the laptop goes away entirely: a full-width menu bar strip
   over the wallpaper, and the panel open in its own flow below it, capped at
   its real 332px. */

@media (max-width: 767px) {
    #demo {
        padding: 0;
    }

    .macbook {
        width: 100%;
        font-size: 15px;
        position: relative;
    }

    .macbook-screen {
        padding: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .macbook-notch,
    .macbook-hinge {
        display: none;
    }

    .macbook-desktop {
        aspect-ratio: auto;
        border-radius: 0;
        overflow: visible;
    }

    .menubar {
        position: relative;
        border-radius: 0;
    }

    .menubar-item,
    .demo-callout {
        display: none;
    }

    .menubar-right {
        position: static;
    }

    /* Flat mode lays the panel in flow under the bar (the script moves it out
       of the tray and into the demo section), so it pushes the page down
       instead of floating over the download copy. */
    .popover {
        position: static;
        width: min(332px, calc(100vw - 24px));
        height: calc(min(332px, 100vw - 24px) * 600 / 332);
        margin: 14px auto 0;
        transform: none;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition: none;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            0 18px 40px rgba(0, 0, 0, 0.5);
    }
}

/* On a narrow screen the decorative menu words go first; the tray stays. */
@media (max-width: 640px) {
    .menubar-item {
        display: none;
    }
}

/* inset rather than height:100% — containment on the panel makes percentage
   heights unreliable here, and the body must be definite for every screen
   below it. */
.popover-body {
    position: absolute;
    inset: 0;
}
