/* The public pages: index.html (the replay), waitlist.html and 404.html. Faces and tokens are in tokens.css.
   Figure 1 (the replay) builds its own DOM inside #replay-root and styles it from replay.css
   under the rp- prefix. Nothing in this file selects into that mount: every rule here is
   scoped to a class these pages own, and the resets only apply inside .site blocks. */

/* ---------- page padding steps (DESIGN.md section 2) */
@media (min-width: 761px) and (max-width: 1439px) { :root { --pad: 32px; } }
@media (max-width: 760px) { :root { --pad: 16px; --gut: 16px; } }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* a column, so the footer sits at the bottom of the window on a short page */
body {
  margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 var(--t4)/1.5 var(--sans); font-stretch: 100%;
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
.page { flex: 1 0 auto; }
/* a short page: the claim takes the room the window has, and what follows it sits on the footer */
.page-fill { display: flex; flex-direction: column; }
.page-fill > .wrap { width: 100%; }
.page-fill > .hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }

/* ---------- reset, inside these pages' own blocks only */
.site, .site *, .site *::before, .site *::after { box-sizing: border-box; }
:where(.site) :where(h1, h2, p, ul) { margin: 0; padding: 0; }
:where(.site) ul { list-style: none; }
:where(.site) svg { display: block; max-width: 100%; }
:where(.site) a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:where(.site) a:hover { text-decoration-thickness: 3px; }
.site :focus-visible, .skip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: 8px; top: 8px; z-index: 10; padding: 10px 14px; background: var(--ink); color: #fff;
  font: 600 var(--t3)/1 var(--sans); text-decoration: none; border-radius: 2px; }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip:focus-visible { outline-color: var(--paper); outline-offset: -5px; }

/* ---------- type roles */
/* words a headline must not break between (DESIGN.md section 3) */
.nw { white-space: nowrap; }
.d { font-family: var(--sans); font-stretch: 75%; font-weight: 800; letter-spacing: 0; word-spacing: var(--ws-75); text-wrap: balance; }

/* ---------- wordmark */
.wm { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 800 var(--t6)/1 var(--sans); font-stretch: 88%;
  letter-spacing: -.022em; text-decoration: none; color: inherit; }
.wm svg { width: 28px; height: 28px; flex: none; }

/* ---------- controls: things you can press have a 2px radius, data is square */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; margin: 0;
  border: 1.5px solid var(--ink); border-radius: 2px; background: var(--ink); color: #fff;
  font: 600 var(--t3)/1 var(--sans); font-stretch: 100%; text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-appearance: none; appearance: none; }
.btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn:active { background: #000; border-color: #000; }
.btn-sm { height: 36px; padding: 0 14px; }
.btn[disabled] { background: var(--ground); border-color: var(--hair); color: var(--ink-3); cursor: not-allowed; }
/* secondary (DESIGN.md section 5): paper fill, ink text, ink border */
.btn-2 { background: var(--paper); color: var(--ink); }
.btn-2:hover { background: var(--ground); border-color: var(--ink); }
.btn-2:active { background: var(--ground-2); border-color: var(--ink); }
/* the "Book a call" links ship hidden until assets/booking.js gives them their link; .btn would otherwise show them */
.btn[hidden] { display: none; }
.field { height: 44px; margin: 0; border: 1.5px solid var(--ink); border-radius: 2px; background: #fff; color: var(--ink); padding: 0 12px;
  font: 400 var(--t4)/1 var(--sans); font-stretch: 100%; min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }
.field::placeholder { color: var(--ink-3); opacity: 1; }
.field[aria-invalid="true"] { border-color: var(--err); border-width: 2px; padding: 0 11.5px; }
.field[disabled] { background: var(--ground); border-color: var(--hair); color: var(--ink-3); -webkit-text-fill-color: var(--ink-3); opacity: 1; }

/* ---------- masthead: the wordmark and one way on */
.mast { border-bottom: 1px solid var(--ink); background: var(--paper); }
.mast-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.mast-link { display: inline-flex; align-items: center; min-height: 44px; font: 500 var(--t3)/1 var(--sans); text-decoration: none; white-space: nowrap;
  border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.mast-link:hover { border-bottom-color: var(--ink); }
.mast-r { display: flex; align-items: center; gap: 8px; }

/* ---------- the top of a page: the claim, and on the waitlist page the form beside it */
.hero { padding-top: 22px; padding-bottom: 16px; }
.hero h1 { font-size: var(--t10); line-height: .98; }
.hero-w { padding-top: 56px; padding-bottom: 64px; }
.hero-g { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gut); align-items: start; }
.hero-l { grid-column: 1 / 10; }
.hero-r { grid-column: 10 / 13; padding-top: 4px; }
.deck { font-size: var(--t5); line-height: 1.42; max-width: 44em; margin-top: 18px; text-wrap: pretty; }

/* ---------- the home page's claim: the headline, then what Cambrian does and the way into the pilot.
   Two classes on the h1's rule so it holds its size against the .hero rules at every width. */
.hero.hero-home h1 { font-size: var(--t8); line-height: 1; }
.hero-home h1 span { display: block; }
.hero-way { margin-top: 14px; }
.hero-way .deck { font-size: var(--t4); margin: 0 0 14px; max-width: 34em; }
@media (min-width: 987px) {
  .hero-home { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gut); align-items: center; }
  .hero-home h1 { grid-column: 1 / 7; }
  .hero-way { grid-column: 7 / 13; margin: 0; display: flex; align-items: center; gap: 20px; }
  .hero-way .deck { margin: 0; font-size: var(--t3); line-height: 1.4; }
  .hero-way .btn { flex: none; }
}

