/* ==========================================================================
   gvm.js Developer Showcase — foundation stylesheet
   --------------------------------------------------------------------------
   Written from scratch, no framework. Palette and type mirror getviamsg.com:
   charcoal #232526, white ink, amber #ffba00, Inter.

   Covers the chrome (bar, footer), editorial content, cards, ad slots, PPV,
   the overlay paywall chrome and the legacy modal payment dialog. The default
   payment form (drawer) ships its own stylesheet, assets/gvm-drawer.css — do
   not style it from here. The overlay articles reuse the editorial styles from
   this file and add only their figure/pull-quote helpers in assets/overlay.css.
   ========================================================================== */

/* --- Tokens -------------------------------------------------------------- */
:root {
    color-scheme: dark;

    --bg: #232526;
    --bg-1: #292b2c;
    --bg-2: #2f3132;
    --ink: #ffffff;
    --ink-2: #c9ccce;
    --muted: #909090;
    --line: #3c3f40;
    --line-2: #565a5c;

    --accent: #ffba00;
    --accent-hover: #ffcd4d;
    --accent-ink: #232526;
    /* Accent used as TEXT (links, kickers): stays readable on a light page. */
    --accent-text: var(--accent);

    --ok: #7fd6a8;
    --danger: #ff6b5e;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;

    --maxw: 1060px;
    /* One measure for every long-form block, so the four content pages read
       the same instead of drifting per page. */
    --measure: 65ch;

    /* Modal / dialog backdrop. Token-based so a light theme can re-map it. */
    --scrim: color-mix(in srgb, var(--bg) 80%, transparent);

    /* Documented exception: a QR code needs a white quiet zone, so these stay
       theme-independent instead of following --bg / --ink. */
    --qr-bg: #fff;
    /* A QR-shaped placeholder for the pre-consent state: finder squares,
       timing rows and data modules, drawn as an inline SVG so it follows
       the box without any extra markup. */
    --qr-fake: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2025%2025%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20fill%3D%27%23232526%27%20fill-opacity%3D%270.22%27%20d%3D%27M0%200h1v1h-1zM1%200h1v1h-1zM2%200h1v1h-1zM3%200h1v1h-1zM4%200h1v1h-1zM5%200h1v1h-1zM6%200h1v1h-1zM7%200h1v1h-1zM13%200h1v1h-1zM17%200h1v1h-1zM18%200h1v1h-1zM19%200h1v1h-1zM20%200h1v1h-1zM21%200h1v1h-1zM22%200h1v1h-1zM23%200h1v1h-1zM24%200h1v1h-1zM0%201h1v1h-1zM6%201h1v1h-1zM7%201h1v1h-1zM8%201h1v1h-1zM11%201h1v1h-1zM16%201h1v1h-1zM17%201h1v1h-1zM18%201h1v1h-1zM24%201h1v1h-1zM0%202h1v1h-1zM2%202h1v1h-1zM3%202h1v1h-1zM4%202h1v1h-1zM6%202h1v1h-1zM8%202h1v1h-1zM9%202h1v1h-1zM10%202h1v1h-1zM11%202h1v1h-1zM13%202h1v1h-1zM18%202h1v1h-1zM20%202h1v1h-1zM21%202h1v1h-1zM22%202h1v1h-1zM24%202h1v1h-1zM0%203h1v1h-1zM2%203h1v1h-1zM3%203h1v1h-1zM4%203h1v1h-1zM6%203h1v1h-1zM8%203h1v1h-1zM9%203h1v1h-1zM14%203h1v1h-1zM15%203h1v1h-1zM16%203h1v1h-1zM17%203h1v1h-1zM18%203h1v1h-1zM20%203h1v1h-1zM21%203h1v1h-1zM22%203h1v1h-1zM24%203h1v1h-1zM0%204h1v1h-1zM2%204h1v1h-1zM3%204h1v1h-1zM4%204h1v1h-1zM6%204h1v1h-1zM8%204h1v1h-1zM10%204h1v1h-1zM13%204h1v1h-1zM14%204h1v1h-1zM18%204h1v1h-1zM20%204h1v1h-1zM21%204h1v1h-1zM22%204h1v1h-1zM24%204h1v1h-1zM0%205h1v1h-1zM6%205h1v1h-1zM7%205h1v1h-1zM8%205h1v1h-1zM11%205h1v1h-1zM12%205h1v1h-1zM13%205h1v1h-1zM16%205h1v1h-1zM17%205h1v1h-1zM18%205h1v1h-1zM24%205h1v1h-1zM0%206h1v1h-1zM1%206h1v1h-1zM2%206h1v1h-1zM3%206h1v1h-1zM4%206h1v1h-1zM5%206h1v1h-1zM6%206h1v1h-1zM8%206h1v1h-1zM10%206h1v1h-1zM12%206h1v1h-1zM14%206h1v1h-1zM16%206h1v1h-1zM18%206h1v1h-1zM19%206h1v1h-1zM20%206h1v1h-1zM21%206h1v1h-1zM22%206h1v1h-1zM23%206h1v1h-1zM24%206h1v1h-1zM0%207h1v1h-1zM1%207h1v1h-1zM3%207h1v1h-1zM5%207h1v1h-1zM7%207h1v1h-1zM9%207h1v1h-1zM11%207h1v1h-1zM12%207h1v1h-1zM13%207h1v1h-1zM14%207h1v1h-1zM17%207h1v1h-1zM19%207h1v1h-1zM20%207h1v1h-1zM23%207h1v1h-1zM0%208h1v1h-1zM1%208h1v1h-1zM3%208h1v1h-1zM4%208h1v1h-1zM5%208h1v1h-1zM6%208h1v1h-1zM7%208h1v1h-1zM9%208h1v1h-1zM11%208h1v1h-1zM12%208h1v1h-1zM17%208h1v1h-1zM18%208h1v1h-1zM21%208h1v1h-1zM22%208h1v1h-1zM0%209h1v1h-1zM4%209h1v1h-1zM5%209h1v1h-1zM7%209h1v1h-1zM9%209h1v1h-1zM11%209h1v1h-1zM14%209h1v1h-1zM15%209h1v1h-1zM17%209h1v1h-1zM18%209h1v1h-1zM22%209h1v1h-1zM24%209h1v1h-1zM0%2010h1v1h-1zM1%2010h1v1h-1zM2%2010h1v1h-1zM3%2010h1v1h-1zM4%2010h1v1h-1zM5%2010h1v1h-1zM6%2010h1v1h-1zM8%2010h1v1h-1zM9%2010h1v1h-1zM15%2010h1v1h-1zM16%2010h1v1h-1zM17%2010h1v1h-1zM21%2010h1v1h-1zM0%2011h1v1h-1zM2%2011h1v1h-1zM11%2011h1v1h-1zM15%2011h1v1h-1zM20%2011h1v1h-1zM23%2011h1v1h-1zM3%2012h1v1h-1zM6%2012h1v1h-1zM7%2012h1v1h-1zM9%2012h1v1h-1zM11%2012h1v1h-1zM14%2012h1v1h-1zM19%2012h1v1h-1zM20%2012h1v1h-1zM21%2012h1v1h-1zM23%2012h1v1h-1zM24%2012h1v1h-1zM2%2013h1v1h-1zM4%2013h1v1h-1zM7%2013h1v1h-1zM8%2013h1v1h-1zM12%2013h1v1h-1zM14%2013h1v1h-1zM15%2013h1v1h-1zM21%2013h1v1h-1zM22%2013h1v1h-1zM23%2013h1v1h-1zM24%2013h1v1h-1zM0%2014h1v1h-1zM1%2014h1v1h-1zM4%2014h1v1h-1zM6%2014h1v1h-1zM8%2014h1v1h-1zM9%2014h1v1h-1zM10%2014h1v1h-1zM12%2014h1v1h-1zM15%2014h1v1h-1zM17%2014h1v1h-1zM18%2014h1v1h-1zM19%2014h1v1h-1zM20%2014h1v1h-1zM22%2014h1v1h-1zM23%2014h1v1h-1zM24%2014h1v1h-1zM1%2015h1v1h-1zM8%2015h1v1h-1zM10%2015h1v1h-1zM11%2015h1v1h-1zM14%2015h1v1h-1zM15%2015h1v1h-1zM16%2015h1v1h-1zM21%2015h1v1h-1zM24%2015h1v1h-1zM2%2016h1v1h-1zM3%2016h1v1h-1zM6%2016h1v1h-1zM7%2016h1v1h-1zM14%2016h1v1h-1zM19%2016h1v1h-1zM0%2017h1v1h-1zM3%2017h1v1h-1zM4%2017h1v1h-1zM5%2017h1v1h-1zM10%2017h1v1h-1zM12%2017h1v1h-1zM14%2017h1v1h-1zM15%2017h1v1h-1zM17%2017h1v1h-1zM18%2017h1v1h-1zM0%2018h1v1h-1zM1%2018h1v1h-1zM2%2018h1v1h-1zM3%2018h1v1h-1zM4%2018h1v1h-1zM5%2018h1v1h-1zM6%2018h1v1h-1zM8%2018h1v1h-1zM9%2018h1v1h-1zM11%2018h1v1h-1zM17%2018h1v1h-1zM18%2018h1v1h-1zM21%2018h1v1h-1zM0%2019h1v1h-1zM6%2019h1v1h-1zM8%2019h1v1h-1zM12%2019h1v1h-1zM15%2019h1v1h-1zM20%2019h1v1h-1zM22%2019h1v1h-1zM0%2020h1v1h-1zM2%2020h1v1h-1zM3%2020h1v1h-1zM4%2020h1v1h-1zM6%2020h1v1h-1zM7%2020h1v1h-1zM9%2020h1v1h-1zM10%2020h1v1h-1zM14%2020h1v1h-1zM15%2020h1v1h-1zM18%2020h1v1h-1zM20%2020h1v1h-1zM21%2020h1v1h-1zM22%2020h1v1h-1zM24%2020h1v1h-1zM0%2021h1v1h-1zM2%2021h1v1h-1zM3%2021h1v1h-1zM4%2021h1v1h-1zM6%2021h1v1h-1zM7%2021h1v1h-1zM9%2021h1v1h-1zM11%2021h1v1h-1zM13%2021h1v1h-1zM14%2021h1v1h-1zM16%2021h1v1h-1zM17%2021h1v1h-1zM18%2021h1v1h-1zM20%2021h1v1h-1zM21%2021h1v1h-1zM0%2022h1v1h-1zM2%2022h1v1h-1zM3%2022h1v1h-1zM4%2022h1v1h-1zM6%2022h1v1h-1zM10%2022h1v1h-1zM14%2022h1v1h-1zM15%2022h1v1h-1zM17%2022h1v1h-1zM20%2022h1v1h-1zM21%2022h1v1h-1zM23%2022h1v1h-1zM24%2022h1v1h-1zM0%2023h1v1h-1zM6%2023h1v1h-1zM8%2023h1v1h-1zM10%2023h1v1h-1zM11%2023h1v1h-1zM13%2023h1v1h-1zM14%2023h1v1h-1zM18%2023h1v1h-1zM23%2023h1v1h-1zM24%2023h1v1h-1zM0%2024h1v1h-1zM1%2024h1v1h-1zM2%2024h1v1h-1zM3%2024h1v1h-1zM4%2024h1v1h-1zM5%2024h1v1h-1zM6%2024h1v1h-1zM7%2024h1v1h-1zM8%2024h1v1h-1zM12%2024h1v1h-1zM13%2024h1v1h-1zM14%2024h1v1h-1zM18%2024h1v1h-1zM19%2024h1v1h-1zM23%2024h1v1h-1z%27%2F%3E%3C%2Fsvg%3E");
    --qr-veil: color-mix(in srgb, #fff 92%, transparent);
    --qr-ink: color-mix(in srgb, #000 64%, #fff);
    --qr-code: color-mix(in srgb, #000 93%, #fff);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Deliberately tight: the previous showcase used very large steps. */
    --fs-xs: 0.78rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.35rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;
}

/* --- Reset -------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink-2);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent-text);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent-hover);
}

h1,
h2,
h3 {
    color: var(--ink);
    line-height: 1.2;
    margin: 0 0 0.4em;
    text-wrap: balance;
}

/* Paragraph leading is set once, at the element, so body copy never inherits
   the tighter UI rhythm of `body` (1.6). */
p {
    margin: 0 0 1em;
    line-height: 1.7;
    text-wrap: pretty;
    overflow-wrap: break-word;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --- Skip link ---------------------------------------------------------- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: top 0.15s ease-in;
}

.skip-link:focus {
    top: 1rem;
}

/* --- Layout ------------------------------------------------------------- */
.container {
    width: min(100% - 2rem, var(--maxw));
    margin-inline: auto;
}

.main {
    flex: 1 0 auto;
    padding: 2rem 0 3rem;
}

/* --- Site bar (small, on purpose) --------------------------------------- */
.site-bar {
    border-bottom: 1px solid var(--line);
    background: var(--bg-1);
}

.site-bar__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}

.brand img {
    width: 116px;
    height: auto;
}

.site-nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    font-size: var(--fs-sm);
}

.site-nav a {
    color: var(--ink-2);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--accent-text);
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--ink-2);
    text-decoration: none;
}

