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

:root {
  --porcelain: #FAF8F5;
  --terracotta: #C45C3E;
  --terracotta-press: #A84D33;
  --ink: #1A1A1A;
  --muted: #6B6560;
  --hairline: #E2DCD3;
  --well: #F1EDE7;
  --error: #9E4128;

  --ring: 0 0 0 3px rgba(196, 92, 62, 0.28);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t: 180ms;

  --radius: 10px;
  --gutter: clamp(1.5rem, 11vw, 10rem);

  color-scheme: light;
}

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

html {
  background: var(--porcelain);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--porcelain);
  color: var(--ink);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(196, 92, 62, 0.18); }

/* ---------- Composition ---------- */

.page {
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(clamp(2rem, 9vh, 6rem), env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    clamp(4rem, 14vh, 9rem)
    max(var(--gutter), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

/* The SVG has ~20% built-in padding around the glyph; pull it left so the
   glyph's edge lines up with the text column instead of the image box. */
.mark {
  display: block;
  width: 96px;
  height: 96px;
  margin-left: -19px;
  margin-top: -16px;
}

.content {
  margin-top: clamp(3.5rem, 13vh, 8rem);
  max-width: 40rem;
}

/* ---------- Type ---------- */

.headline {
  margin: 0;
  max-width: 9.5em;
  font-size: clamp(2.5rem, 1.55rem + 3.6vw, 4.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.034em;
  text-wrap: balance;
}

.sub {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  letter-spacing: -0.006em;
}

/* ---------- Form ---------- */

.form,
.done {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  max-width: 24rem;
}

.field {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.label {
  display: block;
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 450;
  line-height: 1.3;
}

.input {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 0.875rem;
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming */
  letter-spacing: -0.005em;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: #A39D96; opacity: 1; }

.input:hover { border-color: #D3CBC0; }

.input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: var(--ring);
}

.input[aria-invalid='true'] { border-color: var(--error); }

/* Segmented control: three equal radio segments in a recessed well. */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--well);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.segmented input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.segmented label:hover { color: var(--ink); }

.segmented input:checked + label {
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(26, 26, 26, 0.06), 0 1px 2px rgba(26, 26, 26, 0.08);
}

.segmented input:focus-visible + label {
  box-shadow: 0 0 0 2px var(--terracotta);
}

.platform[aria-invalid='true'] .segmented { border-color: var(--error); }

/* Honeypot — off-screen, not display:none, so naive bots still fill it. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile { max-width: 100%; }
.turnstile.is-visible { margin-bottom: 1rem; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 1.25rem;
  background: var(--terracotta);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t) var(--ease), opacity var(--t) var(--ease);
}

.button:hover { background: var(--terracotta-press); }

.button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

.button[aria-busy='true'] {
  opacity: 0.72;
  cursor: progress;
}

.note {
  margin: 0.875rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.status {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.status:empty { display: none; }

.status.is-error { color: var(--error); }

/* ---------- Success ---------- */

.done { animation: settle var(--t) var(--ease) both; }

.done-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.done-title:focus { outline: none; }

.done-title::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 2px;
  margin-bottom: 1rem;
  background: var(--terracotta);
  border-radius: 1px;
}

.done-text {
  margin: 0.625rem 0 0;
  color: var(--muted);
}

.done-text strong {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

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

@media (max-width: 480px) {
  .mark {
    width: 80px;
    height: 80px;
    margin-left: -16px;
    margin-top: -13px;
  }

  .content { margin-top: clamp(2.5rem, 9vh, 4.5rem); }

  .form,
  .done { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
