/* Token source: paybots-design-system (vendored under design-system/tokens/). */
@import url("/design-system/tokens/colors.css");
@import url("/design-system/tokens/typography.css");
@import url("/design-system/tokens/spacing.css");
@import url("/design-system/tokens/a11y.css");

:root {
    /* Aliased to tokens — exact matches, visually identical */
    --bg: var(--pb-page);
    --bg-muted: var(--pb-surface-hover);
    --surface: var(--pb-surface);
    --text-primary: var(--pb-text);
    --text-secondary: var(--pb-text-muted);
    --accent-light: var(--pb-accent-soft);
    --accent-dark: var(--pb-brand-deep);
    --border-on-surface: var(--pb-border);
    --radius: var(--pb-radius);

    /* Brand / a11y fixes — now match the token spec */
    --text-muted: var(--pb-text-faint);    /* was #8A8A94 — failed 4.5:1 on white */
    --accent: var(--pb-blue);              /* was #5B4FE8 — wrong primary indigo */
    --agent-green: var(--pb-green);        /* was #16A34A — brighter than AA token */
    --agent-amber: var(--pb-amber);        /* was #D97706 */
    --agent-red: var(--pb-red);            /* was #DC2626 */
    --font-sans: var(--pb-font-sans);
    --font-display: var(--pb-font-sans);   /* one heading font: DM Sans (was Plus Jakarta Sans) */
    --font-mono: var(--pb-font-mono);

    /* Spacing — aliased to the 4px token scale (exact) */
    --gutter: var(--pb-space-6);
    --space-xs: var(--pb-space-2);
    --space-sm: var(--pb-space-3);
    --space-md: var(--pb-space-4);
    --space-lg: var(--pb-space-5);
    --space-xl: var(--pb-space-6);
    --space-2xl: var(--pb-space-7);
    --space-intro: var(--pb-space-7);
    --space-stack: var(--pb-space-5);

    /* Site-specific values with no design-system token. */
    --bg-warm: #EEEBE5;           /* warm content band */
    --bg-deep: #E8E5DE;           /* deeper content band */
    --radius-lg: 20px;
    --nav-height: 64px;
    --max-width: 1120px;          /* intentional override of --pb-page-max (1024px) */
    --space-section: 80px;

    /* Surface treatment — reused across cards/panels. Site-tuned lighter than
       --pb-shadow / --pb-elevate-float, so kept local. */
    --surface-border: rgba(228, 224, 216, 0.7);
    --shadow-surface: 0 2px 16px rgba(26, 26, 31, 0.04);
    --shadow-float: 0 8px 28px rgba(26, 26, 31, 0.08);

    /* Adoption terminal — intentionally dark regardless of page theme. */
    --terminal-bg: #1A1A1F;
    --terminal-fg: #F5F3EF;
    --terminal-muted: #9CA3AF;
    --terminal-success: #86EFAC;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
    background-color: var(--bg);
}

a { color: inherit; }

/* Elevated content panels */
.surface {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-surface);
}

.surface h1,
.surface h2,
.surface h3,
.surface p,
.surface li,
.surface strong {
    color: inherit;
}

.surface p,
.surface li {
    color: var(--text-secondary);
}

.surface strong {
    color: var(--text-primary);
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(245, 243, 239, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-on-surface);
}

.nav-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
    letter-spacing: -0.4px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo span { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 31, 0.12);
}

.btn-nav {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 4px;
    transition: color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-link:hover,
.nav-link--active {
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-on-surface);
}

.btn-secondary:hover {
    background: var(--bg-muted);
    transform: translateY(-1px);
}

.hero-ctas {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

/* Hero */
.hero-dark,
.page-hero {
    position: relative;
    background: var(--bg-muted);
    color: var(--text-primary);
    scroll-margin-top: var(--nav-height);
}

.hero-dark-inner,
.page-hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + var(--space-2xl)) var(--gutter) var(--space-xl);
}

.hero-dark-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.hero-dark-copy {
    max-width: 520px;
    align-self: center;
}

.agent-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    padding: var(--space-xs) 14px var(--space-xs) 10px;
    background: var(--surface);
    border: 1px solid var(--border-on-surface);
    border-radius: 999px;
}

.agent-pill-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.hero-dark h1,
.page-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(44px, 6vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-lg);
}

.page-hero h1 {
    font-size: clamp(32px, 4.5vw, 48px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 720px;
}

.hero-dark p,
.page-hero p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 560px;
}

/* Agent console */
.agent-console {
    align-self: center;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.agent-console-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-on-surface);
    background: var(--accent-light);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.console-dot:nth-child(1) { background: var(--pb-red); opacity: 0.7; }
.console-dot:nth-child(2) { background: var(--pb-amber); opacity: 0.7; }
.console-dot:nth-child(3) { background: var(--pb-green); opacity: 0.7; }

.agent-console-body { padding: var(--space-lg); }

.agent-flow {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.agent-flow-step {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs) var(--space-sm);
    padding: 12px var(--space-md);
    background: var(--accent-light);
    border: 1px solid var(--border-on-surface);
    border-radius: var(--radius);
    font-size: 13px;
}