.lang-switch:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

/* --- Example bar -------------------------------------------------------- */
.example-bar {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    font-size: var(--fs-sm);
}

.example-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    flex-wrap: wrap;
}

.example-bar__crumb {
    margin: 0;
    color: var(--muted);
}

.example-bar__back {
    color: var(--ink-2);
    text-decoration: none;
}

.example-bar__back:hover {
    color: var(--accent-text);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.btn--accent {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn--accent:hover {
    background: var(--accent-hover);
    color: var(--accent-ink);
}

.btn--ghost {
    background: transparent;
    border-color: var(--line-2);
    color: var(--ink-2);
}

.btn--ghost:hover {
    border-color: var(--ink-2);
    color: var(--ink);
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* --- Editorial article -------------------------------------------------- */
.article {
    max-width: var(--measure);
    margin-inline: auto;
}

.article-head {
    margin-bottom: 1.6rem;
}

.kicker {
    margin: 0 0 0.35rem;
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.article-head h1 {
    font-size: var(--fs-3xl);
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}

.byline {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.lead {
    margin-top: 1rem;
    max-width: var(--measure);
    font-size: var(--fs-lg);
    line-height: 1.6;
    color: var(--ink-2);
}

/* Long-form prose: a comfortable measure, generous leading and no
   justification. Ragged-left text avoids the "rivers" that make a narrow
   dark-theme column tiring to read, and `text-wrap: pretty` removes orphans. */
.article-body {
    max-width: var(--measure);
    text-align: left;
    overflow-wrap: break-word;
    hyphens: auto;
}

.article-body p {
    margin: 0 0 1.15em;
    font-size: var(--fs-base);
    line-height: 1.7;
    text-wrap: pretty;
    hyphens: auto;
}

/* Meta lines — byline, file metadata, captions, teasers — share one leading
   everywhere, so a caption looks the same on every page. */
.byline,
.file-meta,
.track__meta,
.paywall-meta,
.paywall-note,
.article-figure figcaption {
    line-height: 1.55;
    overflow-wrap: break-word;
}

/* gvm gating: content is hidden until the SDK has booted. */
.wait-for-script {
    display: none;
}

/* --- Paywall card (inline) --------------------------------------------- */
.paywall-card {
    margin: 1.5rem 0;
    padding: 1.25rem 1.25rem 1.1rem;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: var(--radius);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--accent) 10%, transparent),
        color-mix(in srgb, var(--accent) 2%, transparent)
    );
}

.paywall-lead {
    margin: 0 0 0.35rem;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--ink);
}

.paywall-meta {
    margin: 0 0 0.9rem;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.paywall-meta [data-gvm-bind-reading-time],
.paywall-meta [data-gvm-bind-reading-words] {
    color: var(--ink);
    font-weight: 600;
}

.paywall-sep {
    padding-inline: 0.35rem;
}

.paywall-cta {
    width: 100%;
    margin-top: 0.4rem;
}

.paywall-note {
    margin: 0.7rem 0 0;
    font-size: var(--fs-xs);
    color: var(--muted);
}

/* --- Consent ------------------------------------------------------------ */
.consent {
    margin: 1rem 0;
}

.consent-info {
    margin: 0 0 0.6rem;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--ink-2);
    text-align: left;
    text-wrap: pretty;
}

.consent-info--compact {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.consent-info strong {
    color: var(--ink);
}

.consent-note {
    margin: 0 0 0.6rem;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.consent-terms {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    font-size: var(--fs-xs);
    line-height: 1.45;
    color: var(--ink-2);
    text-align: left;
    text-wrap: pretty;
    cursor: pointer;
}

.consent-terms input {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0.1rem 0 0;
    accent-color: var(--accent);
}

/* --- Payment dialog ----------------------------------------------------- */
.gvm-dialog {
    /* gvm.js injects the dialog with a plain `open` attribute (no showModal),
       so the centering and the scrim are ours to do. */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: min(100% - 2rem, 420px);
    height: auto;
    max-height: min(90vh, 720px);
    margin: 0;
    overflow: auto;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--bg-1);
    color: var(--ink-2);
}

html:has(dialog.gvm-dialog[open])::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--scrim);
}

