/* ============================================================
   MIRAFYT — Coming Soon  ·  styles.css
   Brand: Midnight Violet #1A0947 · Mirror Rose #E8347A · White
   Layout, typography, and the animated no-WebGL fallback.
   (Launch date + waitlist endpoint live in main.js → CONFIG.)
   ============================================================ */

:root {
  --violet: #1A0947;
  --rose: #E8347A;
  --bg: #0B0224;          /* deep violet page background */
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.60);
  --faint: rgba(255, 255, 255, 0.38);
  --line: rgba(255, 255, 255, 0.14);
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;          /* single screen — no scroll */
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---- WebGL background canvas ---- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* CSS fallback used when WebGL is unavailable */
body.no-webgl #bg { display: none; }
body.no-webgl {
  background:
    radial-gradient(1200px 800px at 20% 15%, rgba(232, 52, 122, 0.28), transparent 60%),
    radial-gradient(1000px 900px at 85% 85%, rgba(58, 20, 112, 0.55), transparent 60%),
    linear-gradient(160deg, #12042e 0%, #0B0224 55%, #16063a 100%);
  background-size: 200% 200%, 200% 200%, 100% 100%;
  animation: driftBg 26s ease-in-out infinite alternate;
}
@keyframes driftBg {
  from { background-position: 0% 0%, 100% 100%, 0 0; }
  to   { background-position: 100% 60%, 0% 40%, 0 0; }
}

/* ---- Foreground layout ---- */
.overlay {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(0.75rem, 2.2vh, 1.75rem) clamp(1.5rem, 4vw, 3rem);
  /* soft scrim to keep text crisp over the animation */
  background: radial-gradient(ellipse 80% 60% at 50% 45%, rgba(11, 2, 36, 0.45), transparent 75%);
}

.stack { display: flex; flex-direction: column; align-items: center; }

.eyebrow {
  font-size: clamp(0.62rem, 1.6vw, 0.72rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: clamp(0.8rem, 2.5vh, 1.7rem);
  padding-left: 0.42em; /* optical: balance the trailing tracking */
  animation: rise 0.9s 0.05s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---- Logo ---- */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rise 1s 0.1s both cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* the M mark used inline as the leading "M" of the wordmark */
.wordmark .mark {
  height: 0.78em;
  width: auto;
  overflow: visible;
  vertical-align: -0.06em;   /* sit the mark on the text baseline */
  margin-right: 0.02em;
}
.logo .stroke {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* draw-on animation */
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: draw 1.2s 0.35s forwards cubic-bezier(0.65, 0, 0.35, 1);
}
.logo .stroke.rose { animation-delay: 0.55s; }

.wordmark {
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 1;
}
.wordmark .ira { color: var(--ink); }
.wordmark .fyt  { color: var(--rose); }

.tagline {
  margin-top: clamp(0.7rem, 2vh, 1.5rem);
  font-size: clamp(0.72rem, 2vw, 0.92rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  animation: rise 1s 0.85s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

.subline {
  margin-top: clamp(0.9rem, 2.2vh, 1.7rem);
  max-width: 34ch;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  line-height: 1.55;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  animation: rise 1s 1s both cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---- Countdown ---- */
.countdown-wrap {
  margin-top: clamp(1rem, 3vh, 2.4rem);
  animation: rise 1s 1.15s both cubic-bezier(0.2, 0.7, 0.2, 1);
}
.countdown-label {
  font-size: clamp(0.6rem, 1.5vw, 0.68rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: clamp(0.9rem, 2.5vw, 1.2rem);
}
.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 1.6rem);
}
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(48px, 14vw, 78px);
}
.unit .num {
  font-weight: 900;
  font-size: clamp(1.9rem, 8vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.unit .lbl {
  margin-top: 0.55rem;
  font-size: clamp(0.55rem, 1.5vw, 0.66rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.sep {
  font-weight: 300;
  font-size: clamp(1.5rem, 6vw, 2.6rem);
  line-height: 1.1;
  color: var(--rose);
  opacity: 0.55;
  align-self: flex-start;
  margin-top: 0.05em;
}

/* live state (after launch) */
.live-msg {
  font-weight: 900;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  letter-spacing: -0.02em;
}
.live-msg .accent { color: var(--rose); }

/* ---- Waitlist form ---- */
.waitlist {
  margin-top: clamp(1rem, 3vh, 2.4rem);
  width: min(440px, 92vw);
  animation: rise 1s 1.3s both cubic-bezier(0.2, 0.7, 0.2, 1);
}
.waitlist h2 {
  font-size: clamp(0.62rem, 1.6vw, 0.72rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.form-row {
  display: flex;
  gap: 0.55rem;
}
.waitlist input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.waitlist input[type="email"]::placeholder { color: var(--faint); }
.waitlist input[type="email"]:focus {
  border-color: var(--rose);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 4px rgba(232, 52, 122, 0.18);
}
.waitlist button {
  flex: 0 0 auto;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--rose);
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  box-shadow: 0 8px 24px rgba(232, 52, 122, 0.32);
}
.waitlist button:hover { background: #f2478a; transform: translateY(-1px); }
.waitlist button:active { transform: translateY(0); }
.waitlist button:disabled { opacity: 0.6; cursor: default; transform: none; }

.form-note {
  margin-top: 0.85rem;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.form-note.ok  { color: #8be0a8; }
.form-note.err { color: #ff9db8; }

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  padding: clamp(1rem, 3vw, 1.6rem) 1rem calc(clamp(1rem, 3vw, 1.6rem) + env(safe-area-inset-bottom));
  animation: rise 1s 1.45s both ease-out;
}
.footer-msg {
  font-size: clamp(0.6rem, 1.5vw, 0.7rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-copy {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ---- Animations ---- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 420px) {
  .sep { display: none; }
  .countdown { gap: 0.35rem; }
  .form-row { flex-direction: column; }
  .waitlist button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .logo .stroke { stroke-dashoffset: 0; }
}
