:root {
  --forest: #10140d;
  --forest-deep: #0b0f09;
  --cream: #f2f1e8;
  --muted: rgba(242, 241, 232, 0.62);
  --field: rgba(243, 245, 237, 0.055);
  --field-border: rgba(243, 245, 237, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--forest);
  color: var(--cream);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.landing-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow-x: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 43%, rgba(57, 73, 40, 0.18), transparent 35%),
    linear-gradient(145deg, var(--forest) 0%, var(--forest-deep) 100%);
}

.landing-shell::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  opacity: 0.26;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.ambient-glow {
  position: absolute;
  top: 47%;
  left: 50%;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(183, 125, 40, 0.06) 0%,
    rgba(73, 88, 47, 0.045) 30%,
    transparent 69%
  );
  filter: blur(24px);
  pointer-events: none;
  transform: translate(-50%, -52%);
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(94vw, 860px);
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 52px;
  text-align: center;
  transform: translateY(-3vh);
}

.spark-stage {
  position: relative;
  width: clamp(150px, 20vw, 190px);
  height: clamp(150px, 20vw, 185px);
  margin: 0 auto clamp(14px, 2.5vh, 24px);
}

.spark-field {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.spark-field i {
  --x: 0px;
  --bend: 0px;
  --duration: 3.4s;
  --delay: 0s;
  --turn: 22deg;
  position: absolute;
  bottom: 39px;
  left: 50%;
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to top, #b8792f, #f1bf62 55%, #fff0b5);
  box-shadow:
    0 0 5px rgba(255, 215, 124, 0.88),
    0 0 12px rgba(213, 137, 45, 0.32);
  filter: blur(0.15px);
  opacity: 0;
  transform-origin: 50% 100%;
  animation: spark-rise var(--duration) cubic-bezier(0.2, 0.55, 0.3, 1)
    var(--delay) infinite;
}

.spark-field i:nth-child(1) { --x: -48px; --bend: -16px; --duration: 3.1s; --delay: -0.2s; --turn: -48deg; }
.spark-field i:nth-child(2) { --x: 38px; --bend: 9px; --duration: 3.8s; --delay: -1.1s; --turn: 36deg; width: 2px; height: 6px; }
.spark-field i:nth-child(3) { --x: -22px; --bend: 18px; --duration: 2.9s; --delay: -2.3s; --turn: 58deg; }
.spark-field i:nth-child(4) { --x: 62px; --bend: 23px; --duration: 4.2s; --delay: -0.7s; --turn: 72deg; width: 2px; height: 5px; }
.spark-field i:nth-child(5) { --x: -68px; --bend: -12px; --duration: 4s; --delay: -3.1s; --turn: -64deg; height: 6px; }
.spark-field i:nth-child(6) { --x: 18px; --bend: -12px; --duration: 3.35s; --delay: -1.75s; --turn: 42deg; }
.spark-field i:nth-child(7) { --x: -36px; --bend: 14px; --duration: 4.35s; --delay: -3.75s; --turn: -78deg; width: 2px; height: 5px; }
.spark-field i:nth-child(8) { --x: 52px; --bend: -18px; --duration: 3.2s; --delay: -2.6s; --turn: 54deg; }
.spark-field i:nth-child(9) { --x: -14px; --bend: -26px; --duration: 3.7s; --delay: -0.45s; --turn: -32deg; width: 2px; height: 5px; }
.spark-field i:nth-child(10) { --x: 72px; --bend: 12px; --duration: 4.45s; --delay: -2.05s; --turn: 92deg; width: 2px; height: 4px; }
.spark-field i:nth-child(11) { --x: -58px; --bend: 25px; --duration: 3.55s; --delay: -1.42s; --turn: -66deg; }
.spark-field i:nth-child(12) { --x: 29px; --bend: 17px; --duration: 4.1s; --delay: -3.45s; --turn: 48deg; width: 2px; height: 6px; }
.spark-field i:nth-child(13) { --x: -77px; --bend: -8px; --duration: 4.65s; --delay: -2.85s; --turn: -94deg; width: 2px; height: 4px; }
.spark-field i:nth-child(14) { --x: 10px; --bend: -21px; --duration: 3s; --delay: -0.95s; --turn: 24deg; }
.spark-field i:nth-child(15) { --x: 47px; --bend: 28px; --duration: 4.8s; --delay: -4.05s; --turn: 88deg; width: 2px; height: 4px; }
.spark-field i:nth-child(16) { --x: -31px; --bend: -20px; --duration: 3.9s; --delay: -2.15s; --turn: -54deg; height: 6px; }

.camp-glow {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 148px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse,
    rgba(205, 134, 44, 0.18),
    rgba(127, 86, 35, 0.05) 48%,
    transparent 75%
  );
  filter: blur(13px);
  transform: translateX(-50%);
  animation: glow-breathe 3.6s ease-in-out infinite;
}