/* ---------- forms: the code form on the mockup page and the pilot application */
.lab { font: 700 var(--t3)/1.25 var(--sans); font-stretch: 88%; word-spacing: var(--ws-88); display: block; margin-bottom: 6px; }
.lab-opt { font-weight: 400; font-stretch: 100%; word-spacing: 0; color: var(--ink-2); }
.join-row { display: flex; flex-direction: column; gap: 8px; }
.form-note { font: 400 var(--t2)/1.35 var(--sans); color: var(--ink-2); margin-top: 6px; min-height: 18px; }
.form-note.is-err { color: var(--err); font-weight: 600; }
.form-note.is-ok { color: var(--ink); font-weight: 700; }
/* after a successful send the script moves focus to this line, which is text and not a control: no ring */
.site .form-note:focus { outline: none; }
/* a select is the same field with a drawn triangle (DESIGN.md section 5) */
select.field { padding-right: 34px; text-overflow: ellipsis; background-repeat: no-repeat; background-size: 6px 6px, 6px 6px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; }

/* ---------- the pilot page (waitlist.html): the offer on the left, the application beside it.
   Source order is offer, form, detail, so on a phone the form comes straight after the headline. */
.pilot { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 var(--gut); align-items: start; padding-top: 44px; padding-bottom: 72px; }
.pilot-intro, .pilot-more { grid-column: 1 / 8; }
.pilot-more { margin-top: 36px; }
.pilot h1 { font-size: var(--t10); line-height: .98; }

.pilot-form { grid-column: 9 / 13; grid-row: 1 / span 2; position: sticky; top: 24px; border-top: 3px solid var(--ink); padding-top: 14px; scroll-margin-top: 12px; }
.pilot-form h2 { font-size: var(--t7); line-height: 1; margin-bottom: 18px; }
.fld { margin-bottom: 12px; }
.pilot-form .btn { width: 100%; margin-top: 6px; }
/* off the page, not display: none, which some form-filling bots check for */
.hp { position: absolute; left: -9999px; }
.applied h2 { font-size: var(--t8); margin-bottom: 0; }
.applied p { margin: 12px 0 20px; }
/* the script moves focus here after a send; it is text, not a control: no ring */
.site .applied:focus { outline: none; }

.steps { margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--ink); }
.steps li { display: grid; grid-template-columns: 40px 148px 1fr; gap: 0 var(--s4); align-items: baseline; padding: 13px 0 14px; border-bottom: 1px solid var(--ink); }
.steps-n { font: 800 var(--t6)/1 var(--sans); font-stretch: 62%; color: var(--ink-3); }
.steps h2 { font-size: var(--t6); line-height: 1; }
.steps p { line-height: 1.4; }
.pair { margin: 28px 0 0; }
.pair-g { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gut); align-items: end; }
/* the top of each page: the part that differs. The crop keeps the pair compact. */
.pair img { display: block; width: 100%; height: auto; aspect-ratio: 10 / 12; object-fit: cover; object-position: top; border: 1.5px solid var(--ink); }
.pair figcaption, .why { font: 400 var(--t2)/1.4 var(--sans); color: var(--ink-2); margin-top: 8px; }
.why { font-size: var(--t3); margin-top: 24px; max-width: 44em; }
.why b { font-weight: 700; color: var(--ink); }

