/*
 * Function Dynamic: base styles
 * Tokens follow the approved style guide (docs/mockups/home-v3.html).
 * Naming: BEM (block__element--modifier).
 */

/* ---------- Fonts ---------- */

/* Open Sans variable (400 to 700), latin subset, from Google Fonts. OFL licence. */
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/open-sans-latin.woff2") format("woff2");
}

/*
 * Material Symbols Rounded, filled, weight 400. Apache 2.0 licence.
 * Subset to the icons in the mockup's icon_names list (docs/mockups/home-v3.html).
 * To add an icon: append it to that list, download the CSS with a browser user agent,
 * and replace this file with the woff2 it links to.
 */
@font-face {
    font-family: "Material Symbols Rounded";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("../fonts/material-symbols-rounded.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
    --color-bg: #fff;
    --color-tint: #f1f4fa;
    --color-tint-2: #e6ebf5;
    --color-soft: #eef3ff;
    --color-surface: #fff;
    --color-border: #d3dbea;
    --color-ink: #0f1b3d;
    --color-muted: #4a5677;
    --color-primary: #0035bc;
    --color-primary-hover: #001f70;
    --color-on-primary: #fff;
    --color-link: #0035bc;
    --color-link-hover: #001f70;
    --color-band: #0035bc;
    --color-navy: #0f1b3d;
    --color-focus: #2557e6;
    --color-logo: #0035bc;
    --color-glass: rgba(255, 255, 255, 0.72);
    --color-glass-strong: rgba(255, 255, 255, 0.84);
    --color-warning: #e08a00;
    --color-warning-bg: #fff4e0;
    --color-warning-border: #f0c37a;
    --color-warning-text: #8a5300;

    --shadow-1: 0 1px 2px rgba(15, 27, 61, 0.06);
    --shadow-2: 0 12px 28px -14px rgba(0, 30, 110, 0.28);
    --shadow-3: 0 24px 48px -20px rgba(0, 30, 110, 0.38);
    --highlight: 0 0 0 transparent;

    --font-body: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --font-brand: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: Menlo, Consolas, "Liberation Mono", monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --content-width: 1200px;
    --sub-width: 38rem;
    --header-height: 52px;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

    color-scheme: light;
}

/* Dark tokens: system preference unless the visitor picked light. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #0a1126;
        --color-tint: #111b38;
        --color-tint-2: #17234a;
        --color-soft: #111b38;
        --color-surface: #17234a;
        --color-border: #24315a;
        --color-ink: #eaf0fc;
        --color-muted: #a8b3cf;
        --color-primary: #5b86ff;
        --color-primary-hover: #9bb8ff;
        --color-on-primary: #06102a;
        --color-link: #9bb8ff;
        --color-link-hover: #c7d6ff;
        --color-band: #12215a;
        --color-navy: #060b1a;
        --color-focus: #9bb8ff;
        --color-logo: #fff;
        --color-glass: rgba(17, 27, 56, 0.6);
        --color-glass-strong: rgba(17, 27, 56, 0.74);
        --color-warning-bg: #2a2010;
        --color-warning-border: #6b4a12;
        --color-warning-text: #ffcf85;
        --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

        color-scheme: dark;
    }
}

/* Same dark tokens when the visitor picked dark explicitly. */
:root[data-theme="dark"] {
    --color-bg: #0a1126;
    --color-tint: #111b38;
    --color-tint-2: #17234a;
    --color-soft: #111b38;
    --color-surface: #17234a;
    --color-border: #24315a;
    --color-ink: #eaf0fc;
    --color-muted: #a8b3cf;
    --color-primary: #5b86ff;
    --color-primary-hover: #9bb8ff;
    --color-on-primary: #06102a;
    --color-link: #9bb8ff;
    --color-link-hover: #c7d6ff;
    --color-band: #12215a;
    --color-navy: #060b1a;
    --color-focus: #9bb8ff;
    --color-logo: #fff;
    --color-glass: rgba(17, 27, 56, 0.6);
    --color-glass-strong: rgba(17, 27, 56, 0.74);
    --color-warning-bg: #2a2010;
    --color-warning-border: #6b4a12;
    --color-warning-text: #ffcf85;
    --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

    color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
}

/* Mobile menu open: stop the page behind it from scrolling. */
html.menu-open {
    overflow: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-ink);
    font: 16px/1.6 var(--font-body);
}

main {
    flex: 1;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 700;
}

a {
    color: var(--color-link);
}

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

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