.ember-line {
  position: absolute;
  bottom: 23px;
  left: 50%;
  z-index: 3;
  width: 64px;
  height: 5px;
  border-radius: 50%;
  background: rgba(221, 147, 53, 0.7);
  box-shadow:
    0 0 10px rgba(235, 165, 63, 0.65),
    0 0 23px rgba(210, 130, 40, 0.2);
  filter: blur(1px);
  transform: translateX(-50%);
  animation: ember-breathe 2.2s ease-in-out infinite alternate;
}

.ignition {
  position: absolute;
  bottom: 32px;
  left: 50%;
  z-index: 4;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff0b7;
  box-shadow:
    0 0 6px rgba(255, 231, 161, 0.95),
    0 0 18px rgba(219, 143, 46, 0.52);
  animation: ignition-pulse 3.4s ease-out infinite;
}

.hero-copy {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

h1 {
  width: max-content;
  max-width: none;
  margin: 0;
  color: var(--cream);
  font-size: clamp(0.8rem, 2.56vw, 2.56rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.06;
  white-space: nowrap;
}

.early-access-button,
.submit-button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: var(--cream);
  color: #11170e;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.early-access-button {
  margin-top: clamp(22px, 3.2vh, 30px);
  padding: 0 22px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.26);
}

.early-access-button:hover,
.submit-button:hover {
  background: #fbfbf4;
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.3),
    0 0 0 6px rgba(238, 239, 225, 0.07);
  transform: translateY(-2px);
}

.early-access-button:focus-visible,
.submit-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(245, 212, 135, 0.72);
  outline-offset: 4px;
}

.form-panel {
  display: grid;
  width: min(92vw, 420px);
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows 420ms cubic-bezier(0.22, 0.8, 0.22, 1), opacity 280ms ease;
}

.form-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}

.form-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.early-access-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(238, 242, 232, 0.11);
  border-radius: 24px;
  background: rgba(20, 27, 17, 0.84);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  text-align: left;
  backdrop-filter: blur(18px);
}

.early-access-form[hidden] {
  display: none;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  color: rgba(242, 241, 232, 0.82);
  font-size: 0.78rem;
  font-weight: 600;
}

input,
.phone-control {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--field-border);
  border-radius: 14px;
  background: var(--field);
  color: var(--cream);
}

input {
  padding: 0 14px;
}

input::placeholder {
  color: rgba(242, 241, 232, 0.34);
}

.country-combobox {
  position: relative;
  z-index: 20;
}

.country-input-shell {
  position: relative;
}

.country-input-shell input {
  padding-right: 52px;
}

.country-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(242, 241, 232, 0.66);
  cursor: pointer;
}

.country-toggle::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.country-toggle[aria-expanded="true"]::before {
  transform: translateY(2px) rotate(225deg);
}

.country-toggle:hover {
  background: rgba(242, 241, 232, 0.06);
}

.country-toggle:focus-visible {
  outline: 2px solid rgba(245, 212, 135, 0.72);
  outline-offset: 0;
}

.country-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 224px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(238, 242, 232, 0.16);
  border-radius: 15px;
  background: #171f14;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  overscroll-behavior: contain;
}

.country-options[hidden] {
  display: none;
}

.country-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  text-align: left;
}

.country-option:hover,
.country-option:focus-visible,
.country-option.is-highlighted {
  outline: 0;
  background: rgba(242, 241, 232, 0.09);
}