html:has(dialog.gvm-dialog[open]) {
    overflow: hidden;
}

.payment-modal {
    position: relative;
    margin: 0;
    padding: 1.25rem;
}

/* Keeps the title clear of the corner close button. */
.payment-header {
    padding-right: 2.75rem;
}

.payment-title {
    margin: 0 0 0.2rem;
    font-size: var(--fs-lg);
    font-weight: 600;
    line-height: 1.3;
}

.payment-sub {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.payment-body {
    margin-top: 1rem;
}

.payment-price-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.payment-price {
    color: var(--ink);
    font-size: var(--fs-lg);
    font-weight: 700;
}

.payment-qr-wrap {
    display: flex;
    justify-content: center;
}

.payment-qr-gate {
    position: relative;
    width: 190px;
    height: 190px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--qr-bg);
    overflow: hidden;
}

.payment-qr {
    display: block;
    width: 100%;
    height: 100%;
}

.payment-qr img,
.payment-qr canvas,
.payment-qr svg {
    width: 100%;
    height: 100%;
}

.payment-qr-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--qr-ink);
    background-color: var(--qr-veil);
    background-image: var(--qr-fake);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 64% 64%;
}

.gvm-terms-blocked .payment-qr {
    filter: blur(6px);
}

/* Once consent is ticked gvm drops `.gvm-terms-blocked`; the hint must go with it. */
.payment-qr-gate:not(.gvm-terms-blocked) .payment-qr-cover {
    display: none;
}

