:root {
  color-scheme: light dark;
  --paper: #f3f1ea;
  --ink: #141414;
  --red: #c8402a;
  --muted: #62615d;
  --control-fill: var(--ink);
  --control-text: var(--paper);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 64px 16px 40px;
}

.intro {
  width: 100%;
  max-width: 520px;
  text-align: center;
}

h1 {
  margin: 0 auto;
  max-width: 440px;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

p {
  margin: 0;
}

.tagline {
  margin-top: 28px;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.description {
  margin: 24px auto 0;
  max-width: 43ch;
  font-size: 1.0625rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.coming-soon {
  margin-top: 36px;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

footer {
  padding: 24px 16px max(24px, env(safe-area-inset-bottom));
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Delight on first arrival: reveal the original curve without changing its shape. */
@media (prefers-reduced-motion: no-preference) {
  .wordmark-line {
    stroke-dasharray: 1;
    animation: draw-line 700ms var(--ease-out) 150ms both;
  }

  .wordmark-period {
    animation: drop-period 350ms var(--ease-out) 850ms both;
  }
}

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes drop-period {
  from {
    opacity: 0;
    transform: translateY(-55px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color: var(--paper);
    background: var(--ink);
    --muted: #aaa8a2;
    --control-fill: var(--paper);
    --control-text: var(--ink);
  }
}

[hidden] { display: none !important; }

.waitlist { margin-top: 20px; }
.signup-row { display: flex; align-items: flex-end; gap: 12px; }
.email-field { position: relative; flex: 1; min-width: 0; }
.email-label {
  display: block;
  margin-bottom: 8px;
  color: inherit;
  opacity: 0.7;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
}
.email-field input {
  width: 100%;
  height: 48px;
  border: 1.5px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 10px;
  padding: 0 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  caret-color: var(--red);
  outline: none;
}
.email-field input:focus { border-color: currentColor; }
.email-field input::placeholder { color: var(--muted); opacity: 1; }
.pen-line {
  display: block;
  width: 100%;
  height: 7px;
  overflow: visible;
  fill: none;
  stroke: var(--red);
  stroke-width: 17.8;
  stroke-linecap: round;
}
.email-field .pen-line { position: absolute; bottom: -2px; left: 10px; width: calc(100% - 20px); pointer-events: none; }
.field-active path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 450ms var(--ease-out); }
.email-field:focus-within .field-active path,
.has-email .field-active path { stroke-dashoffset: 0; }
.has-error .field-active { stroke: #b3261e; }
.has-error .field-active path { stroke-dashoffset: 0; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.text-button {
  display: inline-block;
  border: 0;
  padding: 12px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  cursor: pointer;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--red);
}
.join-button {
  flex: 0 0 auto;
  min-width: 0;
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--control-fill);
  color: var(--control-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  cursor: pointer;
}
.join-button:active:not(:disabled) { opacity: 0.8; }
.join-button:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.join-button:disabled { cursor: wait; opacity: 0.65; }
.arrow { display: inline-block; }
.text-button:focus-visible { outline: none; text-decoration-line: underline; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.text-button:disabled { cursor: wait; }
.consent { margin-top: 14px; font-size: 0.75rem; line-height: 1.6; color: var(--muted); }
a { color: inherit; text-underline-offset: 3px; }
.recaptcha-note { margin-top: 12px; color: var(--muted); font-size: 0.6875rem; line-height: 1.6; }
.grecaptcha-badge { visibility: hidden; }
.form-error { margin-top: 12px; font-size: 0.875rem; line-height: 1.6; color: inherit; }
.form-error::first-letter { color: #b3261e; }
.signup-success { padding-top: 6px; }
.success-message { display: inline-block; font-size: 1.25rem; font-weight: 500; line-height: 1.5; outline: none; }
.success-period { display: inline-block; color: var(--red); }
.success-line { margin-top: 5px; }
.success-line path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.signup-success[data-phase="complete"] .success-line path { stroke-dashoffset: 0; }
.signup-success[data-phase="intro"] .success-period { opacity: 0; }
#profile-form { margin-top: 28px; }
.question { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.question legend { width: 100%; padding: 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 18px; }
.choice { position: relative; display: inline-block; padding: 12px 0 9px; cursor: pointer; font-size: 0.875rem; line-height: 1.5; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-line { position: absolute; bottom: 3px; height: 5px; pointer-events: none; }
.choice-line path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.choice:has(input:checked) .choice-line path { stroke-dashoffset: 0; }
.choice:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 3px; }
.skip-button, .retry-button { color: var(--muted); font-size: 0.8125rem; margin: 0 8px; }
.privacy { width: 100%; max-width: 560px; line-height: 1.7; }
.home-link { display: block; max-width: 280px; margin: 0 auto 40px; }
.privacy h2 { margin: 0 0 24px; font-size: 1.5rem; letter-spacing: -0.025em; }
.privacy h3 { margin: 28px 0 8px; font-size: 1rem; }
.privacy p + p { margin-top: 14px; }
.privacy-date { margin-top: 32px; color: var(--muted); font-size: 0.8125rem; }

@media (hover: hover) and (pointer: fine) {
  .text-button:hover { text-decoration-line: underline; }
  .choice:hover { color: var(--red); }
}

@media (max-width: 560px) {
  .signup-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .join-button, .email-field { width: 100%; }
  .consent { max-width: 38ch; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .submit-arrow .arrow { animation: finish-arrow 160ms var(--ease-out) both; }
  .submit-stroke .field-active path { transition: none; animation: finish-stroke 450ms var(--ease-out) both; }
  .leaving { animation: lift-away 180ms var(--ease-out) both; }
  .success-enter .success-message { animation: appear 180ms var(--ease-out) both; }
  .period-enter .success-period { animation: drop-period 350ms var(--ease-out) both; }
  .line-enter .success-line path { animation: pen-draw 450ms var(--ease-out) both; }
  .questions-enter .tablet-question { animation: appear 120ms var(--ease-out) both; }
  .questions-enter .os-question { animation: appear 120ms var(--ease-out) 120ms both; }
  .choice-picked:has(input:checked) .choice-line path { animation: pen-draw 250ms var(--ease-out) both; }
}
@keyframes pen-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes finish-stroke {
  0% { stroke-dashoffset: 1; opacity: 1; }
  75% { stroke-dashoffset: 0; opacity: 1; transform: translateY(0); }
  100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-2px); }
}
@keyframes finish-arrow { to { transform: translateX(4px); } }
@keyframes lift-away { to { opacity: 0; transform: translateY(-6px); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .field-active path { transition: none; }
}
