/* ==========================================================================
   HealthKona — single-screen teaser
   Palette: night-forest ink, cream, emerald glow, saffron accent
   ========================================================================== */

:root {
  --ink: #06100c;
  --line: rgba(233, 226, 208, 0.12);
  --line-2: rgba(233, 226, 208, 0.22);
  --cream: #f3ecdf;
  --cream-dim: rgba(243, 236, 223, 0.68);
  --cream-faint: rgba(243, 236, 223, 0.42);
  --emerald: #3fbf8c;
  --saffron: #e9b45c;
  --saffron-hot: #f5c878;
  --danger: #ff9a8a;

  --f-display: 'Bodoni Moda', 'Didot', Georgia, serif;
  --f-body: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 22px;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* one screen, no scrolling */
}

::selection { background: var(--saffron); color: var(--ink); }
a { color: inherit; }
em { font-style: italic; }

/* ---------- Atmosphere layers ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
#scene.ready { opacity: 1; }

.fallback-orb {
  display: none;
  position: fixed;
  z-index: 0;
  width: min(34vh, 60vw);
  aspect-ratio: 1;
  left: 50%;
  top: 30vh;
  translate: -50% -50%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(246, 231, 200, 0.9), transparent 22%),
    radial-gradient(circle at 50% 50%, #3fbf8c 0%, #0f5a40 45%, transparent 70%);
  filter: blur(2px);
  opacity: 0.75;
  animation: breathe 8s ease-in-out infinite;
}
.no-webgl .fallback-orb { display: block; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: 0.9; } }

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    /* darker band at the bottom so the headline and form always read cleanly */
    linear-gradient(to top, rgba(6, 16, 12, 0.92) 0%, rgba(6, 16, 12, 0.7) 30%, rgba(6, 16, 12, 0) 52%),
    radial-gradient(140% 100% at 50% 30%, transparent 45%, rgba(6, 16, 12, 0.85) 100%);
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- The one screen ---------- */

.screen {
  position: relative;
  z-index: 2;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 var(--pad);
  /* safety net for very short phones only — normal screens never scroll */
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--f-display);
  font-size: 24px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.brand em { color: var(--saffron); font-weight: 400; }
.brand-mark { width: 34px; height: 34px; color: var(--cream); }
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- Hero ---------- */

/* Orb owns the open space at the top; copy + form sit together at the bottom. */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(22px, 3.2vh, 36px);
  min-height: 0;
  padding: 0 0 clamp(16px, 3vh, 34px);
  text-align: center;
}
.hero-copy, .card-wrap { min-width: 0; width: 100%; }
.hero-copy { max-width: 1240px; }

.eyebrow,
.mono {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--saffron);
  margin: 0 0 22px;
}

.eyebrow { margin-bottom: 16px; }

.display {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(48px, min(5.9vw, 11vh), 108px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  color: var(--cream);
  text-shadow: 0 2px 30px rgba(6, 16, 12, 0.9);
}
.display .line { display: inline; }
.display em { font-weight: 500; color: var(--saffron); }

.lede {
  font-size: clamp(16px, 1.3vw, 19px);
  color: rgba(243, 236, 223, 0.8);
  max-width: 36em;
  margin: 0 auto;
  font-weight: 350;
}

/* ---------- Form card ---------- */

.card-wrap { position: relative; }

.card {
  position: relative;
  padding: 30px 30px 24px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(30, 58, 48, 0.55), rgba(8, 20, 15, 0.55));
  border: 1px solid var(--line-2);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(0, 0, 0, 0.7);
}

.card h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.card h2 em { color: var(--saffron); }
.card-sub { color: var(--cream-dim); font-size: 15px; margin: 0 0 8px; }

.field { display: block; margin: 0 0 14px; text-align: left; }

/* Desktop: the form is one slim glass bar under the headline */
@media (min-width: 901px) {
  .display { white-space: nowrap; }
  .card-wrap { max-width: 1040px; }
  #waitlist-form.card { padding: 10px; border-radius: 20px; }
  .card-title { display: none; }
  .row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr auto;
    gap: 10px;
    align-items: start;
  }
  .row .field { margin: 0; position: relative; }
  .row .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .row .err { position: absolute; left: 4px; top: calc(100% + 4px); white-space: nowrap; }
  .row .btn { margin: 0; width: auto; white-space: nowrap; padding: 14px 26px; height: 100%; }
  #waitlist-form .fine { margin-top: 12px; }
  #waitlist-form:has(.err:not(:empty)) .fine { margin-top: 30px; }
  .card-wrap .success { max-width: 560px; margin: 0 auto; padding: 22px 28px 24px; }
  .card-wrap .success .tick { display: none; }
  .card-wrap .success .mono { margin-bottom: 6px; }
  .card-wrap .success h2 { font-size: 30px; margin-bottom: 6px; }
  .card-wrap .success .btn-ghost { margin-top: 14px; padding: 12px 20px; }
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--cream-dim);
  margin: 0 0 7px;
}

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--cream);
  background: rgba(6, 16, 12, 0.55);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 12px 15px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field input::placeholder { color: rgba(243, 236, 223, 0.3); }