.payment-status-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-height: 1.4em;
    margin: 0.85rem 0 0;
    font-size: var(--fs-xs);
    line-height: 1.4;
    color: var(--muted);
}

.payment-time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.payment-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.payment-actions button {
    width: 100%;
    min-height: 2.75rem;
    font-size: var(--fs-sm);
    border-radius: var(--radius);
}

/*
 * Cancel is a round × in the card corner, matching .gvm-payment__close in the
 * circle/simple variants. `data-gvm-bind-cancel` stays on it: the SDK, Escape
 * handling and focus return bind to that attribute.
 */
.payment-close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 2.25rem;
    height: 2.25rem;
    padding: 0;

    background: transparent;
    color: var(--muted);

    border: 1px solid var(--line-2);
    border-radius: 50%;

    font-family: inherit;
    font-size: var(--fs-lg);
    line-height: 1;

    cursor: pointer;
}

.payment-close:hover {
    background: var(--bg-2);
    color: var(--ink);
    border-color: var(--ink-2);
}

.payment-close:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.payment-footer {
    margin-top: 1rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.payment-footer a {
    color: var(--ink-2);
}

/* --- One payment type scale --------------------------------------------
 * The drawer ships its own stylesheet (assets/gvm-drawer.css), which we leave
 * untouched; these ancestor-scoped rules only assert the shared scale the
 * four variants use for status, info, terms and actions. */
.gvm-payment-drawer-overlay .gvm-payment-drawer__status {
    font-size: var(--fs-xs);
    line-height: 1.4;
    color: var(--muted);
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__info {
    font-size: var(--fs-xs);
    line-height: 1.5;
    text-align: left;
    text-wrap: pretty;
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__terms {
    font-size: var(--fs-xs);
    line-height: 1.45;
    text-align: left;
    text-wrap: pretty;
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__title {
    font-size: var(--fs-lg);
    font-weight: 600;
    line-height: 1.3;
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__subtitle {
    font-size: var(--fs-sm);
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__price-value {
    font-size: var(--fs-lg);
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__qr-cover {
    font-size: var(--fs-xs);
    line-height: 1.4;
}

.gvm-payment-drawer-overlay .gvm-payment-drawer__actions button {
    min-height: 2.75rem;
    font-size: var(--fs-sm);
    border-radius: var(--radius);
}

/* --- Footer ------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-1);
    font-size: var(--fs-sm);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}

/* Brand logotype (theme-aware). Used in the footer and the payment surfaces;
   the light/dark swap lives in assets/theme.css. */
.brand-logo {
    display: block;
    width: 124px;
    height: auto;
}

/* The footer carries the full "GetViaMsg by WDFT" lockup. */
.brand-logo--lockup {
    width: 156px;
}

.site-footer__nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer__nav a {
    color: var(--ink-2);
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: var(--accent-text);
}

/* --- Inline code & disclosures ------------------------------------------ */
code,
kbd {
    font-family: var(--mono);
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--bg-2);
    color: var(--ink);
}

details {
    margin-top: 0.7rem;
}

summary {
    cursor: pointer;
    color: var(--ink-2);
    font-weight: 600;
}

summary:hover {
    color: var(--accent-text);
}

details p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

/* --- Page heads & cards ------------------------------------------------- */
.page-head {
    max-width: var(--measure);
    margin-bottom: 1.8rem;
}

.page-head h1 {
    font-size: var(--fs-3xl);
    letter-spacing: -0.01em;
}

.page-head .lead {
    color: var(--ink-2);
    margin-bottom: 1rem;
}

.section-title {
    margin: 2rem 0 0.9rem;
    font-size: var(--fs-xl);
}

.card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    display: block;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
    color: inherit;
    text-decoration: none;
}

a.card:hover,
a.card:focus-visible {
    border-color: var(--accent);
}

.card h2,
.card h3 {
    margin: 0 0 0.3rem;
    font-size: var(--fs-lg);
}

.card p {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.card .btn {
    margin-top: 0.6rem;
}

/* Plan cards (/saas-licenses/): the price is the card heading, so digits must
   not shuffle sideways when a plan changes. */
.card h2 {
    font-variant-numeric: tabular-nums;
}

.card--soon {
    border-style: dashed;
    background: transparent;
}

.card--soon h2,
.card--soon h3 {
    color: var(--ink-2);
}

.badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.1rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.badge--muted {
    border-color: var(--line-2);
    color: var(--muted);
}

/* --- Ad slots (/publisher/remove-ads/) ---------------------------------- */
.ad {
    display: grid;
    place-items: center;
    min-height: 90px;
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--bg-1);
    color: var(--muted);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.ad--leaderboard {
    width: 100%;
    min-height: 90px;
}

.ad--inline {
    min-height: 250px;
    margin-inline: auto;
    max-width: var(--measure);
}

.adbar {
    /* Sticky inside the container, so it parks on the viewport edge once the
       article scrolls past. z-index 20 keeps it under the payment drawer
       (1000001 in gvm-drawer.css) and the skip link. */
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--bg-1);
    color: var(--muted);
    font-size: var(--fs-sm);
}

.adbar .btn {
    flex: 0 0 auto;
}

/* remove-ads.njk flips this class for 24h after a successful payment. */
html.ads-free .ad,
html.ads-free .adbar {
    display: none;
}

/* --- Markdown prose inside the gated body -------------------------------- */
.article-body h2 {
    margin: 1.7em 0 0.5em;
    font-size: var(--fs-xl);
}

.article-body h3 {
    margin: 1.5em 0 0.45em;
    font-size: var(--fs-lg);
}

.article-body strong {
    color: var(--ink);
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.1em;
    padding-left: 1.2em;
}

.article-body li {
    margin: 0.35em 0;
}

.article-body li::marker {
    color: var(--accent-text);
}

/* Wide tables scroll inside their own box instead of forcing the page wide. */
.article-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 1em 0 1.5em;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.article-body th,
.article-body td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.article-body th {
    color: var(--ink);
    background: var(--bg-2);
}

.article-body blockquote {
    margin: 1.2em 0;
    padding: 0.2em 0 0.2em 1em;
    border-left: 2px solid var(--accent);
    color: var(--ink-2);
    text-wrap: pretty;
}

/* Template demos (`/templates/*`) gate a `#demo` block. Keep it at a reading
   measure and centred, so the unlock overlays sit over a sane column instead
   of a full-width page. */
#demo {
    max-width: var(--measure);
    margin-inline: auto;
}

/* --- Media / file cards ------------------------------------------------- */
.media-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.media-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
}

.media-card > img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    object-fit: cover;
}

.media-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem 1rem;
}

.media-card h2,
.media-card h3 {
    margin: 0;
    font-size: var(--fs-base);
}

.media-card .btn {
    margin-top: 0.6rem;
}

.file-meta {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.track-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-1);
}