.agent-flow-step .label {
    flex: 1 0 100%;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0;
}

.agent-flow-step .detail {
    color: var(--text-primary);
    line-height: 1.45;
}

.agent-flow-step .status {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px var(--space-xs);
    border-radius: 6px;
    white-space: nowrap;
}

.status-approved {
    color: var(--accent-dark);
    background: var(--accent-light);
}

/* Sections */
.section {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--space-section) var(--gutter);
    scroll-margin-top: var(--nav-height);
    background: var(--section-bg, var(--bg));
}

.section > .section-intro {
    margin-left: auto;
    margin-right: auto;
}

.section > .feature-rows,
.section > .bento-grid,
.section > .adoption-terminal,
.section > .surface {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.section--bg-default { --section-bg: var(--bg); }
.section--bg-warm { --section-bg: var(--bg-warm); }
.section--bg-deep { --section-bg: var(--bg-deep); }

.section--tight-top {
    padding-top: var(--space-2xl);
}

.section-intro {
    max-width: 640px;
    margin-bottom: var(--space-intro);
}

.section-intro.centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    max-width: 720px;
}

.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: var(--space-sm);
}

.section-intro h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    text-wrap: balance;
}

.headline-two-line {
    text-wrap: initial;
}

.headline-two-line .headline-line {
    display: block;
}

.section-intro p {
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* Feature rows */
.feature-rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-stack);
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
    padding: var(--space-2xl);
    min-width: 0;
}

.feature-row-copy,
.feature-row-visual {
    min-width: 0;
    width: 100%;
}

.feature-row-visual {
    container-type: inline-size;
}

.feature-row:nth-child(even) .feature-row-visual { order: -1; }

.feature-row-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: var(--space-sm);
}

.feature-row h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-sm);
}

.feature-row p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.mini-ui {
    background: var(--accent-light);
    border: 1px solid var(--border-on-surface);
    border-radius: var(--radius);
    padding: var(--space-lg);
    font-size: 13px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.mini-ui-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-md);
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-on-surface);
}

.mini-ui-line:last-child { border-bottom: none; }

.mini-ui-line span:first-child {
    color: var(--text-secondary);
    min-width: 0;
}

.mini-ui-line span:last-child {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.mini-ui-line .ok { color: var(--accent-dark); }
.mini-ui-line .pending { color: var(--accent); }

@container (max-width: 340px) {
    .mini-ui-line {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .mini-ui-line span:last-child {
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Bento grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-stack);
}

.bento-card {
    padding: var(--space-xl) var(--space-lg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bento-card--wide {
    grid-column: 1 / -1;
}

.bento-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
}

.bento-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 var(--space-sm);
    letter-spacing: -0.02em;
}

.bento-card--wide h3 {
    font-size: 22px;
}

.bento-card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Adoption terminal */
.adoption-terminal {
    max-width: 640px;
}

.adoption-terminal-body {
    position: relative;
    min-height: 300px;
    padding: var(--space-lg) var(--space-lg) var(--space-xl);
    background: var(--terminal-bg);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-line--cmd {
    color: var(--terminal-fg);
}

.terminal-line--out {
    color: var(--terminal-muted);
}

.terminal-line--success {
    color: var(--terminal-success);
}

.terminal-line--spacer {
    height: 8px;
}

.terminal-cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    animation: terminal-blink 1s step-end infinite;
}

.terminal-cursor[hidden] {
    display: none;
}

@keyframes terminal-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .terminal-cursor {
        animation: none;
    }
}

/* CTA band */
.cta-band {
    padding: var(--space-section) var(--gutter);
    text-align: center;
    background: var(--bg-muted);
}

.cta-band-inner {
    max-width: 560px;
    margin: 0 auto;
}

.cta-band h2 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.5vw, 44px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    text-wrap: balance;
}

.cta-band .contact-line {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto var(--space-lg);
}
.contact-line strong { color: var(--text-primary); }

.contact-line a {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration: none;
}

.contact-line a:hover { text-decoration: underline; }

.cta-band-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-on-surface);
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--gutter) var(--space-lg);
}

.footer-careers {
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-on-surface);
}

.footer-careers p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 560px;
}

.footer-careers strong {
    color: var(--text-primary);
}

.footer-careers a {
    color: var(--accent-dark);
    font-weight: 600;
    text-decoration: none;
}

.footer-careers a:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.footer-bottom p,
.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-links {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

/* Demo gate */
.demo-video-wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
    width: 100%;
}

.demo-video-player {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    box-shadow: var(--shadow-surface);
    width: 100%;
}

.demo-video-embed {
    position: relative;
    aspect-ratio: 16 / 9;
}

.demo-video-thumb {
    position: absolute;
    inset: 0;
    background-color: var(--bg-muted);
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    filter: blur(6px);
}

.demo-video-wrap.is-unlocked .demo-video-thumb {
    display: none;
}

.demo-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 1;
}

