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

:root {
  --chalk:  #f0ebe0;
  --dim:    #a0a098;
  --border: #686860;
}

html, body {
  height: 100%;
  color: var(--chalk);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* Chalkboard photo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('board.jpg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
}

/* Dark gradient over the lower portion */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    transparent 25%,
    rgba(0, 0, 0, 0.55) 65%,
    rgba(0, 0, 0, 0.75) 100%
  );
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 4rem; /* bottom clears the fixed footer */
}

/* SVG chalk filter — positioned out of flow */
.svg-filter {
  position: absolute;
  width: 0;
  height: 0;
}

/* SVG chalk filter — roughens text edges via fractal displacement */
.wordmark {
  font-family: 'Schoolbell', cursive;
  font-size: clamp(4rem, 14vw, 9rem);
  color: var(--chalk);
  letter-spacing: 0.03em;
  line-height: 1;
  filter: url(#chalk);
}

/* Chalk rule */
.rule {
  width: clamp(60px, 12vw, 120px);
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border),
    var(--dim),
    var(--border),
    transparent
  );
  margin: 2rem 0;
}

/* Tagline */
.tagline {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: var(--dim);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ── Step 1: email capture ── */
.signup {
  margin-top: 3rem;
  display: flex;
  gap: 0;
  width: 100%;
  max-width: 340px;
}

.signup input {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 0.75rem 1rem;
  color: var(--chalk);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
}

.signup input::placeholder { color: var(--dim); }
.signup input:focus { border-color: var(--dim); }

.signup button {
  background: rgba(0, 0, 0, 0.45);
  color: var(--chalk);
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 0;
  padding: 0.75rem 1.25rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s;
  white-space: nowrap;
}

.signup button:hover { border-color: var(--dim); }

.signup-note {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  color: var(--border);
  letter-spacing: 0.08em;
}

/* ── Step 2: full waitlist form ── */
.waitlist {
  display: none;
  margin-top: 2rem;
  width: 100%;
  max-width: 360px;
  flex-direction: column;
  gap: 0.75rem;
}

.waitlist.visible { display: flex; }

.waitlist-title {
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 0.9rem;
  color: var(--chalk);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--border); }

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--dim); }

.field select {
  appearance: none;
  cursor: pointer;
}

.field select option {
  background: #1a1a14;
  color: var(--chalk);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Weight field: paired input + unit select */
.weight-wrap {
  display: flex;
  gap: 0;
}

.weight-input {
  flex: 1;
  min-width: 0; /* prevents number input intrinsic min-width from overflowing the flex container */
  border-radius: 4px 0 0 4px;
  border-right: none;
}

.field .weight-select {
  flex-shrink: 0;
  width: auto;
  border-radius: 0 4px 4px 0;
  padding: 0.65rem 0.5rem;
}

/* Bio label row */
.label-split {
  display: flex;
  justify-content: space-between;
}

.optional { opacity: 0.5; }

.bio-count {
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
}

.waitlist-submit {
  margin-top: 0.25rem;
  background: rgba(0, 0, 0, 0.45);
  color: var(--chalk);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
}

.waitlist-submit:hover { border-color: var(--dim); }
.waitlist-submit:disabled { opacity: 0.5; cursor: default; }
.waitlist-submit.error { border-color: #c0534a; color: #c0534a; }

.field-error {
  font-size: 0.65rem;
  color: #c0534a;
  letter-spacing: 0.05em;
  min-height: 0.85rem;
}

.field-error--submit {
  text-align: center;
  margin-top: 0.25rem;
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea,
.field--invalid .weight-wrap input {
  border-color: #c0534a !important;
}

/* Success message shown after waitlist submit */
.success-msg {
  color: var(--dim);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

/* Footer */
footer {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.65rem;
  color: var(--border);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 1;
}
