/* ─── Reset & base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #FAF8F3;
  --ink: #1A1916;
  --ink-muted: #5F5C58;
  --red: #C0473A;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --column-width: 44%;
  /* column is 44vw centered, so its left edge is 28vw; rule sits a 2rem gutter left of the text */
  --rule-left: calc(28vw - 2rem);
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* one screen, no scroll on desktop */
}

/* ─── Accessibility: skip link & screen reader only ─── */
.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;
}

/* ─── Full-height vertical margin rule ─── */
.rule {
  position: fixed;
  top: 0;
  left: var(--rule-left);
  width: 1px;
  height: 0; /* animated to 100% */
  background: var(--red);
  opacity: 0.7;
  z-index: 0;
  transform-origin: top center;
}

/* ─── Margo: a marginal mark beside the rule ─── */
.content {
  position: relative;
}

.margo-mark {
  position: absolute;
  /* Out in the left margin: 1rem past the rule, which sits 2rem left of the
     column edge. Feet land near the promise baseline. */
  left: calc(-3rem - 140px);
  top: -70px;
  width: 140px;
  height: auto;
  z-index: 0;
  /* Warm the artwork's cool shading toward the paper, as in the app. */
  filter: sepia(0.14) saturate(1.08) drop-shadow(0 5px 12px rgba(92, 72, 44, 0.14));
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

/* ─── Margo beside the confirmation line ─── */
.form-confirmation {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.margo-confirm {
  width: 64px;
  height: auto;
  filter: sepia(0.14) saturate(1.08) drop-shadow(0 4px 10px rgba(92, 72, 44, 0.14));
  flex-shrink: 0;
}

/* ─── Main column ─── */
.column {
  position: relative;
  z-index: 1;
  width: var(--column-width);
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;

  /* animation setup */
  opacity: 0;
  transform: translateY(8px);
}

/* ─── Wordmark ─── */
.wordmark {
  font-family: var(--serif);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 2.5rem;
}

/* ─── Promise line ─── */
.promise {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: 0;
  max-width: 11.5em;
  text-wrap: balance;
}

/* ─── Body copy ─── */
.body-copy {
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #57534e;
  max-width: 37em;
  text-wrap: pretty;
}

.body-copy + .body-copy {
  margin-top: 0.35rem;
}

.body-copy.secondary {
  color: #6B6865;
}

/* ─── Waitlist form ─── */
.waitlist-form {
  margin-top: 2.25rem;
}

.form-row[hidden] {
  display: none;
}

.form-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 27rem;
}

.form-row input[type="email"] {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--bg);
  border: none;
  border-bottom: 1px solid rgba(26, 25, 22, 0.25);
  padding: 0.55rem 0.75rem 0.55rem 0;
  outline: none;
  transition: border-color 0.18s ease;
  caret-color: var(--red);
}

.form-row input[type="email"]:-webkit-autofill,
.form-row input[type="email"]:-webkit-autofill:hover,
.form-row input[type="email"]:-webkit-autofill:focus,
.form-row input[type="email"]:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 9999s ease-out;
}

.form-row input[type="email"]::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
}

.form-row input[type="email"]:focus {
  border-bottom-color: var(--red);
}

.form-row input[type="email"]:focus-visible {
  border-bottom-color: var(--red);
}

.form-row button {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0.55rem 0 0.55rem 1.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
  outline: none;
}

.form-row button:hover {
  color: var(--ink);
}

.form-row button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Confirmation line ─── */
.form-confirmation {
  font-family: var(--serif);
  font-size: 0.9375rem;
  color: var(--ink-muted);
  font-style: italic;
  padding: 0.55rem 0;
}

.form-confirmation[hidden] {
  display: none;
}

/* focused programmatically for AT announcement only — not interactive */
.form-confirmation:focus {
  outline: none;
}

/* ─── Trust line ─── */
.trust {
  margin-top: 2.25rem;
  font-family: var(--serif);
  font-size: 0.9375rem;
  line-height: 1.55;
  letter-spacing: 0;
  color: #68635d;
  font-style: italic;
  max-width: 31em;
  text-transform: none;
  text-wrap: pretty;
}

/* ─── Animations ─── */
@media (prefers-reduced-motion: no-preference) {
  .column {
    animation: settle 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 80ms forwards;
  }

  .rule {
    animation: rule-draw 600ms cubic-bezier(0.4, 0, 0.2, 1) 60ms forwards;
  }

  /* Margo arrives after the rule finishes drawing, then holds still. */
  .margo-mark {
    animation: margo-settle 500ms ease-out 750ms forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .column {
    opacity: 1;
    transform: none;
  }

  .rule {
    height: 100vh;
  }

  .margo-mark {
    opacity: 1;
  }
}

@keyframes margo-settle {
  to {
    opacity: 1;
  }
}

@keyframes settle {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rule-draw {
  to {
    height: 100vh;
  }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  :root {
    --column-width: 100%;
    --rule-left: 1.5rem;
  }

  body {
    overflow: auto; /* allow scroll on mobile */
  }

  /* The mobile margin is a 1.5rem sliver — no blank space for Margo. */
  .margo-mark {
    display: none;
  }

  .column {
    width: 100%;
    padding: 0 2.5rem 0 3.5rem; /* breathing room + indent past rule */
    height: auto;
    min-height: 100vh;
    justify-content: center;
  }

  .promise {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
  }

  .form-row {
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
  }

  .form-row input[type="email"] {
    width: 100%;
    padding-right: 0;
  }

  .form-row button {
    padding-left: 0;
    border-bottom-color: rgba(26, 25, 22, 0.25);
    text-align: left;
    font-size: 0.875rem;
  }
}

/* ─── Ensure one screen on target desktop sizes ─── */
@media (min-width: 769px) and (max-height: 900px) {
  .column {
    padding-top: 0;
    padding-bottom: 0;
  }

  .promise {
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    margin-bottom: 1.25rem;
  }

  .waitlist-form {
    margin-top: 1.65rem;
  }

  .trust {
    margin-top: 1.85rem;
  }

  .wordmark {
    margin-bottom: 1.9rem;
  }
}
