@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #efede3;
  --white: #ffffff;
  --maroon: #3d1314;
  --maroon-dark: #2a0d0e;
  --placeholder: #a7a298;
  --muted: #918b7f;

  --inset: 40px;
  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  color: var(--maroon);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.panel {
  flex: 0 0 50%;
  background: var(--cream);
  padding: var(--inset);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero {
  flex: 1 1 50%;
  position: relative;
  overflow: hidden;
  background: var(--cream);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  animation: heroReveal 2s ease-in-out 4.8s both;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  animation: fadeInDown 1.05s cubic-bezier(0.16, 1, 0.3, 1) 4.8s both;
}

.brand-lockup {
  height: 44px;
  width: auto;
  display: block;
}

/* ---------- Headline ---------- */
.intro {
  max-width: 40rem;
  /* Vertically centered in the panel — halfway between the logo and Contact. */
  margin: auto 0;
}

.lead {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 500;
}

.lead + .lead { margin-top: 1.5em; }

.intro .lead:nth-of-type(1) { animation: fadeInUp 1s ease 0.3s both; }
.intro .lead:nth-of-type(2) { animation: fadeInUp 1s ease 2.8s both; }

/* ---------- Contact (understated link, bottom-left) ---------- */
.contact {
  position: absolute;
  left: calc(var(--inset) - 13px);
  bottom: calc(var(--inset) - 8px);
  padding: 7px 12px;
  color: var(--maroon);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.2s ease;
  animation: fadeInUp 1.05s cubic-bezier(0.16, 1, 0.3, 1) 4.8s both;
}
/* Hover: a stroked pill fades in around the text — button-like, no underline. */
.contact:hover {
  color: var(--maroon-dark);
  border-color: rgba(61, 19, 20, 0.4);
}

/* ---------- Waitlist card (overlaid on the image) ---------- */
.waitlist-card {
  position: absolute;
  right: var(--inset);
  bottom: var(--inset);
  width: min(375px, calc(100% - 80px));
  padding: 16px;
  background: rgba(239, 237, 227, 0.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 4.8s both;
}

/* Gleam: a diagonal band of light that sweeps across the glass as the card
   tilts, fading in with the tilt. Driven by --gleam / --gloss in script.js. */
.waitlist-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent calc(var(--gleam, 50%) - 24%),
    rgba(255, 255, 255, 0.13) var(--gleam, 50%),
    transparent calc(var(--gleam, 50%) + 24%)
  );
  opacity: var(--gloss, 0);
}

.card-heading {
  margin: 0 0 48px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--maroon);
}

.label {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--maroon);
}

.form-row { display: flex; gap: 8px; }

.form-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--white);
  color: var(--maroon);
  padding: 12px 14px;
  font-family: inherit;
  font-weight: 500;
  font-size: 12px;
  outline: none;
}

.form-row input::placeholder { color: var(--placeholder); }
.form-row input:focus { border-color: var(--maroon); }

/* iOS auto-zooms the page when a focused input's text is < 16px. Bump it to 16px
   on touch devices so tapping the field doesn't zoom in (desktop keeps 12px). */
@media (pointer: coarse) {
  .form-row input { font-size: 16px; }
}

.form-row button {
  flex: 0 0 auto;
  border: none;
  border-radius: 3px;
  background: var(--maroon);
  color: var(--cream);
  padding: 0 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
}
.form-row button:hover { background: var(--maroon-dark); }
.form-row button:disabled { opacity: 0.6; cursor: default; }

/* Honeypot — hidden off-screen; only bots fill it (checked server-side). */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-msg {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}
.form-msg:not(:empty) { margin-top: 12px; }
.form-msg.error { color: #9a2b2b; }
.form-msg.success { color: var(--maroon); }

/* Consent / notice line — intentionally fine print. */
.consent {
  margin: 32px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--maroon-dark);
}
.consent a { color: var(--maroon-dark); text-decoration: underline; }
.consent a:hover { color: var(--maroon); }

/* ---------- Card panes: form ⇄ thank-you crossfade ---------- */
.card-panels {
  display: grid; /* stack both panes in one cell → the card keeps a steady height */
}

.card-pane {
  grid-area: 1 / 1;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Thank-you pane: hidden by default, waiting just below; heading top, line bottom. */
.card-pane-thanks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(8px);
}
.card-pane-thanks .card-heading { margin-bottom: 0; }

/* Success: the form lifts away, the thank-you settles in. */
.waitlist-card.thanks-shown .card-pane-form {
  opacity: 0;
  transform: translateY(-8px);
  transition-delay: 0s; /* opening: the form leaves immediately */
}
.waitlist-card.thanks-shown .card-pane-thanks {
  opacity: 1;
  transform: none;
}

/* Closing: the form waits for the thank-you to clear — a beat of empty space —
   before fading back in. */
.card-pane-form {
  transition-delay: 0.7s;
}

/* "We'll be in touch." — matched to the heading (top text) size. */
.thanks-foot {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--maroon);
}

/* Close button: a symmetrical X in a faint 40px circle, top-right. */
.card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(61, 19, 20, 0.15);
  border-radius: 50%;
  background: transparent;
  color: var(--maroon);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background 0.15s ease, border-color 0.15s ease;
}
.waitlist-card.thanks-shown .card-close {
  opacity: 1;
  pointer-events: auto;
}
.card-close:hover {
  background: rgba(61, 19, 20, 0.06);
  border-color: rgba(61, 19, 20, 0.3);
}
.card-close svg { display: block; }

/* Down-arrow cue (Geist) — mobile only; see the responsive block. */
.down-arrow { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  :root { --inset: 16px; }

  .page { flex-direction: column; }

  .panel {
    flex: 0 0 auto;
    width: 100%;
    order: 1;
  }

  .intro {
    margin: 7.5rem 0 0;
    max-width: none;
  }

  .hero {
    order: 2;
    flex: none;
    height: auto;
    overflow: hidden;
  }

  .hero img {
    position: static;
    width: 100%;
    height: auto;
    /* Natural aspect (1.244) ÷ 0.85 → crops 15% off the height. */
    aspect-ratio: 1.463;
    object-fit: cover;
    animation-name: fadeIn;
  }

  .waitlist-card {
    position: relative;
    inset: auto;
    width: auto;
    padding: var(--inset);
    border: none;
    border-radius: 0;
    background: var(--cream);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }

  .down-arrow {
    display: block;
    position: absolute;
    top: var(--inset);
    right: var(--inset);
    font-family: "Geist", sans-serif;
    font-weight: 300;
    font-size: 19.2px;
    line-height: 1;
    color: var(--maroon);
  }

  /* Once the thank-you is shown there's no form to point at. */
  .waitlist-card.thanks-shown .down-arrow { display: none; }

  .contact {
    position: static;
    order: 3;
    padding: 24px var(--inset) var(--inset);
  }
}

/* Headline drops to the smaller size only on phones; tablets keep the desktop size. */
@media (max-width: 767px) {
  .lead { font-size: 16.8px; }
}

/* Headline forces a break after "in" only on viewports wider than 1300px. */
@media (max-width: 1300px) {
  .brk-lg { display: none; }
}

/* ---------- Entrance animations ---------- */
@keyframes heroReveal {
  from { opacity: 0; transform: scale(1.08); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero img,
  .brand,
  .contact,
  .waitlist-card,
  .intro .lead:nth-of-type(1),
  .intro .lead:nth-of-type(2) {
    animation: none;
  }

  /* Crossfade the panes without motion. */
  .card-pane { transition-property: opacity; }
  .card-pane-thanks,
  .waitlist-card.thanks-shown .card-pane-form { transform: none; }
}

