body[data-page="home"] {
    --gutter: max(30px, calc((100vw - 1280px) / 2));
    --page: min(1280px, calc(100vw - 2 * var(--gutter)));
    --header-height: 72px;
    background: var(--paper);
}

body[data-page="home"] :focus-visible {
    outline: 2px solid #be6247;
    outline-offset: 5px;
}

body[data-page="home"] .site-header {
    position: fixed;
    inset: 0 0 auto;
    min-height: var(--header-height);
    padding-inline: var(--gutter);
    border-bottom-color: #d8ccba;
    background: var(--paper);
    box-shadow: none;
}

body[data-page="home"] .site-nav a {
    font-size: 14px;
}

body[data-page="home"] .site-header .brand {
    gap: 7px;
}

.dive-track {
    --stage-height: 100svh;
    --travel: 105svh;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.dive-stage {
    position: relative;
    display: grid;
    grid-template-columns: 46% 54%;
    align-items: center;
    min-height: var(--stage-height);
    padding: calc(var(--header-height) + 38px) var(--gutter) 54px;
    isolation: isolate;
}

.dive-track.is-pinned {
    height: calc(var(--stage-height) + var(--travel));
}

.is-pinned .dive-stage {
    position: sticky;
    top: 0;
    height: var(--stage-height);
}

.dive-copy {
    position: relative;
    z-index: 1;
    max-width: 590px;
    padding: 32px 6vw 34px 0;
    opacity: var(--copy-opacity, 1);
    transform: translateX(var(--copy-shift, 0px));
    pointer-events: auto;
}

.dive-copy[inert],
.robot-guide-hero[inert] {
    pointer-events: none;
}

.dive-copy h1,
.dive-copy .hero-slogan {
    display: block;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    font: 900 clamp(42px, 4.8vw, 80px)/1.16 var(--font-display);
    letter-spacing: 0;
    text-align: left;
    text-wrap: nowrap;
    overflow-wrap: normal;
}

.hero-slogan > span {
    display: block;
}

.dive-summary {
    max-width: 25em;
    margin: 26px 0 0;
    color: var(--ink-soft);
    font-size: clamp(15px, 1.2vw, 18px);
    line-height: 1.85;
    text-wrap: pretty;
}

.dive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.dive-actions .button {
    min-height: 48px;
    padding-inline: 18px;
}

.dive-actions .button span {
    margin-left: 14px;
}

.dive-scroll {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 48px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.1em;
}

.dive-scroll span {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    transition: transform 250ms ease;
}

.dive-scroll:hover span {
    transform: translateY(4px);
}

/* The outer field diffuses into paper before the scroll aperture opens. */
.legal-field {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    clip-path: inset(var(--field-top, 86px) var(--field-right, var(--gutter))
        var(--field-bottom, 36px) var(--field-left, 48%));
    pointer-events: auto;
}

.legal-field[inert] {
    pointer-events: none;
}

.field-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle var(--field-radius, 24vmin) at var(--ring-x, 75%) var(--ring-y, 50%),
            #c99a6354, #c99a6318 61.8%, transparent 96%),
        radial-gradient(#88603b35 .75px, transparent 1px) 0 0 / 8px 8px,
        var(--paper);
    mask-image: radial-gradient(circle var(--field-radius, 24vmin) at
        var(--ring-x, 75%) var(--ring-y, 50%), #000 84%, #000b 92%, transparent 100%);
}

.is-pinned .legal-field.is-opening {
    mask-image: radial-gradient(circle at var(--ring-x, 75%) var(--ring-y, 50%),
        transparent var(--opening, 0px), #000 calc(var(--opening, 0px) + var(--aperture-fade, 24px)));
}

#legalRings {
    display: block;
    width: 100%;
    height: 100%;
}

.field-labels {
    position: absolute;
    top: calc(var(--header-height) + 14px);
    right: calc(var(--field-right, var(--gutter)) + 12px);
    opacity: var(--field-label-opacity, 1);
    pointer-events: none;
}

.field-focus {
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper);
    color: var(--ink-soft);
    font-size: 11px;
    pointer-events: auto;
}

.field-focus:hover,
.field-focus[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

body[data-page="home"] .robot-guide-hero {
    position: absolute;
    z-index: 3;
    right: calc(var(--gutter) + 16px);
    bottom: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: auto;
    gap: 5px;
    transform: none;
    opacity: var(--copy-opacity, 1);
}

.robot-guide-hero .robot-bubble {
    width: 184px;
    padding: 11px 14px;
    border-radius: 11px 11px 3px 11px;
    background: var(--paper-strong);
    pointer-events: auto;
}

.robot-guide-hero .robot-bubble::after {
    width: 11px;
    height: 11px;
    right: -6px;
    bottom: 20px;
    border-bottom: 0;
    border-top: 1px solid #cbb9a7;
    transform: rotate(45deg);
}

.robot-guide-hero .robot-bubble p {
    min-height: 38px;
    margin: 5px 0 2px;
    font-size: 13px;
}

.robot-guide-hero .robot-avatar {
    width: 86px;
    height: 86px;
    margin: 0;
    pointer-events: auto;
}

.robot-guide-hero .robot-avatar img {
    width: 76px;
    height: 76px;
}

.robot-guide-hero .robot-avatar-ring {
    border-color: #e2b09180;
}

body[data-page="home"] .section {
    padding-block: clamp(68px, 9vw, 126px);
    scroll-margin-top: calc(var(--header-height) - 12px);
    background: transparent;
}

.is-pinned + .workbench-section {
    margin-top: calc(-1 * var(--stage-height));
}

.workbench-section {
    --stage-height: 100svh;
}

.workbench-section .section-heading {
    text-align: center;
    margin-bottom: 28px;
}

.workbench-section .section-heading p {
    margin-inline: auto;
}

.solution-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    max-width: 760px;
    margin: 0 auto 22px;
    padding: 17px clamp(16px, 3vw, 30px);
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--accent);
    border-radius: 2px;
    background: var(--paper-strong);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.solution-tool:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.solution-tool-description {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 13px;
}

.solution-tool-description strong {
    color: var(--ink);
    font: 800 clamp(18px, 2vw, 25px)/1.35 var(--font-display);
}

.solution-tool-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.home-path {
    display: grid;
    gap: clamp(48px, 6vw, 76px);
}

.home-step-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 16px;
    text-align: left;
}