.country-option-name {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-option-details {
  flex: 0 0 auto;
  color: rgba(242, 241, 232, 0.55);
  font-size: 0.76rem;
}

.country-empty {
  margin: 0;
  padding: 14px 10px;
  color: rgba(242, 241, 232, 0.5);
  font-size: 0.78rem;
  text-align: center;
}

.phone-control {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.phone-control:focus-within {
  border-color: rgba(245, 212, 135, 0.62);
}

.phone-control[data-disabled="true"] {
  opacity: 0.58;
}

.phone-prefix {
  display: grid;
  min-width: 64px;
  height: 28px;
  place-items: center;
  border-right: 1px solid rgba(242, 241, 232, 0.12);
  color: rgba(242, 241, 232, 0.82);
  font-size: 0.88rem;
  font-weight: 600;
}

.phone-control input {
  min-height: 46px;
  border: 0;
  background: transparent;
  outline: 0;
}

.field-hint,
.form-note {
  margin: 0;
  color: rgba(242, 241, 232, 0.43);
  font-size: 0.7rem;
  line-height: 1.45;
}

.submit-button {
  width: 100%;
  margin-top: 2px;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-note {
  text-align: center;
}

.form-success {
  margin-top: 26px;
  color: var(--cream);
  text-align: center;
}

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

.form-success p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-error {
  margin: -4px 0 0;
  color: #f4b6aa;
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.bot-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.flint-wordmark {
  display: block;
  width: clamp(52px, 5.5vw, 64px);
  height: auto;
  margin-top: 19px;
  opacity: 0.82;
  object-fit: contain;
  transition: margin-top 360ms ease;
}

.form-panel.is-open + .flint-wordmark {
  margin-top: 24px;
}

.brand-tagline {
  margin: 10px 0 0;
  color: rgba(242, 241, 232, 0.68);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.045em;
}

.thanks-shell {
  display: grid;
  width: min(90vw, 520px);
  min-height: 100vh;
  min-height: 100svh;
  margin: auto;
  place-content: center;
  text-align: center;
}

.thanks-logo {
  width: 78px;
  height: auto;
  margin: 0 auto 28px;
}

.thanks-shell h1 {
  width: auto;
  font-size: clamp(1.8rem, 5vw, 3rem);
  white-space: normal;
}

.thanks-shell p {
  margin: 16px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.back-link {
  color: var(--cream);
  font-size: 0.9rem;
  text-underline-offset: 5px;
}

@keyframes spark-rise {
  0% { opacity: 0; transform: translate3d(-50%, 0, 0) rotate(0) scale(0.25); }
  8% { opacity: 0.95; }
  42% { opacity: 0.82; transform: translate3d(calc(-50% + var(--bend)), -76px, 0) rotate(calc(var(--turn) * 0.45)) scale(0.76); }
  74% { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(calc(-50% + var(--x)), -185px, 0) rotate(var(--turn)) scale(0.08); }
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.94); }
  50% { opacity: 0.88; transform: translateX(-50%) scale(1.05); }
}

@keyframes ember-breathe {
  from { opacity: 0.48; transform: translateX(-50%) scaleX(0.9); }
  to { opacity: 0.92; transform: translateX(-50%) scaleX(1.07); }
}

@keyframes ignition-pulse {
  0%, 68%, 100% { opacity: 0; transform: translate(-50%, 0) scale(0.3); }
  74% { opacity: 1; transform: translate(-50%, -2px) scale(1.5); }
  88% { opacity: 0.35; transform: translate(-50%, -18px) scale(0.5); }
}

@media (max-width: 620px) {
  .hero {
    width: 100%;
    padding: 26px 18px 42px;
  }

  .spark-stage {
    width: 160px;
    height: 165px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: clamp(0.8rem, 3.76vw, 1.44rem);
  }

  .early-access-button {
    min-height: 44px;
    margin-top: 24px;
    padding: 0 20px;
  }

  .early-access-form {
    padding: 18px;
    border-radius: 20px;
  }

  .flint-wordmark {
    width: 56px;
    margin-top: 17px;
  }

  .brand-tagline {
    margin-top: 8px;
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spark-field i {
    animation-duration: 5.6s;
  }

  .form-panel {
    transition-duration: 1ms;
  }
}
