:root {
  --bg: #F3EDE2;
  --ink: #3A3734;
  --muted: rgba(58, 55, 52, 0.62);
  --accent: #C9933F;
  --accent-ink: #3A3734;
  --rule: #A9B48C;
  --field: rgba(58, 55, 52, 0.28);
  --ok: #5E6B45;
  --err: #9A4A2E;
  --grain-opacity: 0.06;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2B211C;
    --ink: #F3EDE2;
    --muted: rgba(243, 237, 226, 0.62);
    --accent: #B08D57;
    --accent-ink: #2B211C;
    --rule: rgba(169, 180, 140, 0.55);
    --field: rgba(243, 237, 226, 0.28);
    --ok: #B7C29A;
    --err: #E0A182;
    --grain-opacity: 0.08;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.23 0 0 0 0 0.21 0 0 0 0 0.2 0 0 0 1.2 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap, .foot { position: relative; z-index: 1; }

.wrap {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 auto;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  min-width: 60%;
}

.lede {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 4.6vw, 1.6rem);
  line-height: 1.35;
  margin: 1.75rem 0 0.75rem;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 auto 2.75rem;
  max-width: 28rem;
}

.join .row {
  display: flex;
  gap: 0.625rem;
}

.join input[type="email"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem; /* avoids iOS zoom */
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--field);
  border-radius: 0;
  padding: 0.75rem 0.25rem;
  outline: none;
  transition: border-color 0.2s;
}
.join input[type="email"]::placeholder { color: var(--muted); opacity: 0.8; }
.join input[type="email"]:focus { border-bottom-color: var(--accent); }

.join button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s, opacity 0.2s;
}
.join button:hover { filter: brightness(1.05); }
.join button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.join button:disabled { opacity: 0.6; cursor: progress; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.status {
  min-height: 1.6em;
  margin: 1rem 0 0;
  font-size: 0.9rem;
}
.status.is-ok { color: var(--ok); }
.status.is-err { color: var(--err); }

.privacy {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.foot {
  text-align: center;
  padding: 1.5rem 1.5rem 2rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.foot nav { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 0.5rem; }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--field); padding-bottom: 1px; }
.foot a:hover { border-bottom-color: var(--accent); }
.foot p { margin: 0; }

@media (max-width: 30rem) {
  .wrap { padding-top: 3rem; }
  .join .row { flex-direction: column; }
  .join button { width: 100%; padding: 0.9rem 1rem; }
}

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