/* HumanBuilt AI
   Machine geometry, human marks. */

:root {
    --ink: #130A2A;
    --ink-2: #1D1140;
    --ink-3: #2A1A5E;
    --cream: #FFF3E4;
    --paper: #FFFAF3;
    --orange: #FF6A2B;
    --pink: #FF4F9A;
    --pink-hot: #FF1F8E;
    --violet: #5B21E6;
    --violet-soft: #A78BFA;
    --yellow: #FFC72C;
    --blaze: linear-gradient(100deg, #FF9A3D 0%, #FF5A1F 26%, #FF1F8E 62%, #9B6BFF 100%);

    --display: "Mona Sans", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    --body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --gutter: clamp(20px, 4.6vw, 76px);
    --radius: clamp(28px, 4.2vw, 64px);
    --ease: cubic-bezier(.2, .7, .2, 1);
    /* The left edge every section shares, including on very wide screens. */
    --inset: max(var(--gutter), calc((100% - 1400px) / 2));
}

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

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

body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@supports (overflow-x: clip) {
    body { overflow-x: clip; }
}

svg { display: block; }
a { color: inherit; }
p, h1, h2, ul, fieldset { margin: 0; }

::selection { background: var(--yellow); color: var(--ink); }

:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 4px;
    border-radius: 6px;
}
/* Yellow disappears on the light surfaces, so those get a dark ring. */
.card :focus-visible,
.skip:focus-visible { outline-color: var(--violet); }

.wrap {
    width: min(100% - 2 * var(--gutter), 1400px);
    margin-inline: auto;
}

.skip {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 100;
    padding: 12px 18px;
    background: var(--yellow);
    color: var(--ink);
    font-weight: 600;
    border-radius: 10px;
}
.skip:focus { top: 16px; }

/* Film grain keeps the flat colors from feeling digital. */
.grain { position: relative; isolation: isolate; }
.grain::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .28;
    mix-blend-mode: overlay;
}
.grain > * { position: relative; z-index: 2; }

/* ---------- Hand-drawn marks ----------
   Each mark keeps its own proportions, so strokes stay even at any size. */

.marked { position: relative; display: inline-block; white-space: nowrap; }

.scribble {
    position: absolute;
    height: auto;
    overflow: visible;
    pointer-events: none;
}
.scribble path {
    fill: none;
    stroke: var(--yellow);
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
.scribble--hero { left: -3%; width: 106%; bottom: -.15em; }
.scribble--under { left: -3%; width: 106%; bottom: -.39em; }
.scribble--under path { stroke: var(--cream); stroke-width: 7; }
.scribble--circle { left: -9%; width: 116%; top: calc(50% + .03em); transform: translateY(-53%); }
.scribble--circle path { stroke: var(--pink-hot); stroke-width: 5.2; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    padding: 1.05em 1.9em;
    border: 0;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s;
}

.btn--sm { padding: .8em 1.4em; font-size: 1rem; white-space: nowrap; }

/* Solid, pressable buttons: a hard edge instead of a glow. */
.btn--blaze {
    background: var(--blaze);
    color: var(--ink);
    box-shadow: 0 6px 0 #A80F5C;
}
.btn--blaze:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #A80F5C; }
.btn--blaze:active { transform: translateY(4px); box-shadow: 0 2px 0 #A80F5C; }

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

.btn--ghost {
    color: var(--cream);
    box-shadow: inset 0 0 0 2px rgba(255, 243, 228, .5);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 2px var(--cream); }

.btn--ink {
    background: var(--ink);
    color: var(--cream);
    box-shadow: 0 6px 0 var(--violet);
}
.btn--ink:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--violet); }
.btn--ink:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--violet); }

/* Windows high-contrast mode drops backgrounds and shadows, so give buttons a frame. */
@media (forced-colors: active) {
    .btn { border: 2px solid currentColor; }
}

/* The way to reach us, always one tap away. script.js shows it once the
   header button has scrolled off, and tucks it away again at the form. */