.home-step-index {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.home-step h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.3;
}

.home-step-head p:last-child {
    max-width: 40em;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.home-path .solution-tool {
    max-width: none;
    margin: 0;
}

.home-sample-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.home-sample {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 210px;
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-top: 3px solid #867660;
    background: var(--paper-strong);
    color: inherit;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.home-sample:hover {
    border-top-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.home-sample-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.home-sample strong {
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1.35;
}

.home-sample p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-sample-open {
    margin-top: auto;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.home-sample-fallback {
    margin: 0;
    color: var(--muted);
}

body[data-page="home"] .section-heading-row .text-link,
.home-step-head .text-link {
    padding-bottom: 4px;
}

body[data-page="home"] .section-heading h2 {
    margin: 0;
    color: inherit;
    font-size: clamp(32px, 4.1vw, 59px);
    line-height: 1.24;
}

body[data-page="home"] :is(.agent-card-grid, .proof-grid, .blog-list, .contact-layout) {
    margin-right: 0;
}

body[data-page="home"] :is(.agent-card, .list-row, .scroll-reveal) {
    opacity: 1;
    transform: none;
}

body[data-page="home"] .agent-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="home"] .agent-card {
    min-height: 325px;
    border: 1px solid var(--line);
    border-top: 3px solid #867660;
    background: var(--paper-strong);
    box-shadow: none;
}

body[data-page="home"] .agent-card:hover {
    transform: translateY(-5px);
    border-top-color: var(--accent);
    box-shadow: var(--shadow-card);
}

body[data-page="home"] .agent-card::after {
    pointer-events: none;
}

body[data-page="home"] .agent-card-logo {
    width: 55px;
    height: 55px;
}

body[data-page="home"] .article-card-index,
body[data-page="home"] .article-card-label {
    display: none;
}

body[data-page="home"] .agent-card-top {
    justify-content: flex-end;
}

body[data-page="home"] :is(.proof-item, .proof-item + .proof-item, .contact-card) {
    background: var(--paper-strong);
    box-shadow: none;
}

body[data-page="home"] .proof-item:hover {
    border-color: var(--accent);
}

body[data-page="home"] .list-row.article-card {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    margin: 0;
    padding: 24px 18px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
}

body[data-page="home"] .list-row.article-card:hover {
    background: var(--paper-strong);
}

body[data-page="home"] .contact-form {
    background: var(--paper-strong);
    box-shadow: none;
}

body[data-page="home"] .contact-card {
    grid-template-columns: minmax(0, 1fr);
}

body[data-page="home"] .site-footer {
    border-color: var(--line);
    background: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
    .dive-copy > * {
        animation: home-enter .8s var(--ease-out-expo) both;
    }

    .dive-copy h1 { animation-delay: .1s; }
    .dive-summary { animation-delay: .17s; }
    .dive-actions { animation-delay: .23s; }
    .dive-scroll { animation-delay: .29s; }

    @keyframes home-enter {
        from { opacity: 0; transform: translateY(14px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (max-width: 900px), (max-height: 630px) {
    .dive-stage {
        display: block;
        min-height: 0;
        padding: calc(var(--header-height) + 37px) var(--gutter) 28px;
    }

    .dive-copy {
        max-width: 625px;
        padding: 0;
    }

    .dive-copy h1,
    .dive-copy .hero-slogan {
        width: auto;
        max-width: none;
        font-size: clamp(36px, 9vw, 64px);
    }

    .dive-scroll {
        margin-top: 22px;
    }

    .legal-field {
        position: relative;
        height: clamp(280px, 48svh, 500px);
        margin-top: 28px;
        clip-path: none;
    }

    .field-labels {
        top: 12px;
        right: 8px;
    }

    body[data-page="home"] .robot-guide-hero {
        right: calc(var(--gutter) + 8px);
        bottom: 38px;
    }

    .home-sample-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body[data-page="home"] {
        --gutter: 18px;
        --header-height: 62px;
    }

    body[data-page="home"] .site-nav {
        gap: 1px;
        background: transparent;
    }

    .dive-summary { margin-top: 16px; }
    .dive-actions { margin-top: 20px; }
    .workbench-section .section-heading { text-align: left; }
    body[data-page="home"] .agent-card-grid { grid-template-columns: 1fr; }
    .home-step-head { align-items: flex-start; flex-direction: column; }
    .home-sample-grid { grid-template-columns: 1fr; }

    .robot-guide-hero .robot-bubble {
        width: 154px;
        padding: 8px 10px;
    }

    .robot-guide-hero .robot-avatar {
        width: 61px;
        height: 61px;
    }

    .robot-guide-hero .robot-avatar img {
        width: 57px;
        height: 57px;
    }

    body[data-page="home"] .list-row.article-card {
        grid-template-columns: 1fr;
        padding-inline: 0;
    }

    body[data-page="home"] .article-card-cta {
        grid-column: 1;
    }
}
