/* ============================================================
   Hasani Pay — coming-soon teaser
   Concept: "Threshold / Dawn" — a deep nocturne that glows
   faintly from below, the held breath before a reveal.
   ============================================================ */

:root {
  /* Surface */
  --night:      #0B0A12;   /* base background (plum-black) */
  --night-2:    #100E1A;   /* lifted plum for depth        */
  --edge:       #050409;   /* vignette edge                */

  /* Ink */
  --pearl:      #F5F2F8;   /* primary text + wordmark      */
  --muted:      #A39DB8;   /* secondary text               */
  --muted-dim:  rgba(245, 242, 248, 0.46); /* footer / placeholder */

  /* Accent + dawn bloom */
  --champagne:   #E7C9A0;
  --champagne-2: #F1DBBC;
  --bloom-violet: 110, 87, 200;   /* as RGB triplets for rgba() */
  --bloom-rose:   199, 92, 142;
  --bloom-amber:  224, 160, 99;
  --rose-soft:   #E29AB6;         /* gentle error tone, on-palette */

  /* Lines */
  --line:       rgba(245, 242, 248, 0.12);
  --line-soft:  rgba(245, 242, 248, 0.07);

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--pearl);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ============================================================
   Atmosphere — breathing dawn bloom, vignette, film grain
   ============================================================ */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(140% 120% at 50% 8%, var(--night-2) 0%, var(--night) 42%, var(--edge) 100%);
}

/* Soft light rising from below the wordmark, slowly breathing. */
.bloom {
  position: absolute;
  left: 50%;
  bottom: -34%;
  width: 130vmax;
  height: 95vmax;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side,
      rgba(var(--bloom-violet), 0.30) 0%,
      rgba(var(--bloom-rose), 0.17) 42%,
      rgba(var(--bloom-amber), 0.08) 64%,
      transparent 76%);
  filter: blur(28px);
  animation: breathe 15s var(--ease) infinite;
  will-change: transform, opacity;
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(125% 105% at 50% 38%, transparent 38%, rgba(5, 4, 9, 0.55) 100%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes breathe {
  0%, 100% { opacity: 0.82; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) scale(1.06); }
}

/* ============================================================
   Stage — centered single-screen content
   ============================================================ */
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(1.1rem, 2.4vw, 1.6rem);
  padding: 3rem 1.5rem 1.5rem;
  width: 100%;
  max-width: 41rem;
  margin: 0 auto;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 0.34em; /* optical balance for tracking */
  position: relative;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.7rem;
  height: 1px;
  margin-right: 0.85em;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, var(--champagne));
  opacity: 0.7;
}
.eyebrow::after {
  content: "";
  display: inline-block;
  width: 1.7rem;
  height: 1px;
  margin-left: 0.85em;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--champagne), transparent);
  opacity: 0.7;
}

/* ---------- Wordmark (hero) ---------- */
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.7rem, 9vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  color: var(--pearl); /* fallback if background-clip unsupported */
}

/* Foil light-sweep: bright band travels across the letters once. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark {
    background-image: linear-gradient(100deg,
      var(--pearl) 0%, var(--pearl) 38%,
      #ffffff 47%, var(--champagne-2) 50%, #ffffff 53%,
      var(--pearl) 62%, var(--pearl) 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

/* ---------- Headline + subline ---------- */
.headline {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 3.4vw, 1.95rem);
  line-height: 1.25;
  color: var(--pearl);
}

.subline {
  margin: 0 auto;
  max-width: 32rem;
  font-size: clamp(0.96rem, 1.4vw, 1.06rem);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: balance;
}

/* ============================================================
   Notify form
   ============================================================ */
.notify {
  width: 100%;
  max-width: 30rem;
  margin: clamp(0.4rem, 1.4vw, 0.9rem) auto 0;
}

.field {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
}

#email {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.95rem 1.15rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--pearl);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
#email::placeholder { color: var(--muted-dim); }
#email:hover { border-color: rgba(245, 242, 248, 0.22); }
#email:focus {
  outline: none;
  border-color: var(--champagne);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(231, 201, 160, 0.16);
}

.btn {
  flex: 0 0 auto;
  padding: 0.95rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a1320;
  background: linear-gradient(135deg, var(--champagne-2), var(--champagne));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -12px rgba(231, 201, 160, 0.55);
  filter: brightness(1.04);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 2px solid var(--champagne);
  outline-offset: 3px;
}
.btn[disabled] {
  cursor: default;
  filter: saturate(0.6) brightness(0.92);
  transform: none;
  box-shadow: none;
}

/* Status line (validation + network errors) */
.status {
  min-height: 1.25rem;
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--muted);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.status.is-visible { opacity: 1; transform: none; }
.status.is-error { color: var(--rose-soft); }

/* ---------- Success state ---------- */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 30rem;
  margin: clamp(0.4rem, 1.4vw, 0.9rem) auto 0;
}
.seal {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  margin-bottom: 0.35rem;
  color: var(--champagne);
  border: 1px solid rgba(231, 201, 160, 0.4);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(231, 201, 160, 0.14), transparent);
}
.seal-check {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw 0.6s var(--ease) 0.1s forwards;
}
.success-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 500;
  color: var(--pearl);
}
.success-sub {
  margin: 0;
  font-size: 0.96rem;
  color: var(--muted);
}

@keyframes draw { to { stroke-dashoffset: 0; } }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  text-align: center;
}
.footer p {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dim);
}

/* ============================================================
   Reveal choreography (load-in)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.9s var(--ease) forwards;
}
.d0 { animation-delay: 0.05s; }
.d1 { animation-delay: 0.18s; }
.d2 { animation-delay: 0.34s; }
.d3 { animation-delay: 0.48s; }
.d4 { animation-delay: 0.62s; }
.d5 { animation-delay: 0.78s; }

/* Wordmark rises AND catches the foil sweep. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark.reveal {
    animation: rise 0.9s var(--ease) 0.18s forwards,
               foil 2.4s var(--ease) 1s forwards;
  }
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes foil {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

/* ============================================================
   Motion & responsive
   ============================================================ */
@media (max-width: 30rem) {
  .field { flex-direction: column; }
  .btn { width: 100%; }
  #email { flex-basis: auto; }
  .eyebrow::before,
  .eyebrow::after { width: 1.2rem; }
}

/* Taller breathing room on short landscape screens */
@media (max-height: 36rem) {
  .stage { gap: 0.8rem; padding-top: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .wordmark.reveal,
  .bloom,
  .seal-check {
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .seal-check { stroke-dashoffset: 0; }
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .wordmark {
      background-position: 0 0;
    }
  }
}
