:root {
  --bg:          #f4f0e7;   /* warm bone — no pure white */
  --ink:         #2a2521;   /* soft, warm near-black — no pure black */
  --ink-soft:    #6b6258;   /* muted secondary text */
  --line:        #c9bfae;   /* thin field underline */
  --line-focus:  #6b6258;   /* underline on focus */
  --danger:      #9a5b47;   /* muted terracotta for errors — not a loud red */

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.card {
  width: 100%;
  max-width: 30rem;
  text-align: center;
}

/* ---------- Type ---------- */
.heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 9vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0;
}

.subheading {
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin: 1.5rem auto 0;
  max-width: 26rem;
}

/* ---------- Form ---------- */
.form {
  margin-top: 3rem;
  text-align: left;
}

.field {
  margin-bottom: 2rem;
}

.field label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.field input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.4rem 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  color: var(--ink);
  border-radius: 0;           /* iOS strips the boxy look */
  transition: border-color 0.25s ease;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--line-focus);
}

.field input::placeholder { color: var(--line); }

/* Invalid state */
.field.invalid input {
  border-bottom-color: var(--danger);
}

.field-error {
  display: block;
  min-height: 1.1rem;
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--danger);
}

/* Honeypot — visually and functionally hidden from humans */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Button ---------- */
.submit {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.submit:hover {
  background: var(--ink);
  color: var(--bg);
}

.submit:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.submit:disabled {
  cursor: default;
  opacity: 0.5;
}

/* Pending state */
.submit.pending {
  opacity: 0.6;
}

/* Form-level error (submit failed) */
.form-error {
  min-height: 1.2rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--danger);
}
.form-error:empty { margin-top: 0; }

/* ---------- Success confirmation ---------- */
.confirmation {
  margin-top: 3rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.5;
}

/* ---------- Entrance animation (slow fade only) ---------- */
.card {
  animation: fade-in 1.2s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

/* ---------- Small screens ---------- */
@media (max-width: 400px) {
  .form { margin-top: 2.5rem; }
}
