/* ===================================================================
   Home page hero: the promise, two buttons, and one big screen of the app.
   The screen is a browser frame with a tall screenshot inside (assets/home/<screen>-light|dark.webp);
   scripts/home.js scrolls it once (Overview, then Real-time) and stops; four switches under it pick a screen.
   =================================================================== */

/* The colour behind the screen: strong StaSee green at the top, light mint under the buttons, the page colour lower down; the
   screen (outside the hero) is pulled up into it. Half the screen = (bezels + browser bar + the 16:10 viewport, 720px at
   most) / 2; the hero ends a little below the middle of the screen. */
:root {
    --demo-w: min(1160px, 100vw - 2 * var(--container-pad));
    --demo-bezel: clamp(5px, .55vw, 8px);
    --demo-ratio: .625;
    --demo-half: calc((var(--demo-bezel) * 2.6 + 42px + min((var(--demo-w) - 2 * var(--demo-bezel)) * var(--demo-ratio), 720px)) / 2);
    --demo-overlap: calc(var(--demo-half) * 1.7);
    --hero-mint: color-mix(in srgb, var(--color-green) 13%, #ffffff);
}

:root[data-theme="dark"] {
    --hero-mint: color-mix(in srgb, var(--color-green) 7%, var(--color-bg));
}

.home-hero {
    padding-top: calc(var(--header-height) + clamp(18px, 4.5vh, 52px));
    padding-bottom: calc(var(--demo-overlap) + clamp(22px, 3.5vh, 36px));
    background: linear-gradient(180deg, var(--hero-top) 0%, var(--hero-bottom) 30%, var(--hero-mint) 52%, var(--color-bg) 100%);
}

/* simpler waves: only a soft trace of the drawing stays */
.home-hero .hero-wave {
    opacity: .35;
}

.home-demo {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * var(--demo-overlap));
}

/* ===== the promise ===== */

.home-head {
    text-align: center;
}