.track__name {
    margin: 0;
    color: var(--ink);
}

.track__meta {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.track .btn {
    flex: 0 0 auto;
}

.video-card {
    position: relative;
    display: block;
    overflow: hidden;
    /* The pay-per-view poster is a YouTube frame: keep it 16:9 so the slot
       reserves the right space before the image loads (no layout shift). */
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
}

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

.video-card__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    color: var(--ink);
    font-weight: 600;
    text-align: center;
}

.notice {
    margin: 0 0 1.4rem;
    padding: 0.6rem 0.8rem;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--muted);
}

/* --- Pay-per-view (/digital-ecommerce/pay-per-view/) -------------------- */
.ppv {
    display: grid;
    gap: 1rem;
    max-width: 760px;
}

.player-slot {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
}

/* The poster already sits in a rounded card; inside the slot it is flush. */
.player-slot > .video-card {
    border: 0;
    border-radius: 0;
}

/* gvm injects the player into #player, so the poster has to step aside. */
.player-slot:has(.player) > .video-card {
    display: none;
}

.player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    /* Letterbox stays dark on purpose: a bright frame around a video reads as
       broken, in either theme. */
    background: color-mix(in srgb, var(--bg) 30%, #000);
}

.ppv__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.ppv__bar p {
    margin: 0;
}