.wrap {
    max-width: var(--content-width);
    margin: 0 auto;
    padding-inline: 24px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.skip-link:focus {
    top: 8px;
}

/* Icon: <span class="icon" aria-hidden="true">check_circle</span> */
.icon {
    display: inline-block;
    font-family: "Material Symbols Rounded";
    font-size: 24px;
    font-style: normal;
    font-weight: normal;
    font-variation-settings: "FILL" 1;
    line-height: 1;
    letter-spacing: normal;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Sections ---------- */

.section {
    padding: 96px 0;
}

.section--tint {
    background: var(--color-tint);
}

.section__title {
    max-width: 22em;
    font-size: clamp(1.75rem, 3.2vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.section__lede {
    max-width: var(--sub-width);
    margin: 14px 0 40px;
    color: var(--color-muted);
    font-size: 1.125rem;
    text-wrap: pretty;
}

/* ---------- Button ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font: 600 1rem var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
    background: var(--color-primary-hover);
    color: var(--color-on-primary);
}

.btn--secondary {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-ink);
}

.btn--secondary:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
    color: var(--color-link);
}

/* For use on the primary band, in both themes. */
.btn--inverse {
    background: #fff;
    color: #0035bc;
}

.btn--inverse:hover {
    background: #dbe5ff;
    color: #001f70;
}

.btn--small {
    min-height: 32px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.875rem;
}

/* ---------- Hover arrow ---------- */

/* Chevron that becomes an arrow on hover/focus. Markup: private/views/layout/arrow.php */
.has-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hover-arrow {
    flex: none;
    margin-right: 3px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hover-arrow__line {
    opacity: 0;
    transition: opacity 0.15s var(--ease-out);
}

.hover-arrow__tip {
    transition: transform 0.15s var(--ease-out);
}

.has-arrow:hover .hover-arrow__line,
.has-arrow:focus-visible .hover-arrow__line {
    opacity: 1;
}

.has-arrow:hover .hover-arrow__tip,
.has-arrow:focus-visible .hover-arrow__tip {
    transform: translateX(3px);
}

/* ---------- Header ---------- */

.header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s;
}

.header:hover {
    background: var(--color-glass-strong);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .header {
        background: var(--color-bg);
    }
}

.header__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-ink);
    font: 700 1rem/1 var(--font-brand);
    text-decoration: none;
}

.brand__logo {
    width: 30px;
    fill: var(--color-logo);
}

.header .brand {
    margin-right: auto;
}

.header__links {
    display: flex;
    gap: 6px;
}

.header__links a {
    padding: 5px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    font-size: 0.875rem;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.header__links a:hover,
.header__links a[aria-current="page"] {
    border-color: var(--color-primary);
    background: color-mix(in srgb, var(--color-surface) 30%, transparent);
    color: var(--color-link);
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-ink);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-link);
}

/* Hamburger: three bars that turn into a cross while the menu is open. */
.menu-button {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    margin-left: 4px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: none;
    color: var(--color-ink);
    cursor: pointer;
}

.menu-button:hover {
    border-color: var(--color-primary);
    color: var(--color-link);
}

.menu-button__bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.menu-open .menu-button__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-open .menu-button__bar:nth-child(2) {
    opacity: 0;
}

.menu-open .menu-button__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Mobile menu ---------- */

.mobile-menu,
.mobile-menu-scrim {
    display: none;
}

.mobile-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(10, 17, 38, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + var(--header-height));
    left: 0;
    right: 0;
    z-index: 19;
    padding: 6px 24px 20px;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 20px 20px;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    box-shadow: var(--shadow-3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.3s var(--ease-out), visibility 0.3s;
}

.menu-open .mobile-menu,
.menu-open .mobile-menu-scrim {
    opacity: 1;
    visibility: visible;
}

.menu-open .mobile-menu {
    transform: none;
}

.mobile-menu__links a {
    display: block;
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-ink);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-menu__links a:hover,
.mobile-menu__links a[aria-current="page"] {
    color: var(--color-link);
}

.mobile-menu .btn {
    width: 100%;
    min-height: 48px;
    margin: 18px 0 14px;
    justify-content: center;
}

.mobile-menu__theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.mobile-menu__theme button {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.mobile-menu__theme button:hover {
    border-color: var(--color-primary);
    color: var(--color-link);
}

@media (max-width: 900px) {
    .header__links,
    .header__bar > .btn,
    .header__bar > .theme-toggle {
        display: none;
    }

    .menu-button {
        display: flex;
    }

    .mobile-menu,
    .mobile-menu-scrim {
        display: block;
    }
}

/* ---------- Simple page (404, error) ---------- */

.page {
    padding-top: 96px;
    padding-bottom: 96px;
}

.page__eyebrow {
    margin: 0 0 8px;
    color: var(--color-link);
    font: 600 0.9rem var(--font-mono);
}

.page__title {
    max-width: 14em;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.page__lede {
    max-width: var(--sub-width);
    margin: 18px 0 32px;
    color: var(--color-muted);
    font-size: 1.125rem;
}

.page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Footer ---------- */

.footer {
    background: var(--color-navy);
    color: #fff;
}

.footer__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
}

.footer__row--main {
    min-height: 76px;
}

.footer__row--legal {
    min-height: 44px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8rem;
}

.footer .brand {
    gap: 10px;
    color: #fff;
}

.footer .brand:hover {
    color: #fff;
    opacity: 0.85;
}

.footer .brand__logo {
    width: 28px;
    fill: #fff;
}

.footer__links,
.footer__legal {
    display: flex;
    flex-wrap: wrap;
}

.footer__links {
    gap: 4px 24px;
}

.footer__legal {
    gap: 20px;
}

.footer__links a,
.footer__legal a {
    color: inherit;
    text-decoration: none;
}

.footer__links a {
    font-size: 0.95rem;
    opacity: 0.85;
}

.footer__links a:hover,
.footer__legal a:hover {
    color: #fff;
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer__top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.footer__top:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

@media (max-width: 700px) {
    .footer__row {
        flex-direction: column;
        justify-content: center;
        gap: 18px;
        text-align: center;
    }

    .footer__row--main {
        padding: 40px 16px 32px;
    }

    .footer__row--legal {
        gap: 10px;
        padding: 22px 16px 36px;
    }

    .footer__links,
    .footer__legal {
        justify-content: center;
    }
}

/* ---------- Home: hero ---------- */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(640px, 88vh);
    overflow: hidden;
    background: var(--color-tint);
    border-bottom: 1px solid var(--color-border);
}

/* Flowing lines, drawn by home.js. Faded on the left so the text stays readable. */
.hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2), #000 55%);
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.2), #000 55%);
}

.hero__inner {
    position: relative;
    width: 100%;
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero__title {
    max-width: 11em;
    font-size: clamp(2.5rem, 6.4vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hero__lede {
    max-width: 32em;
    margin: 22px 0 32px;
    color: var(--color-muted);
    font-size: 1.125rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.zoho-strip {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 0.95rem;
}

.zoho-strip p {
    margin-block: 0;
}

.zoho-strip strong {
    color: var(--color-ink);
    font-weight: 600;
}

/* ---------- Home: story ("Every business works differently") ---------- */

/*
 * Tall section with a sticky stage. home.js sets on .story:
 *   --left, --right, --bars  0..1 progress of each logo piece
 *   data-step                1..3, which steps are highlighted
 * and adds .is-on to each chip once its data-at point is passed.
 */
.story {
    position: relative;
    height: 270vh;
}

.story__stage {
    position: sticky;
    top: var(--header-height);
    display: flex;
    align-items: center;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Fades the logo and chips out behind the copy. */
.story__stage::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, var(--color-bg) 0%, var(--color-bg) 33%, color-mix(in srgb, var(--color-bg) 78%, transparent) 45%, transparent 62%);
}

.story__text {
    position: relative;
    z-index: 3;
    width: 100%;
}

.story__copy {
    max-width: 470px;
}

.story__steps {
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: story-step;
}

.story__steps li {
    position: relative;
    padding: 12px 0 12px 48px;
    opacity: 0.4;
    counter-increment: story-step;
    transition: opacity 0.3s;
}

.story__steps li::before {
    content: counter(story-step);
    position: absolute;
    top: 12px;
    left: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-tint);
    color: var(--color-link);
    font-size: 0.875rem;
    font-weight: 700;
}

.story__steps strong {
    display: block;
    font-size: 1.125rem;
}

.story__steps span {
    color: var(--color-muted);
}

.story[data-step="1"] .story__steps li:nth-child(1),
.story[data-step="2"] .story__steps li:nth-child(-n + 2),
.story[data-step="3"] .story__steps li {
    opacity: 1;
}

.story-logo {
    position: absolute;
    top: 50%;
    right: -12vw;
    z-index: 0;
    width: min(1150px, 78vw);
    overflow: visible;
    fill: var(--color-primary);
    transform: translateY(-50%) rotate(-38deg);
}

.story-logo__left {
    opacity: var(--left, 0);
    transform: translateX(calc((1 - var(--left, 0)) * -260px + (1 - var(--bars, 0)) * -60px));
}

.story-logo__right {
    opacity: var(--right, 0);
    transform: translateX(calc((1 - var(--right, 0)) * 260px + (1 - var(--bars, 0)) * 60px));
}

.story-logo__bars {
    opacity: var(--bars, 0);
}

.story-chip {
    position: absolute;
    top: var(--y);
    left: var(--x);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 9px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    box-shadow: var(--shadow-2), var(--highlight);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.45s, transform 0.45s var(--ease-out);
}

.story-chip.is-on {
    opacity: 1;
    transform: none;
}

.story-chip .icon {
    padding: 7px;
    border-radius: 9px;
    background: var(--color-tint);
    color: var(--color-primary);
    font-size: 20px;
}

.story-chip small {
    display: block;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 400;
}

/*
 * Desktop position (--x, --y) per chip. On small screens chips sit in rows
 * counted up from the bottom of the stage (--row), at --mx from the left,
 * so they stay clear of the copy whatever the screen height.
 */
.story-chip--paperwork { --x: 47%; --y: 62%; --mx: 5%; --row: 2; }
.story-chip--approvals { --x: 58%; --y: 76%; --mx: 10%; --row: 1; }
.story-chip--scheduling { --x: 46%; --y: 84%; }
.story-chip--crm { --x: 70%; --y: 14%; --mx: 52%; --row: 2; }
.story-chip--accounting { --x: 78%; --y: 28%; --mx: 56%; --row: 1; }
.story-chip--analytics { --x: 64%; --y: 40%; }
.story-chip--hub { --x: 63%; --y: 52%; --mx: 24%; --row: 0; }

.story-chip--hub {
    background: var(--color-surface);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.6), var(--shadow-3);
}

.story-chip--hub .icon {
    background: var(--color-primary);
    color: #fff;
}

/* Dark: the hub chip becomes solid primary. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .story-chip--hub {
        border-color: transparent;
        background: var(--color-primary);
        box-shadow: var(--shadow-2), var(--highlight);
        color: var(--color-on-primary);
    }

    :root:not([data-theme="light"]) .story-chip--hub .icon {
        background: rgba(255, 255, 255, 0.18);
        color: var(--color-on-primary);
    }

    :root:not([data-theme="light"]) .story-chip--hub small {
        color: inherit;
        opacity: 0.85;
    }
}

:root[data-theme="dark"] .story-chip--hub {
    border-color: transparent;
    background: var(--color-primary);
    box-shadow: var(--shadow-2), var(--highlight);
    color: var(--color-on-primary);
}

:root[data-theme="dark"] .story-chip--hub .icon {
    background: rgba(255, 255, 255, 0.18);
    color: var(--color-on-primary);
}

:root[data-theme="dark"] .story-chip--hub small {
    color: inherit;
    opacity: 0.85;
}

/* "See what we can do for you" cue at the top of the story (desktop only). */
.scroll-cue {
    position: absolute;
    top: 28px;
    left: 50%;
    z-index: 4;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transform: translateX(-50%);
    transition: opacity 0.3s, color 0.15s;
}

.scroll-cue:hover {
    color: var(--color-link);
}

.scroll-cue__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-2), var(--highlight);
    animation: scroll-cue-bob 2.2s ease-in-out infinite;
}