.field input:focus,
.field select:focus {
  border-color: var(--saffron);
  background: rgba(6, 16, 12, 0.75);
  box-shadow: 0 0 0 4px rgba(233, 180, 92, 0.14);
}

.phone { display: flex; position: relative; }
.phone .cc {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  padding: 0 12px 0 15px;
  font-family: var(--f-mono);
  font-size: 14px;
  color: var(--saffron);
  border-right: 1px solid var(--line);
  pointer-events: none;
}
.field .phone input { padding-left: 64px; letter-spacing: 0.04em; }

.select { position: relative; display: block; }
.select::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--saffron);
  border-bottom: 1.5px solid var(--saffron);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  color: rgba(243, 236, 223, 0.4);
}
.field select.chosen { color: var(--cream); }
.field select option { color: #111; background: #f3ecdf; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.err { display: block; font-size: 12.5px; color: var(--danger); margin-top: 6px; }
.err:empty { display: none; }
.field.invalid input,
.field.invalid select { border-color: var(--danger); }

.fine { margin: 12px 0 2px; font-size: 12px; line-height: 1.45; color: var(--cream-faint); text-align: center; }
.form-error { margin: 10px 0 0; font-size: 14px; color: var(--danger); text-align: center; }
.form-error:empty { display: none; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
  padding: 16px 24px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  background: var(--saffron);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.btn-arrow { transition: transform 0.35s var(--ease); }

.btn-spin {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(6, 16, 12, 0.25);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
.btn.loading { pointer-events: none; opacity: 0.85; }
.btn.loading .btn-arrow { display: none; }
.btn.loading .btn-spin { display: inline-block; }

.btn-ghost {
  margin-top: 18px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--saffron); box-shadow: none; color: var(--saffron-hot); }

/* ---------- Success ---------- */

.success { text-align: center; padding: 40px 30px 30px; }
.success:focus { outline: none; }
.success .tick { width: 68px; height: 68px; color: var(--saffron); margin-bottom: 18px; }
.success:not([hidden]) { animation: rise 0.8s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

/* ---------- Footer ---------- */

.foot {
  padding: 0 0 18px;
  font-size: 13px;
  color: var(--cream-faint);
  text-align: center;
}

/* ---------- Intro reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .grain { animation: none; }
}

/* ---------- Short desktop screens (laptops) ---------- */

@media (min-width: 901px) and (max-height: 760px) {
  .eyebrow { margin-bottom: 10px; }
  .display { margin-bottom: 12px; }
  .field input, .field select { padding: 10px 14px; }
}

/* ---------- Mobile: orb on top, compact form below ---------- */

@media (max-width: 900px) {
  .hero { gap: 18px; padding: 0 0 14px; }
  .eyebrow { margin-bottom: 10px; font-size: 11px; }
  .display { font-size: clamp(40px, 12vw, 72px); margin-bottom: 10px; }
  .display .line { display: block; }
  .lede { font-size: 15px; max-width: 24em; }
  .card-wrap { max-width: 440px; }
  .fallback-orb { top: 18vh; width: 46vw; }
}

@media (max-width: 640px) {
  .brand { font-size: 21px; }
  .brand-mark { width: 30px; height: 30px; }
  .nav { padding-top: 16px; }
  .card { padding: 20px 18px 16px; }
  .card .mono { display: none; }
  .card h2 { font-size: 24px; margin-bottom: 14px; text-align: center; }
  .field { margin-bottom: 10px; }
  .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .field input, .field select { padding: 11px 14px; }
  .btn { padding: 14px 20px; }
  .fine { font-size: 11px; margin-top: 10px; }
  .foot { padding-bottom: 12px; font-size: 12px; }
  .success { padding: 28px 20px 22px; }
}

/* Short phones: drop the paragraph so everything still fits on one screen */
@media (max-width: 900px) and (max-height: 760px) {
  .lede { display: none; }
  .card-title { display: none; }
}
