@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

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

:root {
  --pine: #0e1b14;
  --night: #050b08;
  --snow: #f4f7f2;
  --leaf: #a8c46b;
  --leaf-soft: #c9db8f;
  --err: #e8b06b;
}

html, body { height: 100%; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--night);
  color: var(--snow);
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 100svh;
}

#sky {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(140% 90% at 50% 115%, rgba(46, 74, 51, 0.55), transparent 60%),
    linear-gradient(to bottom, #030706 0%, #071009 45%, #0e1b14 78%, #14261c 100%);
  transition: opacity 1.6s ease;
}

#dawn {
  position: fixed; inset: 0; z-index: 1; opacity: 0; pointer-events: none;
  background:
    radial-gradient(130% 85% at 50% 118%, rgba(255, 198, 128, 0.95) 0%, rgba(240, 150, 96, 0.5) 34%, rgba(156, 195, 222, 0.18) 62%, transparent 78%);
  transition: opacity 1.5s cubic-bezier(0.33, 0, 0.2, 1);
}

#flies { position: fixed; inset: 0; z-index: 2; pointer-events: none; }

#mist {
  position: fixed; inset: 0; z-index: 4; opacity: 0; pointer-events: none;
  background: linear-gradient(to top, #fdf6e8, #eef4ec);
  transition: opacity 0.9s ease 0.55s;
}

.card {
  position: relative; z-index: 3;
  width: min(90vw, 420px);
  padding: 3.2rem 2.4rem 2.6rem;
  text-align: center;
  border: 1px solid rgba(244, 247, 242, 0.1);
  border-radius: 20px;
  background: rgba(8, 15, 11, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transition: opacity 1.1s ease, transform 1.1s ease, filter 1.1s ease;
}

.mono {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 560;
  font-size: 2.1rem;
  color: var(--leaf-soft);
  margin-bottom: 1.4rem;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(244, 247, 242, 0.55);
  margin-bottom: 0.65rem;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 430;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  letter-spacing: 0.01em;
  margin-bottom: 0.9rem;
}

.lede {
  font-size: 0.98rem;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(244, 247, 242, 0.78);
  margin-bottom: 1.9rem;
}

form { display: grid; gap: 0.8rem; }

input {
  font: inherit;
  font-size: 1.05rem;
  text-align: center;
  color: var(--snow);
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(244, 247, 242, 0.18);
  background: rgba(244, 247, 242, 0.06);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
input::placeholder { color: rgba(244, 247, 242, 0.35); letter-spacing: 0.06em; }
input:focus {
  border-color: rgba(201, 219, 143, 0.65);
  box-shadow: 0 0 0 4px rgba(168, 196, 107, 0.14), 0 0 30px rgba(168, 196, 107, 0.12);
}

button {
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #101c14;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--leaf-soft), var(--leaf));
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.2s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(168, 196, 107, 0.25); }
button:active { transform: translateY(0) scale(0.99); }
button:disabled { opacity: 0.55; cursor: default; transform: none; }

.err {
  min-height: 1.4em;
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: var(--err);
}

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

.shake { animation: shake 0.5s ease; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

body.success #dawn { opacity: 1; }
body.success #sky { opacity: 0.35; }
body.success #mist { opacity: 1; }
body.success .card {
  opacity: 0;
  transform: translateY(-26px) scale(0.985);
  filter: blur(6px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #sky, #dawn, #mist, .card, button { transition-duration: 0.2s !important; transition-delay: 0s !important; }
  .shake { animation: none; }
}