.scroll-cue:hover .scroll-cue__icon {
    border-color: var(--color-primary);
}

@keyframes scroll-cue-bob {
    50% {
        transform: translateY(5px);
    }
}

.is-scrolled .scroll-cue {
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 901px) {
    .scroll-cue {
        display: flex;
    }
}

/* ---------- Home: what we build (live product window) ---------- */

.services {
    --demo-primary-2: #5b86ff;
    --demo-primary-3: #b8caff;
    --demo-grid: rgba(0, 53, 188, 0.07);
    position: relative;
    overflow: hidden;
    padding: 96px 0;
    background: var(--color-tint);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .services {
        --demo-primary-2: #9bb8ff;
        --demo-primary-3: #2c3c72;
        --demo-grid: rgba(155, 184, 255, 0.07);
    }
}

:root[data-theme="dark"] .services {
    --demo-primary-2: #9bb8ff;
    --demo-primary-3: #2c3c72;
    --demo-grid: rgba(155, 184, 255, 0.07);
}

/* 40px grid lines, fading in from the left. */
.services::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--demo-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--demo-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 60%);
    mask-image: linear-gradient(90deg, transparent 20%, #000 60%);
    pointer-events: none;
}

.services .wrap {
    position: relative;
}

.services__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 40px;
}

.services__title {
    max-width: 14em;
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.services__lede {
    max-width: 30rem;
    margin: 14px 0 0;
    color: var(--color-muted);
    font-size: 1.125rem;
}

.services__hint {
    color: var(--color-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.services__grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    align-items: center;
    gap: 40px;
}

.services__tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Shown under the window on small screens, where the tabs hide their text. */
.services__description {
    display: none;
    margin: 14px 0 0;
    color: var(--color-muted);
}

.service-tab {
    position: relative;
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 2px 14px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: none;
    color: var(--color-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.service-tab:hover {
    background: var(--color-surface);
}

.service-tab[aria-selected="true"] {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--shadow-2), var(--highlight);
}

.service-tab__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-surface);
    color: var(--color-primary);
    transition: background 0.25s, color 0.25s;
}

.service-tab[aria-selected="true"] .service-tab__icon {
    grid-row: span 2;
    border-color: transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.service-tab__name {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.service-tab__text {
    display: none;
    color: var(--color-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.service-tab[aria-selected="true"] .service-tab__text {
    display: block;
}

/* Autoplay progress: fills over 6.5s, then home.js moves to the next tab. */
.service-tab__bar {
    position: absolute;
    right: 14px;
    bottom: 6px;
    left: 14px;
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--color-tint-2);
    opacity: 0;
}

.service-tab[aria-selected="true"] .service-tab__bar {
    opacity: 1;
}

.service-tab__progress {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
}

.services.is-autoplay .service-tab[aria-selected="true"] .service-tab__progress {
    animation: service-progress 6.5s linear forwards;
}

.services.is-paused .service-tab__progress {
    animation-play-state: paused !important;
}

.services.is-stopped .service-tab__bar {
    display: none;
}

@keyframes service-progress {
    to { transform: scaleX(1); }
}

/* Browser-style window around the demos. */
.demo-window {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-3), var(--highlight);
}

.demo-window__chrome {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 44px;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-tint);
}

.demo-window__dots {
    display: flex;
    gap: 6px;
}

.demo-window__dots span {
    width: 10px;
    height: 10px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-tint-2);
}

.demo-window__url {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    max-width: 360px;
    height: 26px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-muted);
    font: 12px/1 var(--font-mono);
}

/* Balances the dots so the URL bar stays centred. */
.demo-window__spacer {
    width: 52px;
}

.demo-window__body {
    position: relative;
    min-height: 380px;
    aspect-ratio: 16 / 10.4;
}

/* One demo per tab, stacked; the active one fades in and replays its animations. */
.demo {
    position: absolute;
    inset: 0;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}

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

.demo h3 {
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}

.demo__label {
    color: var(--color-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.demo__card {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    box-shadow: var(--shadow-1);
}

.demo__line {
    display: block;
    height: 8px;
    border-radius: 4px;
    background: var(--color-tint-2);
}

.demo__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-tint);
    color: var(--color-link);
    font-size: 0.75rem;
    font-weight: 700;
}

