:root {
  --bg: #FBF9F5;
  --bg-elevated: #FFFFFF;
  --text-primary: #181615;
  --text-secondary: #655F59;
  --text-muted: #938C84;
  --accent: #A84A32;
  --border: rgba(24, 22, 21, 0.11);
  --border-focus: #181615;
  --error: #B93829;
  --success: #2A6246;

  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-pill: 9999px;
  --radius-card: 18px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color-scheme: light;
}

body {
  background-color: var(--bg);
  background-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    rgba(235, 225, 210, 0.45) 0%,
    rgba(251, 249, 245, 0) 70%
  );
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size-adjust: 0.52;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

.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;
}

/* Faded Background Video */
.bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--bg);
}

.bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  filter: saturate(0.85) sepia(0.12) contrast(0.96) brightness(1.04);
  transition: opacity 2.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-video.is-loaded {
  opacity: 0.44;
}

.bg-video-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 48%,
    rgba(251, 249, 245, 0.5) 0%,
    rgba(251, 249, 245, 0.2) 60%,
    rgba(251, 249, 245, 0.55) 100%
  );
}

/* Layout Shell */
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: max(clamp(1.25rem, 3.5vh, 2.75rem), env(safe-area-inset-top));
  padding-bottom: max(clamp(1.25rem, 3.5vh, 2.75rem), env(safe-area-inset-bottom));
  padding-left: max(clamp(1.25rem, 5vw, 3rem), env(safe-area-inset-left));
  padding-right: max(clamp(1.25rem, 5vw, 3rem), env(safe-area-inset-right));
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1;
}

/* Main Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 6vh, 5rem) 0;
}

.hero-content {
  width: 100%;
  max-width: clamp(300px, 90vw, 620px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.7rem, 1.5vw, 0.78rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: clamp(0.85rem, 2vh, 1.25rem);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 74, 50, 0.14);
}

.headline {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6.5vw + 0.5rem, 5rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-wrap: balance;
  margin-bottom: clamp(0.9rem, 2.2vh, 1.35rem);
}

.headline em {
  font-style: italic;
  font-weight: 400;
}

.subheadline {
  font-size: clamp(0.975rem, 1.2vw + 0.5rem, 1.175rem);
  color: var(--text-secondary);
  max-width: 46ch;
  line-height: 1.6;
  text-wrap: pretty;
  margin-bottom: clamp(1.5rem, 3.5vh, 2.25rem);
}

/* Waitlist Form */
.waitlist-form {
  width: 100%;
  max-width: 460px;
  container-type: inline-size;
}

.input-group {
  display: flex;
  align-items: center;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.35rem 0.35rem 1.25rem;
  box-shadow: 0 8px 28px -10px rgba(24, 22, 21, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 10px 30px -8px rgba(24, 22, 21, 0.1);
}

.input-group:has(.email-input:user-invalid),
.input-group.is-invalid {
  border-color: var(--error);
}

.email-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  /* 16px (1rem) prevents iOS Safari from auto-zooming on focus */
  font-size: 1rem;
  color: var(--text-primary);
  padding: 0.65rem 0.5rem 0.65rem 0;
  outline: none;
}

.email-input::placeholder {
  color: var(--text-muted);
}

.submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--text-primary);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.78rem 1.35rem;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:active {
  transform: scale(0.985);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(251, 249, 245, 0.35);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.submit-btn.is-loading .btn-label {
  opacity: 0;
}

.submit-btn.is-loading .btn-spinner {
  display: block;
  position: absolute;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-feedback {
  min-height: 1.35rem;
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  color: var(--error);
}

/* Confirmation State */
.waitlist-success {
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 8px 28px -10px rgba(24, 22, 21, 0.05);
}

.waitlist-success[hidden] {
  display: none;
}

.success-badge {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background-color: rgba(42, 98, 70, 0.1);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.success-copy {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  text-wrap: pretty;
}

.confirmed-email {
  color: var(--text-primary);
  font-weight: 500;
}

.microcopy {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 1rem;
}

/* Responsive Adjustments Across Devices */

/* Small phones & narrow containers */
@media (max-width: 520px) {
  .input-group {
    flex-direction: column;
    border-radius: 16px;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .email-input {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    text-align: center;
  }

  .submit-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
  }

  .waitlist-success {
    padding: 1.25rem 1.25rem;
  }
}

/* Extra-small screens (e.g., 320px width / folded devices) */
@media (max-width: 359px) {
  .headline {
    font-size: 2.2rem;
  }

  .subheadline {
    font-size: 0.925rem;
  }
}

/* Short viewports & mobile landscape orientation */
@media (max-height: 620px) {
  .hero {
    padding: 0.75rem 0;
  }

  .eyebrow {
    margin-bottom: 0.5rem;
  }

  .headline {
    font-size: clamp(2.1rem, 5vw, 3.25rem);
    margin-bottom: 0.5rem;
  }

  .subheadline {
    margin-bottom: 1rem;
  }
}

/* Large desktop & 2K/4K displays */
@media (min-width: 1600px) {
  .page-shell {
    max-width: 1440px;
  }

  .hero-content {
    max-width: 720px;
  }

  .headline {
    font-size: 5.5rem;
  }

  .subheadline {
    font-size: 1.25rem;
  }

  .waitlist-form,
  .waitlist-success {
    max-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