/* --- Motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 640px) {
    /* The docs link also lives in the footer; on small screens a one-row bar
       is calmer and keeps the language switch next to the logo. */
    .site-nav {
        display: none;
    }

    .site-bar__inner {
        justify-content: space-between;
    }

    .lang-switch {
        margin-left: auto;
    }

    .article-head h1 {
        font-size: var(--fs-2xl);
    }

    /* Grids: keep cards from forcing horizontal scroll. */
    .card-grid,
    .media-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-grid > *,
    .media-grid > * {
        min-width: 0;
    }

    /* One trigger per track: the button drops under the name. */
    .track {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .track .btn {
        flex: 1 1 100%;
    }

    /* Pay-per-view: bar stacks, thumbnails and player stay inside the viewport. */
    .ppv__bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .ppv__bar .btn {
        width: 100%;
    }

    .player-slot {
        max-width: 100%;
    }

    /* Ad slots shrink; the bar wraps instead of squeezing the CTA. */
    .ad--inline {
        min-height: 180px;
    }

    .adbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.6rem;
        text-align: center;
    }

    .adbar .btn {
        flex: 1 1 100%;
    }
}

/* --- Use-case category groups (homepage, digital-commerce landing) ------- */
.de-cats {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.de-cat {
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
}

.de-cat h3 {
    margin: 0 0 0.25rem;
    font-size: var(--fs-lg);
}

.de-cat h3 a {
    color: var(--ink);
    text-decoration: none;
}

.de-cat h3 a:hover,
.de-cat h3 a:focus-visible {
    color: var(--accent-text);
    text-decoration: underline;
}

.de-cat__lede {
    margin: 0 0 0.8rem;
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--muted);
}

.de-cat__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: var(--fs-sm);
}

.de-cat__list li {
    margin-bottom: 0.45rem;
}

.de-cat__list li:last-child {
    margin-bottom: 0;
}

.de-cat__desc {
    display: block;
    font-size: var(--fs-xs);
    line-height: 1.55;
    color: var(--muted);
}