.demo__chip--solid {
    border-color: transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.demo__chip-icon {
    font-size: 15px;
}

/* Animations, replayed each time a demo becomes active. Finished state is the element's normal style. */
.demo.is-active [data-animate] {
    animation-delay: var(--delay, 0s);
    animation-duration: 0.6s;
    animation-fill-mode: both;
    animation-timing-function: var(--ease-out);
}

.demo.is-active [data-animate="rise"] { animation-name: demo-rise; }
.demo.is-active [data-animate="pop"] { animation-name: demo-pop; }
.demo.is-active [data-animate="slide"] { animation-name: demo-slide; }
.demo.is-active [data-animate="grow"] { animation-name: demo-grow; animation-duration: 0.8s; }
.demo.is-active [data-animate="draw"] { animation-name: demo-draw; animation-duration: 1.4s; }
.demo.is-active [data-animate="up"] { animation-name: demo-up; animation-duration: 0.8s; }
.demo.is-active [data-animate="tidy"] { animation-name: demo-tidy; animation-duration: 0.9s; }

@keyframes demo-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes demo-pop { from { opacity: 0; transform: scale(0.8); } }
@keyframes demo-slide { from { opacity: 0; transform: translateX(26px); } }
@keyframes demo-grow { from { transform: scaleX(0); } }
@keyframes demo-draw { from { stroke-dashoffset: 260; } }
@keyframes demo-up { from { transform: scaleY(0); } }
@keyframes demo-tidy { from { transform: translate(var(--x), var(--y)) rotate(var(--r)); background: var(--color-tint-2); opacity: 0.5; } }

/* data-delay and data-w (inline styles are blocked by the CSP). */
.demo [data-delay=".1"] { --delay: 0.1s; }
.demo [data-delay=".2"] { --delay: 0.2s; }
.demo [data-delay=".25"] { --delay: 0.25s; }
.demo [data-delay=".3"] { --delay: 0.3s; }
.demo [data-delay=".4"] { --delay: 0.4s; }
.demo [data-delay=".5"] { --delay: 0.5s; }
.demo [data-delay=".55"] { --delay: 0.55s; }
.demo [data-delay=".6"] { --delay: 0.6s; }
.demo [data-delay=".7"] { --delay: 0.7s; }
.demo [data-delay=".8"] { --delay: 0.8s; }
.demo [data-delay=".85"] { --delay: 0.85s; }
.demo [data-delay=".9"] { --delay: 0.9s; }
.demo [data-delay="1"] { --delay: 1s; }
.demo [data-delay="1.1"] { --delay: 1.1s; }
.demo [data-delay="1.2"] { --delay: 1.2s; }
.demo [data-delay="1.4"] { --delay: 1.4s; }
.demo [data-delay="1.5"] { --delay: 1.5s; }
.demo [data-delay="1.6"] { --delay: 1.6s; }
.demo [data-delay="1.7"] { --delay: 1.7s; }
.demo [data-delay="1.8"] { --delay: 1.8s; }
.demo [data-delay="2"] { --delay: 2s; }
.demo [data-delay="2.1"] { --delay: 2.1s; }
.demo [data-delay="2.2"] { --delay: 2.2s; }
.demo [data-delay="2.3"] { --delay: 2.3s; }

.demo__line[data-w="40"] { width: 40%; }
.demo__line[data-w="45"] { width: 45%; }
.demo__line[data-w="50"] { width: 50%; }
.demo__line[data-w="55"] { width: 55%; }
.demo__line[data-w="60"] { width: 60%; }
.demo__line[data-w="65"] { width: 65%; }
.demo__line[data-w="70"] { width: 70%; }
.demo__line[data-w="75"] { width: 75%; }
.demo__line[data-w="80"] { width: 80%; }
.demo__line[data-w="85"] { width: 85%; }
.demo__line[data-w="90"] { width: 90%; }
.demo__line[data-w="95"] { width: 95%; }

/* Demo 1: custom applications */
.demo--app {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
}

.demo__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.demo__field {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-tint);
}

.demo__field .demo__line {
    height: 9px;
    background: var(--demo-primary-3);
}

.demo__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.demo__switch {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--color-primary);
}

.demo__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-on-primary);
}

