/* ============================================================
   POSTAVA — Waitlist landing
   Minimal, Apple-inspired. Warm off-white, dark ink accent,
   green / red posture cues, soft glass, calm motion.
   ============================================================ */

:root {
  /* Brand palette (exact) */
  --white: #FAFAFA;
  --ink: #1A1A1E;
  --red: #FF4C4C;
  --green: #6ADF76;

  /* Derived neutrals */
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #1A1A1E;
  --muted: #6E6E76;
  --muted-2: #9A9AA2;
  --line: rgba(26, 26, 30, 0.10);
  --line-soft: rgba(26, 26, 30, 0.06);

  --radius-s: 14px;
  --radius-m: 20px;
  --radius-l: 28px;

  --shadow-soft: 0 8px 30px rgba(26, 26, 30, 0.07);
  --shadow-deep: 0 30px 80px rgba(26, 26, 30, 0.18);
  --shadow-btn: 0 10px 26px rgba(26, 26, 30, 0.22);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(106, 223, 118, 0.32); }

/* ============ Ambient background ============ */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}
.glow-green {
  width: 620px; height: 620px;
  top: -200px; right: -120px;
  background: radial-gradient(circle, rgba(106, 223, 118, 0.20), transparent 70%);
  animation: drift 24s var(--ease) infinite alternate;
}
.glow-ink {
  width: 560px; height: 560px;
  bottom: -260px; left: -160px;
  background: radial-gradient(circle, rgba(26, 26, 30, 0.06), transparent 70%);
  animation: drift 30s var(--ease) -10s infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, 50px, 0) scale(1.12); }
}

/* ============ Top bar ============ */

.topbar {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(26, 26, 30, 0.16);
}
.brand-word {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.45;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.5; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}

/* ============ Hero ============ */

.hero {
  flex: 1;
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 40px 0 60px;
}
.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 56px;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(118deg, var(--ink) 28%, #62626b 78%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  margin-top: 22px;
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 32em;
}

/* ============ Waitlist form ============ */

.waitlist { margin-top: 36px; max-width: 480px; }

.field-row {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 7px 7px 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field-row:focus-within {
  border-color: rgba(26, 26, 30, 0.35);
  box-shadow: 0 0 0 4px rgba(26, 26, 30, 0.06), var(--shadow-soft);
}
.field-row.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 76, 76, 0.12);
}

.field-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 8px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
}
.field-input::placeholder { color: var(--muted-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 13px 22px;
  position: relative;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.25s ease;
}
.btn-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-dark:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(26, 26, 30, 0.28);
}
.btn-dark:active { transform: scale(0.98); }
.btn-arrow { width: 15px; transition: transform 0.3s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn-spinner {
  display: none;
  position: absolute;
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading .btn-label,
.btn.is-loading .btn-arrow { opacity: 0; }
.btn.is-loading .btn-spinner { display: block; }
.btn:disabled { cursor: default; }

.form-msg {
  min-height: 18px;
  margin-top: 12px;
  padding-left: 6px;
  font-size: 13.5px;
  color: var(--red);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.form-msg.show { opacity: 1; }
.form-msg.ok { color: #1f9d3a; }

/* success state */
.waitlist-done {
  margin-top: 36px;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(106, 223, 118, 0.10);
  border: 1px solid rgba(106, 223, 118, 0.4);
  border-radius: var(--radius-m);
  padding: 18px 22px;
  animation: doneIn 0.5s var(--ease) both;
}
.waitlist-done[hidden] { display: none; }
@keyframes doneIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.done-mark { flex: 0 0 auto; width: 42px; height: 42px; }
.done-mark svg { width: 100%; height: 100%; }
.done-circle {
  stroke: var(--green); stroke-width: 3;
  stroke-dasharray: 151; stroke-dashoffset: 151;
  animation: draw 0.6s var(--ease) 0.05s forwards;
}
.done-check {
  stroke: var(--green); stroke-width: 4;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 36; stroke-dashoffset: 36;
  animation: draw 0.4s var(--ease) 0.5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.done-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }

.hero-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted-2);
}

/* ============ Device ============ */

.hero-device {
  display: flex;
  justify-content: center;
}
.device {
  position: relative;
  display: flex;
  justify-content: center;
}
.device-glow {
  position: absolute;
  inset: 6% 0;
  background: radial-gradient(closest-side, rgba(106, 223, 118, 0.22), transparent 72%);
  filter: blur(46px);
  z-index: 0;
  animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { opacity: 0.7; transform: scale(0.95); }
  to   { opacity: 1;   transform: scale(1.06); }
}
.device-inner {
  position: relative;
  z-index: 1;
  width: min(320px, 76vw);
  aspect-ratio: 450 / 920;
  filter: drop-shadow(0 30px 60px rgba(26, 26, 30, 0.28));
  animation: floaty 7s ease-in-out infinite alternate;
}
@keyframes floaty {
  from { transform: translateY(0) rotate(-0.5deg); }
  to   { transform: translateY(-14px) rotate(0.5deg); }
}
/* screenshot sits in the screen cutout (bezel: 24px sides, 23px top/bottom) */
.device-screen {
  position: absolute;
  top: 2.5%;
  left: 5.333%;
  width: 89.333%;
  height: 95%;
  object-fit: cover;
  border-radius: 13% / 6.2%;
}
.device-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.float-chip {
  position: absolute;
  z-index: 2;
  top: 16%;
  left: -6%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  animation: chipFloat 5.5s ease-in-out infinite alternate;
}
@keyframes chipFloat {
  from { transform: translateY(-7px); }
  to   { transform: translateY(9px); }
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-good { background: var(--green); }

/* ============ Footer ============ */

.footer {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted-2);
  border-top: 1px solid var(--line-soft);
}
.footer-word { font-weight: 800; letter-spacing: 0.2em; color: var(--muted); }
.footer-sep { opacity: 0.5; }
.footer-copy { margin-left: auto; font-weight: 600; }

/* ============ Reveal ============ */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: revealIn 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes revealIn { to { opacity: 1; transform: none; } }

/* ============ Responsive ============ */

@media (max-width: 920px) {
  .hero { padding-top: 12px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .hero-copy { display: flex; flex-direction: column; align-items: center; order: 1; }
  .hero-device { order: 2; }
  .lead { margin-inline: auto; }
  .waitlist, .waitlist-done { margin-inline: auto; width: 100%; }
  .float-chip { left: 2%; }
}

@media (max-width: 540px) {
  .topbar { padding-top: 20px; }
  .status-pill { display: none; }
  .field-row { flex-direction: column; border-radius: var(--radius-m); padding: 8px; }
  .field-input { padding: 12px 14px; text-align: center; }
  .btn-dark { width: 100%; padding: 14px; }
  .footer { justify-content: center; text-align: center; }
  .footer-copy { margin-left: 0; width: 100%; }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
