:root {
  --color-bg: #201031;
  --color-text: #fff;
  --color-muted: #ded5eb;
  --color-accent: #ecdfff;
  --color-error: #ffd2dc;
  --glass: rgba(255, 255, 255, .075);
  --glass-border: rgba(255, 255, 255, .19);
  --space: clamp(1rem, 2.5vw, 2rem);
  --entrance-duration: .75s;
  --entrance-step: .1s;
  /* Background image path: replace this URL with your own local asset. */
  --background-image: url("https://images.unsplash.com/photo-1470770841072-f978cf4d019e?auto=format&fit=crop&w=2400&q=85");
}

* { box-sizing: border-box; }
html { background: var(--color-bg); }
body {
  margin: 0;
  color: var(--color-text);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Gradient fallback remains if the image cannot load. */
.backdrop, .overlay, .ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.backdrop {
  background-image: var(--background-image), linear-gradient(135deg, #463262, #172938);
  background-position: center;
  background-size: cover;
  animation: background-in 1.2s ease-out both;
}
.overlay {
  background: linear-gradient(125deg, rgba(29, 12, 51, .93), rgba(83, 33, 125, .79) 50%, rgba(27, 15, 49, .91));
  animation: background-in 1.1s ease-out both;
}
.ambient {
  inset: -12%;
  background: radial-gradient(ellipse at 65% 35%, rgba(172, 94, 245, .18), transparent 52%);
  animation: gradient-drift 20s ease-in-out infinite alternate;
}
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.75rem) clamp(1.25rem, 5vw, 5rem);
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .22em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--glass-border);
  border-radius: .6rem;
  background: var(--glass);
  letter-spacing: 0;
  font-size: 1rem;
}
.hero {
  width: 100%;
  max-width: 48rem;
  margin: auto;
  padding-block: clamp(2rem, 4vh, 3rem);
  text-align: center;
}
p, h1 { margin: 0; }
.greeting {
  color: var(--color-accent);
  font-size: clamp(.9rem, 1.5vw, 1rem);
  margin-bottom: 1.25rem;
}
.eyebrow {
  font-size: clamp(.62rem, 1.1vw, .73rem);
  letter-spacing: .24em;
  font-weight: 650;
  color: var(--color-muted);
  margin-bottom: .85rem;
}
h1 {
  font-size: clamp(2.25rem, 5.4vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 600;
  text-wrap: balance;
}
.description {
  max-width: 33rem;
  margin: 1.25rem auto 0;
  color: var(--color-muted);
  font-size: clamp(.95rem, 1.65vw, 1.1rem);
  line-height: 1.7;
}
.countdown-section { margin-top: var(--space); }
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.5rem, 1.5vw, .9rem);
  max-width: 29rem;
  margin-inline: auto;
}
.timer-card, .newsletter, .launch-message {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
}
.timer-card { padding: clamp(.75rem, 2vw, 1.2rem) .35rem; }
.number {
  display: block;
  font-size: clamp(1.55rem, 3.7vw, 2.7rem);
  line-height: 1.2;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.unit {
  display: block;
  margin-top: .4rem;
  font-size: .65rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.launch-message { padding: 1.5rem; font-size: 1.25rem; }
.signup { max-width: 32rem; margin: var(--space) auto 0; }
.newsletter { display: flex; gap: .5rem; padding: .45rem; }
input, button { font: inherit; border: 0; border-radius: .65rem; min-height: 3rem; }
input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: .75rem 1rem;
  background: transparent;
  color: var(--color-text);
  font-size: .9rem;
}
input::placeholder { color: var(--color-muted); opacity: 1; }
input[aria-invalid="true"] { outline: 2px solid var(--color-error); outline-offset: -2px; }
button {
  padding: .75rem 1.25rem;
  background: var(--color-accent);
  color: #321548;
  font-weight: 650;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .2s;
}
button span { margin-left: .65rem; }
button:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
button:disabled { opacity: .7; cursor: wait; }
:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.feedback, .small-print { margin-top: .8rem; color: var(--color-muted); font-size: .75rem; }
.feedback[data-state="error"] { color: var(--color-error); }
footer { text-align: center; color: var(--color-muted); font-size: .7rem; letter-spacing: .02em; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }

/* CSS-only entrances keep content visible even when JavaScript fails. */
.entrance { animation: rise-in var(--entrance-duration) ease-out both; }
.greeting { animation-delay: calc(var(--entrance-step) * 1); }
.eyebrow { animation-delay: calc(var(--entrance-step) * 2); }
h1 { animation-delay: calc(var(--entrance-step) * 3); }
.description { animation-delay: calc(var(--entrance-step) * 4); }
.countdown-section { animation-delay: calc(var(--entrance-step) * 5); }
.signup { animation-delay: calc(var(--entrance-step) * 6); }
@keyframes background-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gradient-drift { from { transform: translate3d(-3%, -2%, 0); } to { transform: translate3d(3%, 2%, 0); } }

@media (max-width: 480px) {
  .newsletter { flex-direction: column; }
  button { width: 100%; }
  .hero { padding-block: 2rem; }
  .unit { font-size: .6rem; letter-spacing: .06em; }
}
@media (max-width: 320px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Natural page height allows scrolling on short and landscape screens. */
@media (max-height: 740px) and (min-width: 481px) {
  .page { padding-block: 1rem; }
  .hero { padding-block: 1.5rem; }
  h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
  .greeting { margin-bottom: .75rem; }
  .countdown-section, .signup { margin-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