.demo__form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.demo__button {
    padding: 7px 14px;
    border-radius: 9px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.demo__records {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.demo__record {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.demo__avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--color-tint-2);
}

.demo__record .demo__line {
    margin: 3px 0;
}

/* Demo 2: document automation */
.demo--documents {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.demo__paper {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(300px, 52%);
    padding: 22px 22px 18px;
    transform: rotate(-2deg);
}

.demo__paper .demo__line {
    height: 7px;
}

.demo__paper hr {
    width: 60%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.demo__signature {
    width: 150px;
    height: 44px;
    margin-top: 6px;
}

.demo__signature path,
.demo__trend path {
    fill: none;
    stroke: var(--color-primary);
    stroke-linecap: round;
    stroke-dasharray: 260;
}

.demo__signature path {
    stroke-width: 2.5;
}

.demo__steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo__step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.demo__step .icon {
    color: var(--color-primary);
    font-size: 20px;
}

.demo__step--done {
    border-color: transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.demo__step--done .icon {
    color: var(--color-on-primary);
}

/* Demo 3: integrations */
.demo--integrations svg {
    width: 100%;
    height: 100%;
}

.demo__wire {
    fill: none;
    stroke: var(--demo-primary-2);
    stroke-width: 2;
    stroke-dasharray: 5 7;
}

.demo--integrations.is-active .demo__wire {
    animation: demo-flow 1.1s linear infinite;
}

@keyframes demo-flow { to { stroke-dashoffset: -24; } }

.demo__node {
    fill: var(--color-surface);
    stroke: var(--color-border);
}

.demo__hub {
    fill: var(--color-primary);
}

.demo--integrations text {
    dominant-baseline: central;
    fill: var(--color-ink);
    font: 600 13px var(--font-body);
    text-anchor: middle;
}

.demo--integrations .demo__hub-text {
    fill: var(--color-on-primary);
    font-weight: 700;
}

/* Demo 4: data migration. Rows start scattered and settle into the table. */
.demo--migration {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 8px;
    padding: 28px 40px;
}

.demo__table-head,
.demo__row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 10px;
}

.demo__table-head {
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.demo__row {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.demo__row .demo__line:last-child {
    background: var(--demo-primary-3);
}

.demo__row:nth-child(2) { --x: -30px; --y: 6px; --r: -5deg; }
.demo__row:nth-child(3) { --x: 40px; --y: -4px; --r: 4deg; }
.demo__row:nth-child(4) { --x: -18px; --y: 10px; --r: 3deg; }
.demo__row:nth-child(5) { --x: 28px; --y: -8px; --r: -6deg; }
.demo__row:nth-child(6) { --x: -36px; --y: 4px; --r: 5deg; }

.demo__note {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

/* Demo 5: dashboards */
.demo--dashboards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto 1fr;
    gap: 16px;
}

.demo__kpi {
    padding: 14px 16px;
}

.demo__kpi strong {
    display: block;
    margin-top: 2px;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.demo__kpi .demo__line {
    width: 70%;
    margin-top: 8px;
    background: var(--demo-primary-3);
}

.demo__chart {
    display: flex;
    grid-column: span 2;
    align-items: flex-end;
    gap: 12px;
    padding: 16px;
}

.demo__bar {
    flex: 1;
    border-radius: 7px 7px 3px 3px;
    background: var(--color-primary);
    transform-origin: bottom;
}

.demo__bar:nth-child(odd) {
    background: var(--demo-primary-2);
}

.demo__bar:nth-child(1) { height: 38%; }
.demo__bar:nth-child(2) { height: 52%; }
.demo__bar:nth-child(3) { height: 46%; }
.demo__bar:nth-child(4) { height: 64%; }
.demo__bar:nth-child(5) { height: 58%; }
.demo__bar:nth-child(6) { height: 76%; }
.demo__bar:nth-child(7) { height: 70%; }
.demo__bar:nth-child(8) { height: 90%; }

.demo__trend {
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.demo__trend svg {
    flex: 1;
    width: 100%;
}

.demo__trend path {
    stroke-width: 3;
}

/* Demo 6: AI-assisted workflows */
.demo--ai {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
}

.demo__inbox,
.demo__summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.demo__mail {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--color-tint);
}

.demo__mail > .icon {
    color: var(--color-primary);
    font-size: 22px;
}

.demo__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.demo__summary .demo__chip {
    align-self: flex-start;
}

.demo__summary .demo__line {
    height: 7px;
}

/* Tablet and below: services as a 2x3 grid of tabs above the window. */
@media (max-width: 980px) {
    .services__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .services__hint {
        display: none;
    }

    .services__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .services__tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .services__description {
        display: block;
    }

    .service-tab {
        grid-template-columns: 32px 1fr;
        justify-items: start;
        gap: 0 10px;
        padding: 10px 12px 12px 10px;
        border-color: var(--color-border);
        background: var(--color-surface);
    }

    .service-tab[aria-selected="true"] {
        border-color: var(--color-primary);
    }

    .service-tab__icon,
    .service-tab[aria-selected="true"] .service-tab__icon {
        grid-row: auto;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .service-tab__name {
        font-size: 0.84rem;
        line-height: 1.25;
    }

    .service-tab[aria-selected="true"] .service-tab__text {
        display: none;
    }

    .service-tab__bar {
        right: 10px;
        bottom: 5px;
        left: 10px;
    }
}

@media (max-width: 640px) {
    .services {
        padding: 64px 0;
    }

    .demo-window__body {
        height: 430px;
        aspect-ratio: auto;
    }

    .demo--app,
    .demo--ai {
        grid-template-columns: 1fr;
    }

    .demo__records,
    .demo__summary,
    .demo__trend,
    .demo__kpi:nth-child(3),
    .demo__table-head > :nth-child(3),
    .demo__row > :nth-child(3) {
        display: none;
    }

    .demo--dashboards {
        grid-template-columns: 1fr 1fr;
    }

    .demo__chart {
        grid-column: span 2;
    }

    .demo--migration {
        padding: 18px;
    }

    .demo__table-head,
    .demo__row {
        grid-template-columns: 1.4fr 1fr 0.8fr;
    }

    .demo--documents {
        flex-direction: column;
        gap: 16px;
    }

    .demo__paper {
        width: 80%;
    }
}

/* Reduced motion: no autoplay or progress bar (home.js), demos show their finished state. */
@media (prefers-reduced-motion: reduce) {
    .service-tab__bar {
        display: none;
    }

    .demo {
        transition: none;
    }
}

/* ---------- Home: how we work ---------- */

.process {
    position: relative;
    overflow: hidden;
}

/* Faint 20px dot grid in the top-right corner, offset to line up with the 40px grid in "What we build". */
.process::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(color-mix(in srgb, var(--color-primary) 22%, transparent) 1.2px, transparent 1.6px);
    background-position: -10px -10px;
    background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(50% 55% at 100% 0%, #000 0%, transparent 75%);
    mask-image: radial-gradient(50% 55% at 100% 0%, #000 0%, transparent 75%);
    pointer-events: none;
}

.process .wrap {
    position: relative;
}

.process__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

.process__head .section__lede {
    margin-bottom: 0;
}

/* Key card explaining the chart's blocks. */
.chart-key {
    display: flex;
    flex: none;
    align-items: center;
    gap: 16px;
    max-width: 360px;
    padding: 14px 18px 14px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-1), var(--highlight);
}

.chart-key__blocks {
    display: flex;
    flex: none;
    flex-direction: column-reverse;
    gap: 3px;
    width: 34px;
}

.chart-key__blocks span {
    height: 12px;
    border-radius: 4px;
    background: var(--color-primary);
}

.chart-key__blocks span:nth-child(2) {
    opacity: 0.75;
}

.chart-key__blocks span:nth-child(3) {
    opacity: 0.5;
}

.chart-key__title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.chart-key__note {
    display: block;
    margin-top: 4px;
    color: var(--color-link);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Small screens: no dot grid, and the key moves to the end of the section at full width. */
@media (max-width: 900px) {
    .process::before {
        display: none;
    }

    .process .wrap {
        display: flex;
        flex-direction: column;
    }

    .process__head {
        display: contents;
    }

    .process__intro {
        margin-bottom: 28px;
    }

    .chart-key {
        order: 2;
        width: 100%;
        max-width: none;
        margin-top: 32px;
    }
}

/* Growth chart: SVG drawn by growth-chart.js, animated in when scrolled into view (.is-visible). */
.growth {
    margin: 8px 0 44px;
}

.growth svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.growth__axis {
    stroke: var(--color-border);
    stroke-width: 1.5;
}

.growth__block {
    fill: var(--color-primary);
    transform: scaleY(0);
    transform-box: fill-box;
    transform-origin: center bottom;
    transition: transform 0.55s var(--ease-out);
}

.growth__label {
    opacity: 0;
    transition: opacity 0.45s;
}

.growth.is-visible .growth__block {
    transform: none;
}

.growth.is-visible .growth__label {
    opacity: 1;
}

.growth__badge {
    fill: var(--color-primary);
}

.growth__badge-text {
    fill: var(--color-on-primary);
    font: 700 12px var(--font-body);
    text-anchor: middle;
    dominant-baseline: central;
}

.growth__title {
    fill: var(--color-ink);
    font: 700 13px var(--font-body);
    text-anchor: middle;
}

.growth__subtitle {
    fill: var(--color-muted);
    font: 400 12px var(--font-body);
    text-anchor: middle;
}

.growth__bubble {
    fill: var(--color-tint);
    stroke: var(--color-border);
}

.growth__bubble-dot {
    fill: var(--color-primary);
}

.growth__trend {
    fill: none;
    stroke: var(--color-ink);
    stroke-opacity: 0.55;
    stroke-width: 1.6;
    stroke-dasharray: 4 5;
    stroke-linecap: round;
}

.growth__trend-head {
    fill: none;
    stroke: var(--color-ink);
    stroke-opacity: 0.55;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.journey {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: journey;
}

.journey li {
    padding-top: 18px;
    border-top: 2px solid var(--color-border);
    counter-increment: journey;
}

.journey li::before {
    content: counter(journey);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.journey strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.journey span {
    color: var(--color-muted);
}

/* ---------- Home: industries ---------- */

.industries {
    position: relative;
    padding: 72px 0;
    overflow: hidden;
    isolation: isolate;
    background: var(--color-soft);
}

.industries__texture {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(60% 70% at 88% 8%, rgba(0, 53, 188, 0.12), transparent 70%);
}

.industries__glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(70px);
    pointer-events: none;
}

.industries__glow--a { bottom: -60px; left: 4%; width: 520px; height: 300px; opacity: 0.2; }
.industries__glow--b { right: 6%; bottom: 10px; width: 440px; height: 260px; opacity: 0.15; }

.industries__title {
    max-width: 13em;
    font-size: clamp(2rem, 4.6vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.industries__lede {
    max-width: var(--sub-width);
    margin: 18px 0 28px;
    color: var(--color-muted);
    font-size: 1.125rem;
    text-wrap: pretty;
}

.industries__cta {
    margin-bottom: 48px;
}

.marquee {
    margin: 0 0 12px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* The items are listed twice, so moving by half the width loops seamlessly. */
.marquee__track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: marquee 80s linear infinite;
}

@keyframes marquee {
    to {
        transform: translateX(-50%);
    }
}

.marquee__item {
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-ink);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.marquee__item--you {
    border-color: transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.foundations {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

/* Glass card with an icon: home foundations, about page facts. */
.glass-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
    box-shadow: var(--shadow-2), var(--highlight);
    font-weight: 600;
}

.glass-chip .icon {
    padding: 8px;
    border-radius: 10px;
    background: var(--color-tint);
    color: var(--color-primary);
    font-size: 22px;
}

/* ---------- Home: responsive ---------- */

@media (max-width: 900px) {
    .story__stage {
        align-items: flex-start;
        padding-top: 28px;
    }

    .story__stage::before {
        background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg) 44%, transparent 68%);
    }

    .story-logo {
        top: auto;
        right: -55vw;
        bottom: -20vh;
        width: 150vw;
        transform: rotate(-38deg);
    }

    .story-chip {
        top: auto;
        bottom: calc(var(--chip-base, 16px) + var(--row) * var(--chip-row, 60px));
        left: var(--mx);
        font-size: 0.85rem;
    }

    .story-chip small,
    .story-chip--desktop {
        display: none;
    }

    .journey {
        grid-template-columns: 1fr 1fr;
        gap: 28px 24px;
    }

    .foundations {
        grid-template-columns: 1fr 1fr;
    }
}

/* Short screens: drop the middle row of chips and tighten the rest so they fit below the copy. */
@media (max-width: 900px) and (max-height: 720px) {
    .story__stage {
        --chip-base: 12px;
        --chip-row: 56px;
    }

    .story-chip--approvals,
    .story-chip--accounting {
        display: none;
    }

    .story-chip--paperwork,
    .story-chip--crm {
        --row: 1;
    }
}

@media (max-width: 560px) {
    .story__steps li {
        padding: 6px 0 6px 48px;
    }

    .story__steps li::before {
        top: 6px;
    }

    .growth {
        margin-bottom: 32px;
    }

    .journey {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .industries {
        padding: 56px 0;
    }

    .foundations {
        grid-template-columns: 1fr;
    }
}

/* Reduced motion: no scroll-driven story, static marquee that wraps. */
@media (prefers-reduced-motion: reduce) {
    .story {
        height: auto;
    }

    .story__stage {
        position: relative;
        top: 0;
        height: 780px;
    }

    .story__steps li {
        opacity: 1;
    }

    /* Static list: show it once, without the faded edges. */
    .marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .marquee__track {
        flex-wrap: wrap;
        width: auto;
        max-width: var(--content-width);
        margin: 0 auto;
        padding-inline: 24px;
    }

    .marquee__item--copy {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) and (max-width: 560px) {
    .marquee__track {
        padding-inline: 16px;
    }
}

/* ---------- About ---------- */

.about {
    padding-bottom: 24px;
}

.about__hero {
    padding-top: 80px;
    padding-bottom: 56px;
}

.about__title {
    max-width: var(--sub-width);
    font-size: clamp(2.25rem, 4.8vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.about__lede {
    max-width: var(--sub-width);
    margin: 20px 0 0;
    color: var(--color-muted);
    font-size: 1.15rem;
    text-wrap: pretty;
}

/* Numbered sections: title right-aligned beside a 44px number, joined by a dashed line. */
.about-steps {
    margin-top: 0;
    margin-bottom: 0;
    list-style: none;
}

.about-step {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    padding-bottom: 72px;
}

.about-step:last-child {
    padding-bottom: 40px;
}

.about-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 52px;
    bottom: 8px;
    left: 178px;
    border-left: 2px dashed var(--color-border);
}

.about-step__mark {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    height: 44px;
}

.about-step__title {
    color: var(--color-link);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.about-step__number {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 8px var(--color-bg);
    color: var(--color-on-primary);
    font-size: 1.05rem;
    font-weight: 700;
}

.about-step__body {
    min-width: 0;
}

.about-step__body h2 {
    margin: 2px 0 18px;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.about-step__body p {
    margin: 0 0 14px;
    color: var(--color-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Leadership: copy beside the portrait, centred against it. */
.about-lead {
    display: grid;
    grid-template-columns: 1fr 220px;
    align-items: center;
    gap: 40px;
}

.about-lead p:last-child {
    margin-bottom: 0;
}

.about-lead__photo {
    margin: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-tint);
}

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

/* Closing CTA (CTA treatment: soft background, glow, glass chips). */
.about-end {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 72px 0;
    background: var(--color-soft);
}

.about-end::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(55% 60% at 90% 0%, rgba(0, 53, 188, 0.12), transparent 70%);
}

.about-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(80px);
    pointer-events: none;
}

.about-glow--c { right: 8%; bottom: -80px; width: 520px; height: 300px; opacity: 0.15; }

.about-end .section__lede {
    margin-bottom: 28px;
}

.about-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 44px 0 0;
    padding: 0;
    list-style: none;
}

/* Two-line glass chip: icon beside a title and a small note. */
.glass-chip--detail {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: center;
    gap: 0 12px;
    padding: 14px 16px 14px 12px;
}

.glass-chip--detail .icon {
    grid-row: span 2;
}

.glass-chip--detail strong {
    align-self: end;
    font-weight: 600;
    line-height: 1.3;
}

.glass-chip--detail small {
    align-self: start;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .about-lead {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .about-lead__photo {
        order: -1;
        width: min(260px, 70%);
    }

    .about-facts {
        grid-template-columns: 1fr;
    }
}

/* Small screens: number above the copy, no connector line. */
@media (max-width: 760px) {
    .about__hero {
        padding-top: 56px;
        padding-bottom: 40px;
    }

    .about-step {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-bottom: 48px;
    }

    .about-step:last-child {
        padding-bottom: 32px;
    }

    .about-step:not(:last-child)::before {
        display: none;
    }

    .about-step__mark {
        justify-content: flex-start;
        height: auto;
    }

    .about-step__number {
        width: 36px;
        height: 36px;
        box-shadow: none;
        font-size: 0.95rem;
    }
}

@media (max-width: 560px) {
    .about-end {
        padding: 56px 0;
    }
}

/* ---------- Form fields ---------- */

.field {
    display: block;
    margin-bottom: 18px;
}

.field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.field__input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-tint);
    color: var(--color-ink);
    font: inherit;
}

.field__input:focus {
    border-color: var(--color-primary);
    outline: 2px solid var(--color-primary);
    outline-offset: 0;
}

.field__input[aria-invalid="true"] {
    border-color: var(--color-warning-border);
}

.field__error {
    margin: 6px 0 0;
    color: var(--color-warning-text);
    font-size: 0.875rem;
    font-weight: 600;
}

textarea.field__input {
    min-height: 120px;
    resize: vertical;
}

/* Amber notice: warnings and form errors (the only use of amber). */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--color-warning-border);
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius-md);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    font-size: 0.9rem;
}

.notice .icon {
    color: var(--color-warning);
    font-size: 20px;
}

/* Two fields side by side (first and last name). */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

/* ---------- Contact ---------- */

/*
 * Split screen: intro on the left, form on the right. The outer padding
 * lines both halves up with the 1200px content width on wide screens.
 */
.contact {
    --edge: max(24px, calc((100vw - var(--content-width)) / 2 + 24px));

    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - var(--header-height));
}

.contact__intro {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 64px 56px 48px var(--edge);
    overflow: hidden;
    isolation: isolate;
    background: var(--color-soft);
}

.contact__deco {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.contact__deco--texture {
    inset: 0;
    background: radial-gradient(60% 50% at 85% 0%, rgba(0, 53, 188, 0.1), transparent 70%);
}

.contact__deco--a,
.contact__deco--b {
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(80px);
}

.contact__deco--a { top: 12%; right: -60px; width: 440px; height: 300px; opacity: 0.16; }
.contact__deco--b { bottom: 6%; left: -80px; width: 380px; height: 260px; opacity: 0.1; }

.contact__title {
    max-width: 11em;
    margin: 0 0 16px;
    font-size: clamp(2.25rem, 4.4vw, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.contact__lede {
    max-width: var(--sub-width);
    margin: 0 0 44px;
    color: var(--color-muted);
    font-size: 1.125rem;
    text-wrap: pretty;
}

.contact__heading {
    margin: 0 0 16px;
    font-size: 1.1rem;
    letter-spacing: -0.015em;
}

/* Numbered steps joined by a dashed line. */
.next-steps {
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
    counter-reset: next-step;
}

.next-steps li {
    position: relative;
    padding: 0 0 20px 46px;
    counter-increment: next-step;
}

.next-steps li::before {
    content: counter(next-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.next-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 4px;
    left: 14px;
    border-left: 2px dashed var(--color-border);
}

.next-steps strong {
    display: block;
}

.next-steps span {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.contact-facts {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-facts li {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    column-gap: 14px;
}

.contact-facts .icon {
    display: grid;
    grid-row: span 2;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 20px;
}

.contact-facts strong {
    font-weight: 600;
    line-height: 1.3;
}

.contact-facts small {
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Pinned to the bottom of the intro column. */
.contact__note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: auto 0 0;
    padding-top: 40px;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.contact__note .icon {
    color: var(--color-primary);
    font-size: 20px;
}

.contact__main {
    padding: 64px var(--edge) 72px 56px;
}

.contact__main > * {
    max-width: 600px;
}

.contact__subheading {
    margin: 0 0 16px;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.checklist {
    margin: 0 0 40px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-tint);
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0;
}

.checklist .icon {
    margin-top: 2px;
    color: var(--color-primary);
    font-size: 20px;
}

.checklist a {
    font-weight: 600;
}

.contact-form__submit {
    justify-content: center;
    width: 100%;
    min-height: 48px;
}

/* Spam trap field: moved off screen rather than display: none, which some bots skip. */
.contact-form__trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form__fine {
    margin: 12px 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
    text-align: center;
}

@media (max-width: 900px) {
    .contact {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .contact__intro {
        padding: 48px 24px 40px;
    }

    .contact__main {
        padding: 48px 24px 64px;
    }

    .contact__note {
        margin-top: 8px;
    }
}

@media (max-width: 560px) {
    .contact__intro,
    .contact__main {
        padding-right: 16px;
        padding-left: 16px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- Contact: thanks ---------- */

/* CTA treatment: soft background, glows and a glass card. The logo assembles, then the copy rises in. */
.thanks {
    position: relative;
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--header-height));
    padding: 72px 24px;
    overflow: hidden;
    isolation: isolate;
    background: var(--color-soft);
}

.thanks::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(60% 55% at 50% 0%, rgba(0, 53, 188, 0.12), transparent 70%);
}

.thanks__glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    background: var(--color-primary);
    filter: blur(90px);
    pointer-events: none;
}

.thanks__glow--a { bottom: 4%; left: 8%; width: 520px; height: 320px; opacity: 0.16; }
.thanks__glow--b { top: 12%; right: 6%; width: 440px; height: 280px; opacity: 0.13; }

.thanks__card {
    width: 100%;
    max-width: 620px;
    padding: 48px 44px 40px;
    border: 1px solid var(--color-border);
    border-radius: 28px;
    background: var(--color-glass);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    box-shadow: var(--shadow-3), var(--highlight);
    text-align: center;
}

.thanks__mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 180px;
    height: 132px;
    margin: 0 auto 28px;
}

.thanks__logo {
    width: 150px;
    overflow: visible;
    fill: var(--color-primary);
}

.thanks__f {
    animation: thanks-from-left 0.7s var(--ease-out) 0.15s both;
}

.thanks__j {
    animation: thanks-from-right 0.7s var(--ease-out) 0.15s both;
}

.thanks__block {
    transform-box: fill-box;
    transform-origin: center;
    animation: thanks-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}

.thanks__block--1 { animation-delay: 0.85s; }
.thanks__block--2 { animation-delay: 1s; }

.thanks__ring {
    position: absolute;
    inset: -6px 6px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: thanks-ring 1s ease-out 1.15s both;
}

.thanks__check {
    position: absolute;
    right: 4px;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: var(--shadow-2);
    animation: thanks-pop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) 1.25s both;
}

.thanks__check svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 24;
    animation: thanks-draw 0.4s ease-out 1.55s both;
}

.thanks__eyebrow,
.thanks__title,
.thanks__lede,
.thanks__steps,
.thanks__actions {
    animation: thanks-rise 0.55s var(--ease-out) both;
}

.thanks__eyebrow {
    margin: 0 0 8px;
    color: var(--color-link);
    font-size: 0.9rem;
    font-weight: 700;
    animation-delay: 1.35s;
}

.thanks__title {
    margin: 0 0 12px;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
    text-wrap: balance;
    animation-delay: 1.45s;
}

.thanks__lede {
    max-width: 30rem;
    margin: 0 auto 28px;
    color: var(--color-muted);
    font-size: 1.1rem;
    text-wrap: pretty;
    animation-delay: 1.55s;
}

.thanks__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 0 32px;
    padding: 16px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    list-style: none;
    text-align: left;
    animation-delay: 1.65s;
}

.thanks__step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.3;
}

.thanks__step strong {
    font-weight: 600;
}

.thanks__step--done {
    color: var(--color-ink);
}

.thanks__dot {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-tint);
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.thanks__step--done .thanks__dot {
    border-color: transparent;
    background: var(--color-primary);
}

.thanks__dot svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--color-on-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.thanks__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    animation-delay: 1.75s;
}

@keyframes thanks-from-left { from { opacity: 0; transform: translateX(-140px); } }
@keyframes thanks-from-right { from { opacity: 0; transform: translateX(140px); } }
@keyframes thanks-pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes thanks-ring { 0% { opacity: 0.6; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes thanks-draw { from { stroke-dashoffset: 24; } }
@keyframes thanks-rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 640px) {
    .thanks {
        align-items: start;
        padding: 40px 16px;
    }

    .thanks__card {
        padding: 36px 22px 28px;
        border-radius: 22px;
    }

    .thanks__steps {
        grid-template-columns: 1fr;
    }

    .thanks__actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* ---------- Legal pages (Terms, Privacy) ---------- */

.legal {
    --warning-red-bg: #fef3f2;
    --warning-red-border: #fecdca;
    --warning-red-accent: #b42318;
    --warning-red-text: #7a1a12;
    padding-top: 56px;
    padding-bottom: 96px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .legal {
        --warning-red-bg: #2a1215;
        --warning-red-border: #5c1d1d;
        --warning-red-accent: #ff8a80;
        --warning-red-text: #ffd1cc;
    }
}

:root[data-theme="dark"] .legal {
    --warning-red-bg: #2a1215;
    --warning-red-border: #5c1d1d;
    --warning-red-accent: #ff8a80;
    --warning-red-text: #ffd1cc;
}

.legal__head {
    margin-bottom: 40px;
}

.legal__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.legal__meta {
    margin: 10px 0 18px;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.legal__summary {
    margin: 0;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    background: var(--color-tint);
}

.legal__grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: start;
    gap: 56px;
}

/* Table of contents stays in view while the sections scroll. */
.legal-toc {
    position: sticky;
    top: 76px;
    font-size: 0.9rem;
}

.legal-toc__label {
    margin: 0 0 8px;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.legal-toc ol {
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--color-border);
    list-style: none;
}

.legal-toc a {
    display: block;
    margin-left: -1px;
    padding: 5px 0 5px 14px;
    border-left: 2px solid transparent;
    color: var(--color-muted);
    text-decoration: none;
}

.legal-toc a:hover {
    border-left-color: var(--color-primary);
    color: var(--color-link);
}

.legal__body {
    max-width: 720px;
}

.legal__section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: 76px;
}

.legal__section:last-child {
    border-bottom: 0;
}

.legal__section h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    letter-spacing: -0.015em;
}

.legal__number {
    color: var(--color-link);
}

.legal__section p {
    margin: 0 0 10px;
    color: var(--color-muted);
}

.legal__section p:last-child {
    margin-bottom: 0;
}

.legal__section ul {
    margin: 0 0 10px;
    padding-left: 20px;
    color: var(--color-muted);
}

.legal__section li {
    margin: 6px 0;
}

.legal__section strong {
    color: var(--color-ink);
    font-weight: 600;
}

/* Red callout: approved for legal pages only (amber stays the site's warning colour elsewhere). */
.legal__section .legal__warning {
    margin: 14px 0;
    padding: 14px 18px;
    border: 1px solid var(--warning-red-border);
    border-left: 3px solid var(--warning-red-accent);
    border-radius: var(--radius-md);
    background: var(--warning-red-bg);
    color: var(--warning-red-text);
}

@media (max-width: 900px) {
    .legal__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .legal-toc {
        position: static;
    }
}

@media (max-width: 560px) {
    .legal {
        padding-top: 40px;
        padding-bottom: 64px;
    }
}

/* ---------- Listing pages (Resources, Tools) and resource cards ---------- */

.listing {
    padding: 56px 0 88px;
}

.listing__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.listing__lede {
    max-width: var(--sub-width);
    margin: 12px 0 36px;
    color: var(--color-muted);
    font-size: 1.125rem;
}

.listing__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.listing__empty {
    margin: 0;
    padding: 24px 0;
    color: var(--color-muted);
}

.listing__empty:empty {
    display: none;
}

.more-link {
    margin-top: 32px;
    font-weight: 600;
    text-decoration: none;
}

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

/* Search box with a leading icon. */
.search {
    position: relative;
    flex: 1 1 260px;
    max-width: 360px;
}

.search .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--color-muted);
}

.search__input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-ink);
    font: inherit;
}

.search__input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 0;
    border-color: var(--color-primary);
}

/* Segmented control: one pressed button at a time. */
.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-tint);
}

.segmented button {
    padding: 6px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-muted);
    font: 600 0.9rem var(--font-body);
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: var(--color-surface);
    color: var(--color-ink);
    box-shadow: var(--shadow-1);
}