.demo-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: rgba(245, 243, 239, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.demo-overlay[hidden],
.demo-video-wrap.is-unlocked .demo-overlay {
    display: none !important;
}

.demo-unlock-form {
    width: 100%;
    max-width: 420px;
    min-width: 0;
    margin: 0 auto;
    padding: var(--space-2xl);
    text-align: center;
    box-shadow: 0 8px 40px rgba(26, 26, 31, 0.12);
    box-sizing: border-box;
}

.demo-unlock-form h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.demo-unlock-form > p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    text-wrap: balance;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.form-field {
    text-align: left;
    margin-bottom: var(--space-md);
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-field input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg);
    border: 1px solid var(--border-on-surface);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus {
    border-color: var(--accent);
    box-shadow: var(--pb-shadow-focus);
}

.form-field input::placeholder {
    color: var(--text-muted);
}

.form-error {
    font-size: 13px;
    color: var(--agent-red);
    margin-bottom: var(--space-md);
}

.demo-unlock-form .btn {
    width: 100%;
}

.demo-unlock-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Audience / content pages */
.content-block.surface {
    padding: var(--space-2xl);
}

.content-block h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 28px;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.content-block.surface h2,
.content-block.surface h3 {
    color: var(--text-primary);
}

.content-block h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.content-block p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted);
}

.content-block.surface p {
    color: var(--text-secondary);
}

.content-block .closing-line {
    margin-top: var(--space-lg);
}

.feature-list-item {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-on-surface);
}

.feature-list-item:first-child { padding-top: 0; }
.feature-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.how-steps { list-style: none; counter-reset: steps; }

.how-steps li {
    counter-increment: steps;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    padding-left: 44px;
    position: relative;
}

.how-steps li:last-child { margin-bottom: 0; }

.how-steps li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.how-steps li strong { color: var(--text-primary); }

.bullet-list {
    list-style: none;
    display: grid;
    gap: 14px;
}

.bullet-list li {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent-dark);
    border-radius: 50%;
}

.bullet-list li strong { color: var(--text-primary); }

.cta-block {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
}

.cta-block h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.cta-block p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 auto var(--space-lg);
    max-width: 440px;
    line-height: 1.65;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    background: var(--text-primary);
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
}

.hero-cta:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* Legal */
.legal {
    max-width: 720px;
    margin: calc(var(--nav-height) + var(--space-lg)) auto var(--space-section);
    padding: var(--space-2xl);
}

.legal h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.legal > p,
.legal p,
.legal li {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.legal h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.legal h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.legal ul { margin: 0 0 var(--space-md) 24px; }

.legal hr {
    border: none;
    border-top: 1px solid var(--border-on-surface);
    margin: var(--space-2xl) 0;
}

.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { color: var(--accent-dark); }

.legal .legal-footer {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: var(--space-xl);
}

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

    .feature-row:nth-child(even) .feature-row-visual { order: 0; }

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

    .bento-card--wide { grid-column: auto; }
}

@media (max-width: 768px) {
    :root {
        --gutter: 20px;
        --space-section: 56px;
        --space-intro: 32px;
        --space-2xl: 32px;
    }

    .feature-row { padding: var(--space-lg); }

    .mini-ui {
        padding: var(--space-md);
    }

    .mini-ui-line {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 0;
    }

    .mini-ui-line span:last-child {
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .adoption-terminal-body { min-height: 260px; font-size: 12px; }
    .legal.surface {
        margin-left: var(--gutter);
        margin-right: var(--gutter);
        padding: var(--space-lg);
    }

    /* Demo gate: grid stacks video + overlay — container grows to fit form */
    .demo-video-wrap:not(.is-unlocked) .demo-video-player {
        display: grid;
        overflow: hidden;
    }

    .demo-video-wrap:not(.is-unlocked) .demo-video-embed {
        grid-area: 1 / 1;
        position: relative;
        aspect-ratio: unset;
        width: 100%;
        min-height: 200px;
        z-index: 0;
    }

    .demo-video-wrap:not(.is-unlocked) .demo-overlay {
        grid-area: 1 / 1;
        position: relative;
        inset: auto;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        padding: var(--space-lg) var(--space-md);
        background: rgba(245, 243, 239, 0.72);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        overflow: hidden;
    }

    .demo-unlock-form {
        width: 100%;
        max-width: 420px;
        min-width: 0;
        padding: var(--space-lg) var(--space-md);
        margin: 0 auto;
    }

    .demo-unlock-form h2 {
        font-size: 22px;
    }

    .demo-unlock-form > p {
        font-size: 14px;
        margin-bottom: var(--space-md);
    }

    .form-field {
        margin-bottom: var(--space-sm);
    }

    .demo-unlock-form .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        gap: var(--space-xs);
        padding: 0 var(--space-md);
    }

    .logo {
        font-size: 17px;
    }

    .nav-actions {
        gap: var(--space-xs);
    }

    .nav-link {
        font-size: 13px;
        padding: 8px 2px;
    }

    .btn-nav {
        padding: 8px 12px;
        font-size: 13px;
    }

    .demo-unlock-form .btn {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    .nav-inner {
        padding: 0 var(--space-sm);
    }

    .logo {
        font-size: 16px;
    }

    .nav-link {
        font-size: 12px;
    }

    .btn-nav,
    .demo-unlock-form .btn {
        padding: 8px 10px;
        font-size: 12px;
    }
}