/* ---------- Figure 1: the frame the home page gives the replay. The mount itself belongs to replay.css. */
.fig { box-sizing: border-box; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 72px; scroll-margin-top: 12px; }
.fig::before { content: ""; display: block; height: 3px; background: var(--ink); }
/* The one thing this page puts inside the mount: the paragraph shown until replay.js runs, and for good if it cannot.
   The id is in the selector only so the mount's own reset in replay.css does not flatten it. */
#replay-root > .replay-fallback { margin: 14px 0 4px; padding: 18px 20px; background: var(--ground); font: 400 var(--t4)/1.5 var(--sans); color: var(--ink); }
#replay-root > .replay-fallback b { font-weight: 700; }

/* ---------- the home page in a desktop window: one screen, no page scroll. The masthead, the claim and the
   footer take what they need; the demo gets the rest as a definite height and lays itself out inside it
   (replay.css, when the mount carries data-fit). Narrower or shorter windows scroll as an ordinary page. */
@media (min-width: 987px) and (min-height: 620px) {
  body.fit { height: 100vh; height: 100dvh; }
  .fit .mast-in { height: 56px; }
  .fit .page { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  /* width: a flex item with auto side margins would otherwise shrink to its text and sit centred */
  .fit .hero { width: 100%; padding-top: 12px; padding-bottom: 8px; }
  .fit .hero h1 { font-size: var(--t8); }
  .fit .fig { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding-bottom: 12px; }
  .fit #replay-root { flex: 1 1 0; min-height: 0; }
  .fit .foot { align-items: center; padding-top: 6px; padding-bottom: 6px; }
}

/* ---------- footer: what this is, and one link */
.foot-band { background: var(--ground); border-top: 3px solid var(--ink); }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px var(--gut); padding-top: 16px; padding-bottom: 22px;
  font: 400 var(--t2)/1.45 var(--sans); color: var(--ink-2); }
.foot-d { max-width: 90ch; }
.foot-link { flex: none; display: inline-flex; align-items: center; min-height: 32px; color: var(--ink); font-size: var(--t3); }

/* ---------- the 404 page */
.nf { padding-top: 56px; padding-bottom: 72px; align-items: flex-start; }
.nf .deck { margin-bottom: 26px; }

/* ---------- responsive */
@media (max-width: 1180px) {
  .hero h1 { font-size: var(--t9); }
  .hero-l { grid-column: 1 / 9; }
  .hero-r { grid-column: 9 / 13; }
  .pilot h1 { font-size: var(--t9); line-height: 1; }
  .pilot-form { grid-column: 8 / 13; }
}
@media (max-width: 900px) {
  .pilot { display: block; padding-top: 32px; }
  .pilot-form { position: static; margin-top: 28px; max-width: 560px; }
  .hero-g { display: block; }
  .hero-r { margin-top: 26px; padding-top: 0; max-width: 560px; }
  .join-row { flex-direction: row; }
  .join-row .field { flex: 1; }
  .foot { display: block; }
  .foot-link { min-height: 44px; margin-top: 4px; }
  .mast .btn-sm { height: 44px; }
}
@media (max-width: 760px) {
  .hero { padding-top: 24px; padding-bottom: 20px; }
  .hero h1 { font-size: var(--t8); line-height: 1; }
  .hero-w { padding-top: 32px; padding-bottom: 40px; }
  .deck { font-size: var(--t4); }
  .join-row { flex-direction: column; }
  .join-row .field { flex: none; }
  .join-row .btn { width: 100%; }
  .hero-way .btn { width: 100%; }
  .pilot { padding-top: 24px; padding-bottom: 52px; }
  .pilot h1 { font-size: var(--t8); }
  .pilot-form { margin-top: 24px; }
  /* thumb-sized controls on the form a phone visitor fills in */
  .pilot-form .field, .pilot-form .btn { height: 48px; }
  .steps li { grid-template-columns: 34px 1fr; }
  .steps p { grid-column: 2; margin-top: 4px; }
  .pair-g { gap: 12px; }
  .fig { padding-bottom: 52px; }
  .nf { padding-top: 32px; padding-bottom: 52px; }
}
@media (max-width: 480px) {
  /* the wordmark and two buttons do not fit one row on a phone: the buttons take a second row, side by side */
  .mast-2 { flex-wrap: wrap; height: auto; row-gap: 8px; padding-top: 10px; padding-bottom: 12px; }
  .mast-2 .mast-r { width: 100%; }
  .mast-2 .mast-r .btn { flex: 1 1 0; }
}
@media (max-width: 350px) {
  /* keeps the wordmark and the button on one row down to 320px */
  .mast .btn-sm { font-stretch: 88%; padding: 0 12px; }
}

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