:root {
  color-scheme: light;
  --paper: #f4f1eb;
  --paper-bright: #faf8f3;
  --ink: #171c19;
  --jade: #155a3b;
  --jade-deep: #104c32;
  --muted: #606863;
  --line: rgba(21, 90, 59, 0.18);
  --line-strong: rgba(21, 90, 59, 0.34);
  --error: #934c3a;
  --display: "Newsreader", Georgia, serif;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input { font: inherit; }

button,
summary,
a { touch-action: manipulation; }

button { cursor: pointer; }

.birth-shell {
  position: relative;
  min-height: 100svh;
  overflow-x: hidden;
  isolation: isolate;
  background-image:
    linear-gradient(90deg, rgba(244, 241, 235, 0.01) 0%, rgba(244, 241, 235, 0.03) 47%, rgba(244, 241, 235, 0.38) 100%),
    url('/assets/ink-mirror/landing-confirmed-desktop-v101.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.birth-shell::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle at 76% 48%, rgba(250, 248, 243, 0.46), transparent 43%);
}

.site-header {
  position: absolute;
  top: 34px;
  left: 46px;
  z-index: 2;
}

.wordmark {
  color: var(--ink);
  font-family: var(--display);
  font-size: 29px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.birth-stage {
  width: min(100%, 1440px);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(590px, 0.93fr);
  align-items: center;
  padding: 88px clamp(48px, 4.5vw, 72px) 36px;
}

.form-sheet {
  position: relative;
  grid-column: 2;
  width: min(100%, 620px);
  justify-self: end;
  padding: 31px 43px 29px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(250, 248, 243, 0.87);
  box-shadow: 0 30px 74px -56px rgba(23, 35, 30, 0.54), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.form-sheet::before {
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 1px solid rgba(21, 90, 59, 0.12);
  content: "";
  pointer-events: none;
}

.back-button {
  min-height: 44px;
  margin: -7px 0 14px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #3e4943;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.back-button svg { flex: 0 0 auto; }

.eyebrow {
  margin: 0;
  color: var(--jade);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

h1 {
  max-width: 10ch;
  margin: 12px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(48px, 4vw, 58px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.intro-copy {
  max-width: 44ch;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-group {
  min-width: 0;
  margin: 21px 0 0;
  padding: 0;
  border: 0;
}

.field-group legend {
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #38423d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.field-group legend small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 10px;
}

.date-grid label,
.optional-grid label {
  display: grid;
  gap: 6px;
}

.date-grid label > span,
.optional-grid label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

input {
  width: 100%;
  min-height: 49px;
  border: 1px solid rgba(23, 28, 25, 0.18);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.date-grid input { padding: 0 15px; }
input::placeholder { color: #68716c; }

input:focus {
  border-color: var(--jade);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(21, 90, 59, 0.1);
}

input[aria-invalid="true"] { border-color: rgba(147, 76, 58, 0.72); }

.sex-group { margin-top: 18px; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  min-height: 48px;
  border: 1px solid rgba(23, 28, 25, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #303a35;
  font-size: 14px;
  font-weight: 500;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.choice span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice:hover { border-color: var(--line-strong); }
.choice:active { transform: scale(0.99); }
.choice.active { border-color: var(--jade-deep); background: var(--jade-deep); color: #fffdf8; }

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  margin: 7px 0 0;
  color: var(--error);
  font-size: 11.5px;
  line-height: 1.4;
}

.optional-details {
  margin-top: 15px;
  padding: 9px 0;
  border-block: 1px solid rgba(21, 90, 59, 0.13);
}

.optional-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #303a35;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}

.optional-label {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
}

.optional-details > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.optional-details .optional-helper {
  margin-top: 9px;
}

.optional-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
  margin-top: 12px;
}

.optional-grid input { padding: 0 13px; }

.optional-grid input:disabled {
  color: #7b837f;
  cursor: not-allowed;
  opacity: .72;
}

.city-selection-status {
  min-height: 16px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.next-note {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: baseline;
  margin-top: 15px;
}

.next-note span {
  color: var(--jade);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-note strong {
  color: #303a35;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.primary-cta {
  width: 100%;
  min-height: 54px;
  margin-top: 15px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--jade-deep);
  color: #fffdf8;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-cta:hover { background: #0d412b; transform: translateY(-1px); }
.primary-cta:active { transform: translateY(0) scale(0.99); }
.primary-cta:disabled { cursor: wait; opacity: 0.76; transform: none; }

.trust-note {
  margin: 8px 0 0;
  color: #505a54;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.legal-copy {
  max-width: 48ch;
  margin: 10px auto 0;
  color: #59615c;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.legal-copy a { color: #303a35; text-underline-offset: 3px; }

.wordmark:focus-visible,
.back-button:focus-visible,
.choice:focus-visible,
.choice:has(input:focus-visible),
.primary-cta:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .birth-shell {
    min-height: 100svh;
    background-image:
      linear-gradient(180deg, rgba(244, 241, 235, 0.04), rgba(244, 241, 235, 0.13)),
      url('/assets/ink-mirror/landing-confirmed-mobile-v101.jpg');
    background-position: center top;
  }

  .birth-shell::after {
    background: linear-gradient(180deg, rgba(250, 248, 243, 0.05), rgba(250, 248, 243, 0.53) 12%, rgba(250, 248, 243, 0.44) 78%, rgba(250, 248, 243, 0.1));
  }

  .site-header { top: 22px; left: 24px; }
  .wordmark { font-size: 25px; }

  .birth-stage {
    display: block;
    min-height: 100svh;
    padding: 75px 24px 28px;
  }

  .form-sheet {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .form-sheet::before { display: none; }
  .back-button { min-height: 44px; margin: -7px 0 4px; }
  .eyebrow { font-size: 9.5px; letter-spacing: 0.055em; }
  h1 { margin-top: 9px; font-size: clamp(39px, 10.8vw, 43px); }
  .intro-copy { margin-top: 10px; font-size: 12px; }
  .field-group { margin-top: 17px; }
  .date-grid { gap: 8px; }
  .date-grid input { min-height: 48px; padding: 0 12px; }
  .sex-group { margin-top: 15px; }
  .choice { min-height: 47px; }
  .field-help { font-size: 10.5px; }
  .optional-details { margin-top: 11px; padding: 3px 0; }
  .optional-details summary { min-height: 44px; }
  .next-note { margin-top: 12px; }
  .primary-cta { min-height: 53px; margin-top: 12px; }
  .trust-note { margin-top: 7px; font-size: 11.5px; }
  .legal-copy { margin-top: 9px; color: #505954; font-size: 11px; }
}

@media (max-width: 520px) {
  .optional-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .site-header { left: 19px; }
  .birth-stage { padding-right: 19px; padding-left: 19px; }
  h1 { font-size: 38px; }
  .eyebrow { font-size: 9px; }
  .date-grid { grid-template-columns: 1fr 1fr 1.18fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
