@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Dark (default): deep ink. Light: cool paper. Coral is reserved for the
   nib, the primary action and the signed state. */
:root {
  --coral: #FF5A3C;
  --coral-hover: #FF7558;
  --on-coral: #13163D;
  --bg: #13163D;
  --bg-raise: #1B1F4E;
  --text: #FFFFFF;
  --text-2: #C3C7EA;
  --text-3: #9298C9;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .26);
  --field: rgba(255, 255, 255, .06);
  --ok: #FFB09F;
  --danger: #FFA89B;
  --paper: #FBFBFE;
  --paper-ink: #13163D;
  --paper-rule: #D9DBEC;
  --paper-text: #6A6F99;
  --paper-edge: rgba(0, 0, 0, .35);
  --radius: 12px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F5F6FB;
    --bg-raise: #FFFFFF;
    --text: #13163D;
    --text-2: #474C7A;
    --text-3: #636894;
    --line: rgba(19, 22, 61, .14);
    --line-strong: rgba(19, 22, 61, .28);
    --field: #FFFFFF;
    --ok: #B3321A;
    --danger: #B42318;
    --paper: #FFFFFF;
    --paper-edge: rgba(19, 22, 61, .12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--coral); color: var(--on-coral); padding: .6rem 1rem; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.top, .hero, .foot {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.top { padding-top: 1.75rem; }
.brand { display: inline-block; border-radius: 6px; }
.brand img { display: block; width: 8.5rem; height: auto; }
.brand:focus-visible { outline: 2px solid var(--coral); outline-offset: 6px; }

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: clamp(2.5rem, 8vh, 5rem);
  padding-bottom: 3rem;
}

h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.6rem, 8.5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.sub {
  margin: 1.25rem 0 0;
  max-width: 30rem;
  color: var(--text-2);
  font-size: clamp(1.05rem, 2.6vw, 1.22rem);
  line-height: 1.5;
}

.waitlist { width: 100%; max-width: 30rem; margin: 2.25rem 0 0; }
.field { display: flex; flex-direction: column; gap: .6rem; }

input[type="email"] {
  width: 100%;
  min-height: 3.25rem;
  padding: .85rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type="email"]::placeholder { color: var(--text-3); opacity: 1; }
input[type="email"]:focus-visible {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 90, 60, .22);
}
.waitlist[data-state="error"] input[type="email"] { border-color: var(--danger); }

button {
  min-height: 3.25rem;
  padding: .85rem 1.35rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-coral);
  background: var(--coral);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}
button:hover { background: var(--coral-hover); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
button[disabled] { opacity: .7; cursor: progress; }

.status { min-height: 1.5rem; margin: .8rem 0 0; font-size: .95rem; font-weight: 600; color: var(--ok); }
.status:empty { min-height: 0; margin: 0; }
.waitlist[data-state="error"] .status { color: var(--danger); }
.note { margin: .8rem 0 0; font-size: .875rem; color: var(--text-3); }
.waitlist[data-state="done"] .field, .waitlist[data-state="done"] .note { display: none; }
.waitlist[data-state="done"] .status { font-size: 1.05rem; }

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

/* The document: the page's one illustrated moment. */
.doc { margin: 0; display: flex; justify-content: center; }
.paper {
  width: 100%;
  max-width: 26rem;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 10px;
  box-shadow: 0 1px 0 var(--paper-edge), 0 24px 60px -24px var(--paper-edge);
  transform: rotate(-1.5deg);
}
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.doc-title { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; }
.doc-page { font-size: .8rem; color: var(--paper-text); }
.lines { display: grid; gap: .55rem; margin: 1.25rem 0 1.5rem; }
.lines span { display: block; height: .5rem; border-radius: 4px; background: var(--paper-rule); }
.lines .short { width: 58%; }
.lines .mid { width: 78%; }

.sign-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sign-x { fill: none; stroke: var(--paper-text); stroke-width: 2; stroke-linecap: round; }
.sign-line { stroke: var(--paper-rule); stroke-width: 2; stroke-linecap: round; }
.sign-ink {
  fill: none;
  stroke: var(--coral);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sign-nib path { fill: var(--paper-ink); }
.sign-nib circle { fill: var(--paper); }
.sign-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; }
.who { font-size: .85rem; color: var(--paper-text); }
.badge {
  font-size: .8rem;
  font-weight: 600;
  color: #9A2A12;
  background: #FFE3DC;
  padding: .2rem .6rem;
  border-radius: 999px;
}

/* One orchestrated moment: the signature draws itself, then is marked signed. */
@media (prefers-reduced-motion: no-preference) {
  .sign-ink { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ink 1.5s .5s cubic-bezier(.45, .05, .35, 1) forwards; }
  .sign-nib { opacity: 0; animation: fade .25s 1.85s ease-out forwards; }
  .badge { opacity: 0; transform: translateY(4px); animation: show .35s 2.05s ease-out forwards; }
  @keyframes ink { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
  @keyframes show { to { opacity: 1; transform: none; } }
}

.foot {
  padding-top: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  font-size: .875rem;
  color: var(--text-3);
  border-top: 1px solid var(--line);
}
.foot p { margin: 0; }
.foot a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.foot a:hover { color: var(--text); border-color: var(--coral); }
.foot a:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

@media (min-width: 560px) {
  .field {
    flex-direction: row;
    gap: .4rem;
    padding: .35rem;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: calc(var(--radius) + 4px);
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  .field:focus-within { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 90, 60, .2); }
  .field input[type="email"] { background: transparent; border-color: transparent; min-height: 3rem; }
  .field input[type="email"]:focus-visible { box-shadow: none; border-color: transparent; }
  .waitlist[data-state="error"] .field { border-color: var(--danger); }
  .waitlist[data-state="error"] .field input[type="email"] { border-color: transparent; }
  .field button { min-height: 3rem; }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; gap: 4rem; }
  .doc { justify-content: flex-end; }
}

@media (forced-colors: active) {
  button, input[type="email"], .field, .paper { border: 1px solid CanvasText; }
}

/* Secondary pages (thanks / error / 404) */
.simple { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 3rem; padding-bottom: 3rem; }
.simple h1 { font-size: clamp(2.2rem, 7vw, 3.5rem); }
.back { margin: 2rem 0 0; }
.back a { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--coral); }
.back a:hover { color: var(--coral); }
.back a:focus-visible { outline: 2px solid var(--coral); outline-offset: 4px; border-radius: 2px; }