.float-cta {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 60;
    padding: .95em 1.6em;
    background: var(--yellow);
    color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: 0 6px 0 var(--ink);
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s linear .3s, box-shadow .2s var(--ease);
}
.float-cta.is-on {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s, box-shadow .2s var(--ease);
}
.float-cta.is-on:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.float-cta.is-on:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.float-cta:focus-visible { outline-color: var(--cream); box-shadow: 0 0 0 3px var(--ink), 0 6px 0 var(--ink); }
@media (max-width: 599px) {
    .float-cta { padding: .85em 1.35em; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .float-cta, .float-cta.is-on { transition: none; transform: none; }
}

/* ---------- Hero ---------- */

.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* The first panel slides up over the bottom of the hero, so leave it room,
       plus room for the tape. */
    padding-bottom: calc(var(--radius) + 10vw);
    background:
        radial-gradient(58vw 46vw at 96% 108%, rgba(255, 31, 142, .55), transparent 62%),
        radial-gradient(46vw 36vw at 4% 112%, rgba(255, 106, 43, .42), transparent 64%),
        radial-gradient(44vw 40vw at 102% -6%, rgba(91, 33, 230, .7), transparent 66%),
        var(--ink);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: clamp(18px, 2.4vw, 30px) var(--inset) 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    font-family: var(--display);
    font-size: clamp(1.2rem, 1.6vw, 1.5rem);
    font-weight: 800;
    letter-spacing: -.025em;
    text-decoration: none;
}
.brand-mark { flex: none; width: 1.35em; height: 1.35em; }

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1.2rem, 2.6vw, 2.6rem);
    font-family: var(--display);
    font-weight: 600;
    font-size: 1.0625rem;
}
.nav-links a:not(.btn) {
    text-decoration: none;
    background: linear-gradient(var(--yellow), var(--yellow)) 0 100% / 0 3px no-repeat;
    padding-bottom: 4px;
    transition: background-size .3s var(--ease);
}
.nav-links a:not(.btn):hover { background-size: 100% 3px; }

.hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 6vh, 90px) var(--inset) clamp(24px, 3vh, 48px);
}

.hero-title {
    font-family: var(--display);
    font-size: clamp(3.3rem, 11.6vw, 12.6rem);
    font-weight: 900;
    font-stretch: 76%;
    line-height: .9;
    letter-spacing: -.022em;
}
.hero-title .line { display: block; width: fit-content; max-width: 100%; }
.nb { white-space: nowrap; }
/* A phrase that should stay together when there is room, but may still wrap
   inside itself when there isn't (large text on a small screen). */
.keep { display: inline-block; }

/* The gradient is split across the two words so the underlined one can
   carry its own mark. The colors meet in the middle. */
