:root {
  color-scheme: light;
  --paper: #fafaf8;
  --ink: #24262a;
  --muted: #70716d;
  --blue: #0044ca;
  --red: #ea1f27;
  --purple: #642d93;
  --error: #c3161d;
  --line: rgba(36, 38, 42, .16);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { min-width: 280px; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 7px; border-radius: 2px; }
[hidden] { display: none !important; }

main { display: grid; place-items: center; padding: 20px 24px 0; }
.identity { width: 100%; max-width: 960px; text-align: center; }
.logo { display: block; width: 56px; height: 56px; margin: 0 auto 14px; }
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 550; letter-spacing: 3.2px; text-transform: uppercase; }
/* One line above the video on desktop; phones wrap it into balanced lines. */
h1 { margin: 0; font-size: clamp(26px, 3vw, 40px); line-height: 1.09; font-weight: 450; letter-spacing: -.065em; text-wrap: balance; }

/* The demo video (self-hosted, silent, looping, no controls) is the focus. It is as wide as fits (960px at most)
   and, on desktop, short enough that the whole stack from logo to links fits on one screen: --stack is everything
   in the stack except the video. Very short windows keep a 480px wide video and scroll a little. */
.demo-figure { margin: 22px 0 0; }
.demo {
  --stack: 324px;
  display: block; height: auto; aspect-ratio: 16 / 9; margin: 0 auto;
  width: min(100%, max(480px, calc((100vh - var(--stack)) * 16 / 9)));
  width: min(100%, max(480px, calc((100svh - var(--stack)) * 16 / 9)));
  object-fit: cover; background: #000; background-clip: padding-box; border: 1px solid var(--line); border-radius: 2px;
  cursor: pointer;
}
/* demo.js: a click, tap, Space or Enter pauses or plays the video, so it takes keyboard focus like the links. */
.demo:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
/* The caption is one link; its 32px box centres the text, so the text sits about 10px under the video. */
.demo-note { margin: 2px 0 0; }

/* The footer is empty (contact goes through "Get in touch"); it only adds space below the links. */
.footer { padding-bottom: 20px; }

@media (max-width: 640px) {
  main { padding: 20px 16px 0; }
  .logo { width: 44px; height: 44px; margin-bottom: 12px; }
  .eyebrow { font-size: 10px; letter-spacing: 2.6px; margin-bottom: 8px; }
  h1 { font-size: clamp(24px, 7.2vw, 30px); }
  .demo-figure { margin-top: 18px; }
  .demo { width: 100%; }
}
@media (max-height: 640px) and (min-width: 641px) {
  main { padding-top: 14px; }
  .logo { width: 44px; height: 44px; margin-bottom: 10px; }
  .eyebrow { margin-bottom: 7px; }
  h1 { font-size: 32px; }
  .demo-figure { margin-top: 14px; }
  .demo { --stack: 268px; }
  .footer { padding-bottom: 14px; }
}

/* Beta access: the copy and three quiet links under the video, and two plain dialogs. */
.beta { margin-top: 18px; }
.beta-copy { margin: 0 auto 10px; max-width: 44em; text-wrap: balance; color: var(--muted); font-size: 13px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; }
.link {
  display: inline-flex; align-items: center; gap: 11px; min-height: 32px; padding: 0; color: var(--ink);
  background: none; border: 0; font-size: 13px; cursor: pointer;
}
.link-strong { font-weight: 550; }
.link svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; transition: transform .2s ease; }
.link:hover svg { transform: translate(2px, -2px); }
.link:focus-visible { outline-offset: 4px; }
.link[disabled] { cursor: default; color: var(--muted); }

/* While a form is sending, the send link reads "Sending…" without its arrow. */
.submit[aria-busy="true"] { color: var(--ink); }
.submit[aria-busy="true"] svg { display: none; }

.panel {
  width: min(400px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; overflow: auto;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
}
.panel::backdrop { background: rgba(250, 250, 248, .86); }
.panel-inner { padding: 22px 26px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 11px; font-weight: 550; letter-spacing: 3.2px; text-transform: uppercase; }
.close {
  display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: -8px; padding: 0;
  color: var(--ink); background: none; border: 0; cursor: pointer;
}
.close svg { fill: none; stroke: currentColor; stroke-width: 1.2; }
.close:hover { color: var(--blue); }
.close:focus-visible { outline-offset: 0; }
.panel a:not(.link) { color: inherit; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 2px; }

.field { margin-bottom: 14px; }
/* First and last name share a row; very narrow screens stack them. */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 340px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.optional { color: var(--muted); }
.field input, .field select, .field textarea {
  display: block; width: 100%; min-height: 36px; padding: 6px 0; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; font: inherit; font-size: 15px;
}
.field input, .field textarea { -webkit-appearance: none; appearance: none; }
.field select { cursor: pointer; }
.field textarea { resize: vertical; min-height: 36px; line-height: 1.45; }
.field input::placeholder { color: #a3a49f; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; padding-bottom: 5px; border-bottom: 2px solid var(--blue); }
.field [aria-invalid="true"] { border-bottom-color: var(--error); }
.field-error, .form-error { margin: 5px 0 0; color: var(--error); font-size: 12px; line-height: 1.45; }
.form-error { margin: 4px 0 12px; }
.turnstile:not(:empty) { margin: 4px 0 12px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 18px; }
.consent { margin: 0; flex: 1 1 180px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.success:focus { outline: none; }
.success p, .saved p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
.status-link { font-size: 13px; overflow-wrap: anywhere; }
.copy-note { margin-left: 8px; color: var(--muted); font-size: 12px; }
.success .note { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.text-button { padding: 0; color: var(--ink); background: none; border: 0; font-size: 13px; font-weight: 550; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 2px; cursor: pointer; }

@media (max-width: 640px) {
  .beta-copy { font-size: 12px; margin-bottom: 12px; }
  .actions { gap: 6px 26px; }
  .link { font-size: 12px; gap: 9px; }
  .panel-inner { padding: 18px 18px 20px; }
}
@media (max-height: 640px) and (min-width: 641px) {
  .beta { margin-top: 12px; }
  .beta-copy { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .link svg { transition: none; }
}