/* Filter chips: a horizontally scrolling row. */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.filter-chips button {
    flex: none;
    padding: 5px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-ink);
    font: 600 0.88rem var(--font-body);
    cursor: pointer;
}

.filter-chips button:hover {
    border-color: var(--color-primary);
}

.filter-chips button[aria-pressed="true"] {
    border-color: transparent;
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 24px;
}

/* Cards and the featured card are links: no underline on their content. */
.resource-card,
.resource-feature {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* Lets long code lines in guide thumbnails clip instead of widening the column. */
.resource-card {
    min-width: 0;
}

.resource-card[hidden] {
    display: none;
}

.resource-card:hover {
    color: inherit;
}

.resource-card .resource-thumb {
    margin-bottom: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.resource-card:hover .resource-thumb {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}

.resource-card__title {
    margin: 8px 0 6px;
    font-size: 1.05rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.resource-card:hover .resource-card__title {
    color: var(--color-link);
}

.resource-feature {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 32px;
    margin-bottom: 40px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-2), var(--highlight);
}

.resource-feature:hover {
    color: inherit;
}

.resource-feature__title {
    margin: 10px 0;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.resource-feature:hover .resource-feature__title {
    color: var(--color-link);
}

.resource-feature__summary {
    display: block;
    margin-bottom: 14px;
    color: var(--color-muted);
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.resource-meta__type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-link);
    font-size: 0.78rem;
    font-weight: 600;
}

.resource-meta__type .icon {
    font-size: 16px;
}

.resource-meta__topic {
    padding: 1px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.resource-meta__date {
    display: block;
    color: var(--color-muted);
    font: 12.5px/1.4 var(--font-mono);
}

/* Generated 16:9 thumbnails. */
.resource-thumb {
    position: relative;
    display: flex;
    align-items: flex-end;
    aspect-ratio: 16 / 9;
    padding: 14px;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.resource-thumb--video {
    background: var(--color-band);
    color: #fff;
}

.resource-thumb__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: auto;
    border-radius: 50%;
    background: #fff;
    color: #0035bc;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}

.resource-thumb__play .icon {
    font-size: 30px;
}

.resource-thumb__caption {
    position: relative;
    max-width: 80%;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.25;
}

.resource-thumb--guide {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 16px;
    background: var(--color-navy);
    color: #cfe0ff;
    font: 12px/1.6 var(--font-mono);
}

.resource-thumb__line {
    white-space: pre;
}

.resource-thumb__comment {
    color: #9bb8ff;
    opacity: 0.6;
}

.resource-thumb__keyword {
    color: #8fabff;
}

.resource-thumb--article {
    align-items: center;
    justify-content: center;
    background: var(--color-soft);
    color: var(--color-primary);
}

.resource-thumb--article .icon {
    font-size: 44px;
}

@media (max-width: 900px) {
    .resource-feature {
        grid-template-columns: 1fr;
    }

    .resource-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .listing {
        padding: 40px 0 64px;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Tools landing page ---------- */

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 12px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-1), var(--highlight);
    color: var(--color-ink);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tool-card[hidden] {
    display: none;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-2), var(--highlight);
    color: var(--color-ink);
}

/* Same code panel as guide thumbnails. */
.tool-card__preview {
    height: 112px;
    margin-bottom: 18px;
    padding: 14px 16px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-navy);
    color: #cfe0ff;
    font: 12.5px/1.6 var(--font-mono);
    white-space: pre;
}

.tool-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 8px 8px;
}

.tool-card__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--color-tint);
    color: var(--color-primary);
}

.tool-card__name {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.tool-card__description {
    margin: 0 8px 14px;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.tool-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: auto 8px 0;
}

.tool-card__category {
    padding: 1px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.tool-card__open {
    color: var(--color-link);
    font-size: 0.92rem;
    font-weight: 600;
}

.tool-card:hover .hover-arrow__line {
    opacity: 1;
}

.tool-card:hover .hover-arrow__tip {
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
    .wrap {
        padding-inline: 16px;
    }

    .section {
        padding: 64px 0;
    }

    .mobile-menu {
        padding: 6px 16px 20px;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