.blaze {
    padding: .1em 0;
    margin: -.1em 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.blaze--a { background-image: linear-gradient(100deg, #FF9A3D 0%, #FF5A1F 55%, #FF3A66 100%); }
.blaze--b { background-image: linear-gradient(100deg, #FF3A66 0%, #FF1F8E 34%, #9B6BFF 100%); }

.hero-sub {
    max-width: 29em;
    /* Clear the underline under "build.", which grows with the headline. */
    margin-top: max(clamp(26px, 3.6vh, 48px), min(3.9vw, 68px));
    font-size: clamp(1.2rem, 1.62vw, 1.56rem);
    font-weight: 500;
    line-height: 1.4;
    text-wrap: pretty;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    margin-top: clamp(26px, 4vh, 48px);
}

/* The mosaic: blocks stack themselves into a skyline. */
.mosaic {
    /* Capped by height too, so the tallest stack never reaches the nav on a short window. */
    --t: min(8.9vw, 150px, 15.5vh);
    display: grid;
    grid-template-columns: repeat(5, var(--t));
    grid-template-rows: repeat(4, var(--t));
}
.hero > .mosaic {
    position: absolute;
    right: 0;
    bottom: calc(var(--radius) + 5.4vw);
    z-index: 1;
}

.tile {
    grid-column: var(--c);
    grid-row: var(--r);
    overflow: hidden;
    background: var(--bg);
}
.tile svg { width: 100%; height: 100%; }

/* ---------- Tape ---------- */

.hero > .tape {
    position: absolute;
    left: -3vw;
    right: -3vw;
    bottom: calc(var(--radius) + 2.2vw);
    z-index: 3;
}
.tape {
    padding: .4em 0 .38em;
    overflow: hidden;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--display);
    font-size: clamp(1.5rem, 3.9vw, 3.8rem);
    font-weight: 900;
    font-stretch: 75%;
    letter-spacing: -.02em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(-2deg);
    box-shadow: 0 18px 50px -18px rgba(19, 10, 42, .7);
}
/* script.js moves the tape with the scroll, so it only travels when you do. */
.tape-track {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    padding-left: calc(3vw + max(var(--gutter), (100vw - 1400px) / 2));
    transform: translate3d(calc(var(--shift, 0) * -1px), 0, 0);
    will-change: transform;
}
.shape { flex: none; width: .5em; height: .5em; }
.shape--circle { background: var(--pink-hot); border-radius: 50%; }
.shape--square { background: var(--violet); transform: rotate(45deg) scale(.86); }
.shape--half { background: var(--orange); border-radius: .5em .5em 0 0; height: .25em; width: .5em; }

/* ---------- Stacked panels ---------- */

.stack {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--radius));
}
.stack:focus { outline: none; }

.anchor { display: block; height: 0; }

.panel {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(64px, 8.5vw, 132px) 0 clamp(72px, 9vw, 140px);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -30px 70px -30px rgba(19, 10, 42, .55);
}

.panel--build {
    color: var(--ink);
    background: radial-gradient(90% 70% at 85% 20%, #FF8A45 0%, transparent 60%), var(--orange);
}
.panel--automate {
    color: var(--cream);
    background: radial-gradient(80% 70% at 90% 10%, #7A3BFF 0%, transparent 62%), var(--violet);
}
.panel--train {
    color: var(--ink);
    background: radial-gradient(90% 70% at 15% 20%, #FF78B2 0%, transparent 60%), var(--pink);
}
.panel--humans {
    color: var(--cream);
    background:
        radial-gradient(50vw 40vw at 0% 100%, rgba(255, 31, 142, .32), transparent 64%),
        radial-gradient(46vw 40vw at 100% 0%, rgba(91, 33, 230, .6), transparent 66%),
        var(--ink);
}
.panel--contact {
    color: var(--ink);
    background: linear-gradient(118deg, #FF9A3D 0%, #FF5A1F 24%, #FF1F8E 58%, #7B3BFF 100%);
}

.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(28px, 4vw, 56px);
}

.verb {
    font-family: var(--display);
    font-size: min(14.2vw, 14.5rem);
    font-weight: 900;
    font-stretch: 75%;
    line-height: .8;
    letter-spacing: -.02em;
    margin-left: -.04em;
}
/* The longest of the three words: sized so it stays inside its column. */
.panel--automate .verb { font-size: min(12.6vw, 13rem); }

.tagline {
    max-width: 14em;
    margin-bottom: .75em;
    font-family: var(--display);
    font-size: clamp(1.9rem, 3.5vw, 3.3rem);
    font-weight: 700;
    font-stretch: 90%;
    line-height: 1.02;
    letter-spacing: -.028em;
    text-wrap: balance;
}

.panel-copy p:not(.tagline) {
    max-width: 33em;
    font-size: clamp(1.1rem, 1.36vw, 1.32rem);
    font-weight: 500;
    line-height: 1.48;
    text-wrap: pretty;
}
.panel-copy p + p:not(.tagline) { margin-top: 1em; }

.ledger {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(16px, 2.4vw, 36px);
    font-family: var(--display);
    font-size: clamp(1.02rem, 1.42vw, 1.32rem);
    font-weight: 700;
    letter-spacing: -.012em;
    line-height: 1.2;
}
.ledger li {
    padding: .72em 0;
    border-top: 2px solid currentColor;
}

.art { width: 100%; height: auto; max-width: 640px; margin-inline: auto; overflow: visible; }

/* Everything we automate, in columns you can scan. */
.wall {
    list-style: none;
    padding: 0;
    columns: 1;
    column-gap: clamp(20px, 2.8vw, 44px);
    font-family: var(--display);
    font-size: clamp(1.06rem, 1.42vw, 1.32rem);
    font-weight: 700;
    font-stretch: 98%;
    letter-spacing: -.012em;
    line-height: 1.2;
}
.wall li {
    position: relative;
    break-inside: avoid;
    padding: .7em 0 .7em 1.4em;
    border-top: 2px solid rgba(255, 243, 228, .4);
    text-wrap: balance;
}
.wall li::before {
    content: "";
    position: absolute;
    left: .05em;
    top: 1.06em;
    width: .5em;
    height: .5em;
    background: var(--yellow);
    border-radius: 50%;
}
.wall li:nth-child(3n + 2)::before { background: var(--pink); border-radius: 0; transform: rotate(45deg) scale(.86); }
.wall li:nth-child(3n)::before { top: 1.18em; height: .27em; background: var(--orange); border-radius: .5em .5em 0 0; }
.wall li.wall-end {
    column-span: all;
    padding: .7em 0 0;
    color: var(--yellow);
    font-size: clamp(1.5rem, 2.9vw, 2.8rem);
    font-stretch: 90%;
    letter-spacing: -.025em;
    line-height: 1.08;
}
.wall li.wall-end::before { display: none; }
@media (min-width: 600px) { .wall { columns: 2; } }
@media (min-width: 1180px) { .wall { columns: 3; } }

/* ---------- Humans ---------- */

.statement {
    font-family: var(--display);
    font-size: min(8.4vw, 8.9rem);
    font-weight: 900;
    font-stretch: 76%;
    line-height: .94;
    letter-spacing: -.022em;
}
.statement .line { display: block; }
.statement .line + .line { margin-top: .08em; }

.humans-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(36px, 5vw, 80px);
    margin-top: clamp(48px, 7vw, 110px);
}

.stat { display: flex; flex-direction: column; }
.stat-num {
    width: fit-content;
    font-family: var(--display);
    font-size: min(17vw, 16rem);
    font-weight: 900;
    font-stretch: 75%;
    line-height: .8;
    letter-spacing: -.02em;
    background: var(--blaze);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* Room under the baseline, so the gradient reaches the round bottoms
       of the digits. The margin gives the space back. */
    padding: 0 .04em .05em 0;
    margin-bottom: -.05em;
}
.stat-label {
    max-width: 17em;
    margin-top: .9em;
    font-family: var(--display);
    font-size: clamp(1.25rem, 1.9vw, 1.8rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.humans-copy p {
    max-width: 30em;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    line-height: 1.45;
    text-wrap: pretty;
}
.humans-copy p + p { margin-top: 1.1em; }

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

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 5vw, 80px);
    align-items: start;
}

/* Sized to stay on one line beside the form at every desktop width. */
.verb--contact { font-size: min(10.6vw, 10rem); }

.contact-lead {
    max-width: 22em;
    margin-top: clamp(22px, 2.6vw, 40px);
    font-family: var(--display);
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.02em;
    text-wrap: pretty;
}

.pitch-arrow { width: clamp(130px, 14vw, 210px); margin: clamp(14px, 2vw, 30px) 4% 0 auto; }
.pitch-arrow svg { width: 100%; height: auto; overflow: visible; }

.panel--contact > .mosaic--contact {
    --t: min(7.4vw, 124px);
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
    display: none;
    grid-template-columns: repeat(4, var(--t));
    grid-template-rows: repeat(3, var(--t));
}

.card {
    padding: clamp(24px, 3.2vw, 48px);
    background: var(--paper);
    color: var(--ink);
    border-radius: clamp(24px, 2.6vw, 40px);
    box-shadow: 0 50px 90px -30px rgba(19, 10, 42, .65);
}

.lead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 18px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.field label, .chips legend {
    font-family: var(--display);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.opt {
    margin-left: .3em;
    font-family: var(--body);
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(19, 10, 42, .7);
}

.field input, .field textarea {
    width: 100%;
    min-width: 0;
    padding: 15px 16px;
    background: #fff;
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 14px;
    font-family: var(--body);
    font-size: 1.0625rem;
    line-height: 1.4;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 7.5em; }
.field ::placeholder { color: rgba(19, 10, 42, .64); opacity: 1; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 5px rgba(91, 33, 230, .22);
}
.lead.tried .field input:invalid, .lead.tried .field textarea:invalid {
    border-color: #D0103A;
    box-shadow: 0 0 0 5px rgba(208, 16, 58, .16);
}

.chips { border: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips legend { padding: 0; margin-bottom: 10px; }
.chip { position: relative; cursor: pointer; max-width: 100%; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.chip span {
    display: block;
    padding: .72em 1.15em;
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    transition: background-color .18s, color .18s, transform .18s var(--ease);
}
.chip:hover span { transform: translateY(-2px); }
.chip input:checked + span { background: var(--ink); color: var(--cream); }
/* A tick as well as a color change, so the choice survives high-contrast modes. */
.chip input:checked + span::before {
    content: "";
    display: inline-block;
    width: .4em;
    height: .72em;
    margin: -.2em .6em 0 .1em;
    border: solid currentColor;
    border-width: 0 .17em .17em 0;
    transform: rotate(42deg);
    vertical-align: middle;
}
.chip input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }

.btn--send { width: 100%; padding-block: 1.2em; margin-bottom: 6px; font-size: 1.25rem; }
.btn--send svg { flex: none; width: 1.2em; height: 1.2em; transition: transform .25s var(--ease); }
.btn--send:hover svg { transform: translateX(5px); }
.btn--send[disabled] { opacity: .65; cursor: progress; transform: none; }

.form-error {
    padding: 14px 16px;
    background: #FFE3E8;
    border: 2px solid #D0103A;
    border-radius: 14px;
    font-weight: 500;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.sent { display: none; text-align: center; padding: clamp(24px, 4vw, 56px) 0; }
.sent:focus { outline: none; }
.sent-art { width: 108px; height: 108px; margin: 0 auto 26px; }
.sent-title {
    font-family: var(--display);
    font-size: clamp(2.2rem, 3.6vw, 3.4rem);
    font-weight: 900;
    font-stretch: 84%;
    letter-spacing: -.025em;
    line-height: 1;
    margin-bottom: .4em;
}
.sent p:last-child { font-size: 1.2rem; }

.card.is-sent .lead, .card:has(.sent:target) .lead { display: none; }
.card.is-sent .sent, .sent:target { display: block; }

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

.footer {
    position: relative;
    z-index: 3;
    background: var(--ink);
    padding: clamp(40px, 6vw, 90px) 0 clamp(28px, 3vw, 44px);
    overflow: hidden;
}
/* Sized from the space it has, so the name always runs edge to edge
   and never clips. */
.wordmark {
    width: fit-content;
    font-family: var(--display);
    font-size: min(calc((100vw - 2 * var(--gutter)) / 5.02), 279px);
    font-weight: 900;
    font-stretch: 75%;
    line-height: .8;
    letter-spacing: -.02em;
    white-space: nowrap;
    background: var(--blaze);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    padding: .06em .02em .06em 0;
    margin-left: -.03em;
}
.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px 32px;
    margin-top: clamp(22px, 3.4vw, 50px);
    color: rgba(255, 243, 228, .82);
}
.footer-row p { text-wrap: balance; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-weight: 600; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }

/* ---------- Wider screens ---------- */

@media (min-width: 900px) {
    .panel-grid {
        grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
        column-gap: clamp(32px, 5vw, 96px);
    }
    .verb { position: relative; z-index: 3; grid-column: 1; grid-row: 1; }
    .panel-copy { grid-column: 1; grid-row: 2; }
    .ledger { grid-column: 1; grid-row: 3; }
    .panel-art { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
    .panel--automate .panel-art { grid-row: 1 / span 2; }
    .wall { grid-column: 1 / -1; grid-row: 3; margin-top: clamp(8px, 1.4vw, 24px); }
    .statement .marked { margin-right: .07em; }

    /* Train flips the layout: picture first, words second. */
    .panel--train .panel-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); }
    .panel--train .verb,
    .panel--train .panel-copy,
    .panel--train .ledger { grid-column: 2; }
    .panel--train .panel-art { grid-column: 1; }

    .humans-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
    .contact-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
    .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panel--contact > .mosaic--contact { display: grid; }
}

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

@media (max-width: 899px) {
    .hero { padding-bottom: calc(var(--radius) + 5vw); }
    .hero-title { font-size: min(19.5vw, 9rem); }
    .hero-sub { margin-top: max(clamp(26px, 3.6vh, 48px), min(6vw, 50px)); }
    .hero > .mosaic {
        --t: min(20vw, 112px);
        position: relative;
        right: auto;
        bottom: auto;
        align-self: flex-end;
        grid-template-rows: repeat(3, var(--t));
    }
    .tile { grid-row: calc(var(--r) - 1); }
    .tile--top, .tile--edge { display: none; }
    .hero > .tape { bottom: calc(var(--radius) + 1vw); }

    .verb { font-size: min(23vw, 12rem); }
    .panel--automate .verb { font-size: min(21.4vw, 12rem); }
    .verb--contact { font-size: min(19vw, 10rem); }
    /* The picture punctuates the explanation; it shouldn't push the list a screen away. */
    .art { max-width: min(82%, 400px); margin-inline: auto 0; }
    .panel--train .art { margin-inline: 0 auto; }

    .statement { font-size: min(15vw, 6.5rem); line-height: .92; }
    .statement .seg { display: block; }
    .statement .line + .line { margin-top: 0; }
    .statement .marked { margin: .13em 0 .05em; }
    .stat-num { font-size: min(34vw, 11rem); }

    .panel--contact { background: linear-gradient(168deg, #FF9A3D 0%, #FF5A1F 22%, #FF1F8E 62%, #7B3BFF 100%); }
    /* Turned to point down at the form, in a box sized for the turned arrow
       so it never touches the words above or the card below. */
    .contact-grid { gap: 14px; }
    .pitch-arrow { display: grid; place-items: center; width: 84px; height: 86px; margin: 10px 0 0 40%; }
    .pitch-arrow svg { width: 76px; transform: rotate(66deg); }
}

@media (min-width: 600px) and (max-width: 899px) {
    /* Tablets have the room: a bigger picture, centered. */
    .art, .panel--train .art { max-width: 480px; margin-inline: auto; }
}

@media (max-width: 639px) {
    .nav-links a:not(.btn) { display: none; }
}

@media (max-width: 599px) {
    .art { max-width: min(78%, 300px); }
    .ledger { grid-template-columns: minmax(0, 1fr); }
    .wall li { padding-block: .56em; }
    .wall li::before { top: .92em; }
    .wall li:nth-child(3n)::before { top: 1.04em; }
    .hero-cta .btn { font-size: 1rem; }
    .hero-cta .btn--blaze { padding: 1em 1.4em; }
    .hero-more {
        padding: .4em 0;
        border-radius: 4px;
        box-shadow: none;
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 5px;
    }
    .hero-more:hover { box-shadow: none; }
}

@media (max-width: 380px) {
    .nav { gap: 8px; }
    .brand { font-size: 1.05rem; }
    .btn--sm { padding: .7em 1.05em; font-size: .92rem; }
}

/* ---------- Motion ----------
   Everything plays once, as an entrance, then rests. Nothing loops. */

@keyframes drop {
    0% { transform: translateY(-115vh); }
    62% { transform: translateY(0); }
    78% { transform: translateY(-4%); }
    100% { transform: translateY(0); }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(.35em); }
    to { opacity: 1; transform: none; }
}
@keyframes tape-in {
    from { opacity: 0; transform: rotate(-2deg) translateX(7%); }
    to { opacity: 1; transform: rotate(-2deg); }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes stack {
    from { opacity: 0; transform: translateY(-90px); }
    to { opacity: 1; transform: none; }
}
@keyframes roll-out {
    from { opacity: 0; transform: translateX(-80px); }
    to { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(720deg); } }
@keyframes wave { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.8); } }

@media (prefers-reduced-motion: no-preference) {
    /* Each panel sticks, and the next one slides over it. A panel taller than
       the screen sticks only once its last line is in view. script.js sets --h. */
    .js .panel {
        position: sticky;
        top: min(0px, calc(100vh - var(--h, 100vh)));
        top: min(0px, calc(100svh - var(--h, 100svh)));
    }

    .hero-title .line { animation: rise .9s var(--ease) both; }
    .hero-title .line + .line { animation-delay: .12s; }
    .hero-sub { animation: rise .9s var(--ease) .26s both; }
    .hero-cta { animation: rise .9s var(--ease) .38s both; }
    .scribble--hero path { animation: draw .7s var(--ease) 1s both; }
    .scribble--hero path + path { animation-delay: 1.5s; animation-duration: .5s; }

    .hero .tile { animation: drop .95s cubic-bezier(.3, .9, .4, 1) both; animation-delay: calc(.3s + var(--i) * 85ms); }
    .hero > .tape { animation: tape-in 1s var(--ease) 1.2s both; }

    /* Scroll reveals, only once script.js has set the .js class. */
    .js [data-reveal] {
        opacity: 0;
        transform: translateY(34px);
        transition: opacity .8s var(--ease), transform .8s var(--ease);
    }
    .js [data-reveal].in { opacity: 1; transform: none; }
    .js .verb[data-reveal] { transform: translateY(.18em); }
    .js .verb[data-reveal].in { transform: none; }

    /* Hand-drawn marks draw themselves in. */
    .js [data-reveal] .scribble path { stroke-dashoffset: 1; }
    .js [data-reveal].in .scribble path { animation: draw .9s var(--ease) .5s both; }
    .js [data-reveal].in .scribble path + path { animation-delay: 1.1s; animation-duration: .5s; }

    .scribble-line, .ink { stroke-dasharray: 1; }
    .js .scribble-line, .js .ink { stroke-dashoffset: 1; }
    .js .in .scribble-line { animation: draw .7s var(--ease) .3s both; }
    .js .in .scribble-line--late { animation-delay: .9s; animation-duration: .4s; }
    .js .in .scribble-line--last { animation-delay: 2.5s; animation-duration: .6s; }
    .js .in .ink { animation: draw .45s ease-out both; animation-delay: calc(.9s + var(--p) * .2s); }

    /* Pieces drop into place. */
    .js .piece, .js .out, .js .mosaic--contact .tile { opacity: 0; }
    .js .in .piece { animation: stack .7s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(.15s + var(--p) * .11s); }
    .js .in .art--build .piece { animation-delay: calc(1.1s + var(--p) * .16s); }
    .js .mosaic--contact.in .tile { animation: stack .7s cubic-bezier(.3, 1.3, .5, 1) both; animation-delay: calc(.2s + var(--i) * 90ms); }

    /* Build: the flag settles. Automate: the drum turns, the work rolls out. */
    .flag { transform-box: fill-box; transform-origin: left center; }
    .js .in .flag { animation: wave .8s ease-in-out 2.2s 3; }
    .drum { transform-origin: 85px 255px; }
    .js .in .drum { animation: spin 2.6s cubic-bezier(.3, 0, .2, 1) .5s both; }
    .js .in .out { animation: roll-out .8s var(--ease) both; animation-delay: calc(1.3s + var(--p) * .24s); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn, .chip span { transition: none; }
}