.home-title {
    max-width: 20ch;
    margin-inline: auto;

    font-size: clamp(36px, 5.2vw, 68px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -.035em;
    text-wrap: balance;
}

/* Chinese, Japanese and Korean: a character is about 2ch wide, so the headline gets more room, and Japanese breaks only between
   phrases (never inside a word like リアルタイム) */
:lang(zh) .home-title,
:lang(ja) .home-title,
:lang(ko) .home-title {
    max-width: 14em;
    word-break: keep-all;
}

:lang(ja) .home-title {
    word-break: auto-phrase;
}

/* the slogan under the headline: "All your websites. One live dashboard." on one line where it fits */
.home-slogan {
    margin: 16px auto 0;

    font-size: clamp(21px, 2.3vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.015em;
    text-wrap: balance;
}

/* each phrase stays whole: on a narrow screen the line breaks between them, not inside one */
.home-slogan > span {
    display: inline-block;
}

.home-slogan > span + span {
    margin-inline-start: .28em;
}

:lang(zh) .home-slogan > span + span,
:lang(ja) .home-slogan > span + span {
    margin-inline-start: 0;
}

.home-lead {
    max-width: 50ch;
    margin: 14px auto 0;

    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.55;
    color: color-mix(in srgb, var(--on-hero) 86%, transparent);
    text-wrap: balance;
}

/* ===== the two buttons ===== */

.home-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: clamp(20px, 3vh, 28px);
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    height: 52px;
    padding: 0 24px;

    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;

    transition: background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.home-btn:hover {
    transform: translateY(-1px);
}

.home-btn:active {
    transform: translateY(0);
}

/* "Start Free": dark ink on the light green (a green button would vanish there), bright green on the dark one */
.home-btn-main {
    background: var(--color-green-ink);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(5, 46, 22, .3);
}

.home-btn-main:hover {
    background: #0a4a26;
    box-shadow: 0 12px 24px -12px rgba(5, 46, 22, .6);
}

:root[data-theme="dark"] .home-btn-main {
    background: var(--color-green);
    color: var(--color-green-ink);
    box-shadow: 0 1px 2px rgba(22, 163, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}

:root[data-theme="dark"] .home-btn-main:hover {
    background: #2bd46a;
    box-shadow: 0 12px 24px -12px rgba(22, 163, 74, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.home-btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform .22s var(--ease);
}

.home-btn-main:hover .home-btn-arrow {
    transform: translateX(3px);
}

/* right-to-left: the arrow points the way the text reads */
[dir="rtl"] .home-btn-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .home-btn-main:hover .home-btn-arrow {
    transform: scaleX(-1) translateX(3px);
}

/* "Explore Demo": a quiet glass button */
.home-btn-soft {
    background: color-mix(in srgb, #ffffff 24%, transparent);
    border: 1px solid color-mix(in srgb, #ffffff 55%, transparent);
    color: var(--on-hero);
}

.home-btn-soft:hover {
    background: color-mix(in srgb, #ffffff 40%, transparent);
}

:root[data-theme="dark"] .home-btn-soft {
    background: color-mix(in srgb, #ffffff 6%, transparent);
    border-color: color-mix(in srgb, #ffffff 16%, transparent);
}

:root[data-theme="dark"] .home-btn-soft:hover {
    background: color-mix(in srgb, #ffffff 11%, transparent);
}

/* ===== the big screen ===== */

.demo {
    max-width: 1160px;
    margin: 0 auto;
    /* "Explore Demo" stops with the frame just under the menu bar */
    scroll-margin-top: calc(var(--header-height) + 16px);
}

/* a monitor: a dark bezel (a little deeper at the bottom, with the camera dot on top) around the browser, a stand under it */
.demo-frame {
    --bezel: var(--demo-bezel);

    position: relative;
    overflow: hidden;

    border: var(--bezel) solid #151b26;
    border-bottom-width: calc(var(--bezel) * 1.6);
    border-radius: clamp(14px, 1.8vw, 24px);
    background: var(--color-bg);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .06),
        0 0 0 1px rgba(15, 23, 42, .25),
        0 34px 80px -28px rgba(5, 46, 22, .5),
        0 14px 32px -16px rgba(15, 23, 42, .25);
}

.demo-frame::before {
    content: "";
    position: absolute;
    top: calc(var(--bezel) / -2 - 2px);
    left: 50%;
    z-index: 1;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2b3445;
    transform: translateX(-50%);
}

:root[data-theme="dark"] .demo-frame {
    border-color: #2a3242;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .05),
        0 0 0 1px rgba(255, 255, 255, .08),
        0 34px 80px -24px rgba(0, 0, 0, .7),
        0 14px 32px -16px rgba(0, 0, 0, .5);
}

.demo-stand {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.demo-neck {
    width: clamp(70px, 13%, 150px);
    height: clamp(26px, 5vw, 64px);
    background: linear-gradient(90deg, #aeb6c2, #dfe4ea 45%, #c4cbd5);
    clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}

.demo-foot {
    width: clamp(150px, 30%, 340px);
    height: clamp(7px, .9vw, 11px);
    border-radius: 0 0 10px 10px;
    background: linear-gradient(#e6eaef, #b9c1cc);
    box-shadow: 0 14px 24px -10px rgba(15, 23, 42, .35);
}

:root[data-theme="dark"] .demo-neck { background: linear-gradient(90deg, #3a4354, #576173 45%, #434c5e); }
:root[data-theme="dark"] .demo-foot { background: linear-gradient(#5a6476, #394252); box-shadow: 0 14px 24px -10px rgba(0, 0, 0, .6); }

/* the slim browser bar: three dots on the start side, the address in the middle */
.demo-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    height: 42px;
    padding-inline: 16px;

    border-bottom: 1px solid var(--color-border-soft);
    background: var(--color-bg);
}

.demo-dots {
    display: flex;
    gap: 7px;
}

.demo-dots i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--color-border);
}

.demo-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 26px;
    padding: 0 14px;

    border-radius: 8px;
    background: var(--color-bg-soft);

    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.demo-address svg {
    width: 12px;
    height: 12px;
}

/*
   The window into the app: a fixed 16:10 height (720px at most), whatever the screenshot.
   Until a screenshot has loaded it shows a calm sketch of the app (sidebar, three tiles, a chart).
*/
.demo-viewport {
    --sketch: color-mix(in srgb, var(--color-bg) 65%, var(--color-bg-soft));

    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 720px;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--color-text-muted) 60%, transparent) transparent;

    background:
        linear-gradient(var(--sketch), var(--sketch)) 0 0 / 17% 100% no-repeat,
        linear-gradient(var(--color-bg), var(--color-bg)) 25.97% 9.3% / 23% 14% no-repeat,
        linear-gradient(var(--color-bg), var(--color-bg)) 61.04% 9.3% / 23% 14% no-repeat,
        linear-gradient(var(--color-bg), var(--color-bg)) 96.1% 9.3% / 23% 14% no-repeat,
        linear-gradient(var(--color-bg), var(--color-bg)) 86.96% 46.67% / 77% 40% no-repeat,
        var(--color-bg-soft);
}

.demo-viewport:focus-visible {
    outline-offset: -2px;
}

/* while the screen plays by itself it is not scrolled by hand: a wheel over it scrolls the page */
.demo-viewport.is-playing {
    overflow-y: hidden;
}

.demo-shot {
    animation: demo-in .35s ease-out both;
}

.demo-shot:not(.is-active) {
    display: none;
}

.demo-viewport.is-playing .demo-shot.is-active {
    will-change: transform;
}

@keyframes demo-in {
    from { opacity: 0; }
}

.demo-img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
}

/* the screenshot of the current theme (the theme can change while the page is open) */
.demo-img.demo-dark {
    display: none;
}

:root[data-theme="dark"] .demo-img.demo-light {
    display: none;
}

:root[data-theme="dark"] .demo-img.demo-dark {
    display: block;
}

/* a screenshot that is not there (yet): no broken-image icon, the sketch stays */
.demo-img.is-missing {
    display: none !important;
}

/* ===== the four switches ===== */

/* The switches sit on the bottom edge of the screen, floating over it, and stay at the bottom of the window while the screen
   is in sight (sticky), so they show at once even when the screen is taller than the window. The negative top margin lifts
   them onto the screen; the bottom margin gives the room back, so the stand follows the frame. */
.demo-tabs {
    --dock-h: 50px;
    --dock-lift: calc(var(--dock-h) + var(--demo-bezel) * 1.6 + 14px);

    position: sticky;
    bottom: 16px;
    z-index: 3;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;

    width: fit-content;
    max-width: calc(100% - 24px);
    margin: calc(-1 * var(--dock-lift)) auto calc(var(--dock-lift) - var(--dock-h));
    padding: 4px;

    border: 1px solid color-mix(in srgb, var(--color-black) 10%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    box-shadow: 0 12px 30px -12px rgba(15, 23, 42, .35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .demo-tabs {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.demo-tab {
    height: 40px;
    padding: 0 18px;

    border-radius: 10px;

    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--color-text-soft);

    transition: background-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}

.demo-tab:hover {
    color: var(--color-text);
}

.demo-tab[aria-selected="true"] {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .1), 0 0 0 1px var(--color-border);
}

:root[data-theme="dark"] .demo-tab[aria-selected="true"] {
    background: color-mix(in srgb, #ffffff 9%, var(--color-bg-soft));
    box-shadow: 0 0 0 1px color-mix(in srgb, #ffffff 10%, transparent);
}

/* ===== one sentence under the screen ===== */

.demo-says {
    display: grid;
    max-width: 640px;
    margin: 14px auto 0;

    font-size: clamp(16px, 1.3vw, 17px);
    line-height: 1.5;
    text-align: center;
    color: var(--color-text-soft);
}

.demo-says > p {
    grid-area: 1 / 1;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease, visibility .25s;
}

.demo-says > p.is-active {
    visibility: visible;
    opacity: 1;
}

/* ===== phones ===== */

@media (max-width: 640px) {
    :root { --demo-ratio: .75; }

    .home-btn {
        flex: 1 1 auto;
        height: 50px;
        padding: 0 20px;
    }

    .demo-frame {
        border-radius: 12px;
    }

    .demo-bar {
        height: 34px;
        padding-inline: 12px;
    }

    .demo-dots {
        gap: 5px;
    }

    .demo-dots i {
        width: 8px;
        height: 8px;
    }

    .demo-address {
        height: 22px;
        padding: 0 10px;
        font-size: 11.5px;
    }

    /* a bit taller than 16:10, so a narrow screen still shows a useful slice of the page */
    .demo-viewport {
        aspect-ratio: 4 / 3;
    }

    /* one line across the width; on a very narrow screen (or with long words) it scrolls sideways instead of wrapping */
    .demo-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 2px;

        width: 100%;
        margin-top: 18px;

        overflow-x: auto;
        scrollbar-width: none;
    }

    .demo-tabs::-webkit-scrollbar {
        display: none;
    }

    .demo-tab {
        flex: 1 0 auto;
        height: 38px;
        padding: 0 9px;
        font-size: 13.5px;
    }
}


/* ===================================================================
   Below the hero: the product tour, why, privacy, questions and the last call with the setup code (src/pages/index.html).
   The rules above this line are the hero's; nothing here changes them.
   =================================================================== */

.home-sec {
    padding-block: clamp(64px, 9vw, 120px);
}

/* a link to #why, #real-time, #privacy ... stops just under the sticky menu bar */
.home-sec[id],
.tour-row[id] {
    scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ===== the head of a section: a small label, a title with a green half, one line ===== */

.sec-head {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
}

.sec-head.is-start {
    margin-inline: 0;
    text-align: start;
}

.sec-eyebrow {
    display: inline-flex;
    align-items: center;

    min-height: 28px;
    padding: 4px 12px;

    border-radius: 999px;
    background: var(--color-green-soft);

    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #15803d; /* small text: a darker green than --color-green-dark, for 4.5:1 on the soft green and on white */
}

.sec-title {
    margin-top: 16px;

    font-size: clamp(30px, 3.8vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.sec-accent {
    color: var(--color-green-dark);
}

:root[data-theme="dark"] :is(.sec-eyebrow, .sec-accent) {
    color: var(--color-green);
}

.sec-lead {
    max-width: 56ch;
    margin: 14px auto 0;

    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.55;
    color: var(--color-text-soft);
    text-wrap: balance;
}

.sec-head.is-start .sec-lead {
    margin-inline: 0;
}

/* beside other content each half of the title gets its own line, so a line never mixes the two */
.sec-head.is-start .sec-title > span {
    display: block;
}

/* a green square with a line icon (the why cards) */
.sec-icon {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;

    border-radius: 13px;
    background: var(--color-green-soft);
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .sec-icon {
    color: var(--color-green);
}

.sec-icon svg {
    width: 22px;
    height: 22px;
}

/* a bit of code inside a sentence */
.home-sec code {
    padding: 1px 6px;

    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-soft);

    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== why: three cards ===== */

.why-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;

    max-width: 1180px;
    margin: clamp(32px, 4vw, 48px) auto 0;
}

.why-card {
    padding: 28px 26px 30px;

    border: 1px solid var(--color-border-soft);
    border-radius: 22px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

:root[data-theme="dark"] .why-card {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.why-card h3 {
    margin-top: 18px;

    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.why-card p {
    margin-top: 8px;

    font-size: 15.5px;
    line-height: 1.6;
    color: var(--color-text-soft);
}

/* ===== the product tour: text on one side, a focused picture on the other, the sides alternate ===== */

.tour {
    padding-top: clamp(24px, 4vw, 48px);
}

.tour-rows {
    display: grid;
    gap: clamp(56px, 8vw, 112px);

    max-width: 1220px;
    margin: clamp(40px, 6vw, 72px) auto 0;
}

/* the picture gets two thirds of the row: the app's numbers stay readable */
.tour-row {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    align-items: center;
    gap: clamp(32px, 4.5vw, 64px);
}

.tour-row:nth-child(even) {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}

.tour-row:nth-child(even) .tour-shot {
    order: -1;
}

.tour-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    font-weight: 800;
    color: #15803d; /* small text: 4.5:1 on white (as .sec-eyebrow) */
}

:root[data-theme="dark"] .tour-tag {
    color: var(--color-green);
}

.tour-tag svg {
    width: 18px;
    height: 18px;
}

.tour-title {
    margin-top: 10px;

    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.tour-copy {
    max-width: 46ch;
    margin-top: 12px;

    font-size: clamp(16px, 1.3vw, 17.5px);
    line-height: 1.65;
    color: var(--color-text-soft);
}

/* the picture: a crop of the app (twice as sharp as it is shown), in a calm frame */
.tour-shot {
    overflow: hidden;

    border: 1px solid var(--color-border);
    border-radius: clamp(12px, 1.4vw, 18px);
    background: var(--color-bg-soft);
    box-shadow:
        0 28px 60px -32px rgba(5, 46, 22, .4),
        0 10px 24px -14px rgba(15, 23, 42, .18);
}

:root[data-theme="dark"] .tour-shot {
    box-shadow:
        0 28px 60px -28px rgba(0, 0, 0, .75),
        0 0 0 1px rgba(255, 255, 255, .03);
}

.tour-img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
}

/* the picture of the current theme (the theme can change while the page is open; the hidden one is never downloaded) */
.tour-img.tour-dark {
    display: none;
}

:root[data-theme="dark"] .tour-img.tour-light {
    display: none;
}

:root[data-theme="dark"] .tour-img.tour-dark {
    display: block;
}

/* ===== privacy: a soft green band, the title on one side and five lines on the other ===== */

.privacy {
    background: var(--color-green-soft);
}

/* wide: the title and the note on one side, the five lines on the other; narrow: title, lines, note */
.privacy-grid {
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
    grid-template-rows: auto auto;
    gap: 0 clamp(32px, 5vw, 72px);

    max-width: 1220px;
    margin-inline: auto;
}

.privacy-grid > .sec-head {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
}

/* the label would vanish on the band's own green */
.privacy .sec-eyebrow {
    background: var(--color-bg);
}

.privacy-note {
    grid-column: 1;
    grid-row: 2;
    align-self: start;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    max-width: 52ch;
    margin-top: 26px;
    padding: 16px 18px;

    border: 1px solid color-mix(in srgb, var(--color-green) 30%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--color-bg) 72%, transparent);

    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text-soft);
}

.privacy-note svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .privacy-note svg {
    color: var(--color-green);
}

.privacy-list {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;

    padding: 6px clamp(20px, 3vw, 32px);

    border: 1px solid color-mix(in srgb, var(--color-green) 22%, var(--color-border-soft));
    border-radius: 24px;
    background: var(--color-bg);
    box-shadow: 0 24px 50px -34px rgba(5, 46, 22, .45);
}

:root[data-theme="dark"] .privacy-list {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
    box-shadow: none;
}

.privacy-list li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 14px;

    padding-block: 18px;
}

.privacy-list li + li {
    border-top: 1px solid var(--color-border-soft);
}

:root[data-theme="dark"] .privacy-list li + li {
    border-top-color: var(--color-border);
}

.privacy-check {
    display: grid;
    place-items: center;

    width: 28px;
    height: 28px;
    margin-top: 1px;

    border-radius: 50%;
    background: var(--color-green);
    color: var(--color-green-ink);
}

.privacy-check svg {
    width: 15px;
    height: 15px;
}

.privacy-list p {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--color-text-soft);
}

.privacy-list strong {
    display: block;
    margin-bottom: 2px;

    font-size: 17px;
    font-weight: 800;
    color: var(--color-text);
}

/* ===== the tracking code in a dark box with a Copy button (inside the last green band) ===== */

.setup-code {
    max-width: 720px;
    margin: clamp(28px, 4vw, 40px) auto 0;
    overflow: hidden;

    text-align: left;

    border: 1px solid #1e293b;
    border-radius: 14px;
    background: #0b1120;
}

:root[data-theme="dark"] .setup-code {
    border-color: var(--color-border);
    background: #060a14;
}

.setup-code-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding-block: 7px;
    padding-inline: 16px 7px;

    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.setup-code-lang {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #94a3b8;
}

.setup-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    height: 32px;
    padding-inline: 12px;

    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    color: #e2e8f0;

    font-size: 13.5px;
    font-weight: 700;

    transition: background-color .18s var(--ease), color .18s var(--ease);
}

.setup-copy:hover {
    background: rgba(255, 255, 255, .15);
}

.setup-copy svg {
    width: 15px;
    height: 15px;
}

.setup-copy-ok,
.setup-copy.is-done .setup-copy-i {
    display: none;
}

.setup-copy.is-done .setup-copy-ok {
    display: block;
}

.setup-copy.is-done {
    background: var(--color-green);
    color: var(--color-green-ink);
}

.setup-code pre {
    padding: 16px 18px 18px;

    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.65;
    color: #e2e8f0;
    text-align: left;

    /* wraps instead of scrolling: the whole line stays readable on a phone */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* the code's own colours, the same in both themes (it always sits on dark) */
.setup-code code {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    font-weight: 400;
    white-space: inherit;
}

.tok-tag { color: #86efac; }
.tok-attr { color: #93c5fd; }
.tok-str { color: #fcd34d; }

.setup-code :is(.tok-attr, .tok-str) {
    white-space: nowrap;
}

/* the one link to the Overview page, centred under the last row of the tour */
.faq-more.tour-all {
    display: flex;
    justify-content: center;
    margin-top: clamp(40px, 6vw, 64px);

    font-size: 17px;
}

/* ===== questions: one card each, the answer opens under the question ===== */

.faq {
    background: var(--color-bg-soft);
}

:root[data-theme="dark"] .faq {
    background: color-mix(in srgb, var(--color-bg-soft) 55%, var(--color-bg));
}

.faq-list {
    display: grid;
    gap: 12px;

    max-width: 820px;
    margin: clamp(32px, 4vw, 48px) auto 0;
}

.faq-item {
    border: 1px solid var(--color-border-soft);
    border-radius: 18px;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);

    transition: border-color .18s var(--ease);
}

:root[data-theme="dark"] .faq-item {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.faq-item[open] {
    border-color: color-mix(in srgb, var(--color-green) 45%, var(--color-border));
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 19px 22px;

    border-radius: 18px;
    list-style: none;
    cursor: pointer;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-q:focus-visible {
    outline-offset: -2px;
}

.faq-chevron {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);

    transition: transform .2s var(--ease), color .2s var(--ease);
}

.faq-q:hover .faq-chevron {
    color: var(--color-text);
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .faq-item[open] .faq-chevron {
    color: var(--color-green);
}

.faq-a {
    padding: 0 22px 22px;

    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text-soft);
}

.faq-more {
    margin-top: 10px;
}

.faq-more a {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-weight: 700;
    color: #15803d; /* small text: 4.5:1 on white (as .sec-eyebrow) */
}

:root[data-theme="dark"] .faq-more a {
    color: var(--color-green);
}

.faq-more a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-more svg {
    width: 16px;
    height: 16px;
}

[dir="rtl"] .faq-more svg {
    transform: scaleX(-1);
}

/* ===== the last call: a green band like the hero, the same two buttons ===== */

.cta {
    padding-block: clamp(56px, 8vw, 104px) clamp(16px, 3vw, 40px);
}

.cta-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;

    max-width: 1220px;
    margin-inline: auto;
    padding: clamp(44px, 6vw, 80px) clamp(20px, 5vw, 64px);

    border-radius: clamp(22px, 3vw, 32px);
    background: linear-gradient(165deg, var(--hero-top), var(--hero-bottom));
    color: var(--on-hero);
    text-align: center;
}

:root[data-theme="dark"] .cta-band {
    border: 1px solid color-mix(in srgb, var(--color-green) 22%, transparent);
}

/* the hero's wave, faint, along the bottom of the band */
.cta-wave {
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    z-index: -1;

    height: 75%;
    opacity: .5;
    pointer-events: none;
}

.cta-wave svg {
    width: 100%;
    max-width: none;
    height: 100%;
}

.cta-title {
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.cta-accent {
    color: var(--on-hero-accent);
}

:root:not([data-theme="dark"]) .cta-accent {
    color: #14532d; /* white on the light green band is under 3:1 */
}

.cta-lead {
    max-width: 46ch;
    margin: 14px auto 0;

    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.55;
    color: color-mix(in srgb, var(--on-hero) 86%, transparent);
    text-wrap: balance;
}

/* the line under the tracking code */
.cta-hint {
    max-width: 52ch;
    margin: 14px auto 0;

    font-size: 15px;
    line-height: 1.55;
    color: color-mix(in srgb, var(--on-hero) 80%, transparent);
    text-wrap: balance;
}

.cta-hint code {
    border-color: transparent;
    background: color-mix(in srgb, var(--on-hero) 16%, transparent);
    color: inherit;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;

    margin-top: clamp(24px, 3vw, 32px);
}

.cta-note {
    margin-top: 16px;

    font-size: 14px;
    font-weight: 600;
    color: color-mix(in srgb, var(--on-hero) 76%, transparent);
}

/* ===== focus rings: the site's green ring is too faint on white and vanishes on the green band ===== */

:root:not([data-theme="dark"]) .home-sec:not(.cta) :focus-visible {
    outline-color: #15803d;
}

.cta-band :focus-visible {
    outline-color: var(--on-hero);
}

/* ===== narrower screens ===== */

@media (max-width: 960px) {

    .why-cards {
        grid-template-columns: minmax(0, 1fr);
        max-width: 620px;
    }

    /* one column: the text first, then its picture */
    .tour-row,
    .tour-row:nth-child(even) {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .tour-row:nth-child(even) .tour-shot {
        order: 0;
    }

    .tour-copy {
        max-width: 60ch;
    }

    .privacy-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .privacy-grid > .sec-head,
    .privacy-list,
    .privacy-note {
        grid-column: auto;
        grid-row: auto;
    }

    .privacy-note {
        max-width: none;
        margin-top: 0;
    }
}

@media (max-width: 640px) {

    .why-card {
        padding: 22px 20px 24px;
    }

    .setup-code pre {
        padding: 14px 14px 16px;
        font-size: 13px;
    }

    .faq-q {
        padding: 17px 18px;
        font-size: 16px;
    }

    .faq-a {
        padding: 0 18px 18px;
        font-size: 15.5px;
    }

    .cta-wave {
        height: 55%;
    }
}
