/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #87CEEB;
  --card-bg: #ffffff;
  --text: #111111;
  --text-muted: #6b7280;
  --accent: #111111;
  --accent-hover: #333333;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-card-top: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  font-family: var(--font);
  background: linear-gradient(180deg, #a8dff0 0%, #87CEEB 40%, #7ec8e3 70%, #6db8d4 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* SVG noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ── Clouds ───────────────────────────────────── */
.clouds {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 0;
  pointer-events: none;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  filter: blur(6px);
}

.cloud::before,
.cloud::after,
.cloud span {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  filter: blur(4px);
  display: block;
}

/* Cloud 1: Tall, compact puff — two bumps on top */
.cloud-1 {
  width: 140px;
  height: 140px;
  top: -50px;
  opacity: 0.8;
  animation: drift-1 50s linear infinite;
  animation-delay: -15s; /* start ~30% in, already on screen */
}
.cloud-1::before {
  width: 110px;
  height: 120px;
  top: -30px;
  left: -30px;
}
.cloud-1::after {
  width: 115px;
  height: 115px;
  top: -35px;
  left: 60px;
}
.cloud-1 span {
  width: 90px;
  height: 80px;
  top: 20px;
  left: -45px;
}

/* Cloud 2: Wide and flat — stretched out, low profile */
.cloud-2 {
  width: 240px;
  height: 90px;
  top: -30px;
  opacity: 0.55;
  animation: drift-2 65s linear infinite;
  animation-delay: -35s; /* start ~54% in, already on screen */
}
.cloud-2::before {
  width: 120px;
  height: 110px;
  top: -40px;
  left: 30px;
}
.cloud-2::after {
  width: 130px;
  height: 100px;
  top: -30px;
  left: 110px;
}
.cloud-2 span {
  width: 100px;
  height: 80px;
  top: -15px;
  left: -35px;
}

/* Cloud 3: Big and lumpy — large with 3 distinct bumps */
.cloud-3 {
  width: 170px;
  height: 170px;
  top: -60px;
  opacity: 0.7;
  animation: drift-3 58s linear infinite;
}
.cloud-3::before {
  width: 140px;
  height: 150px;
  top: -25px;
  left: -70px;
}
.cloud-3::after {
  width: 120px;
  height: 135px;
  top: -40px;
  left: 90px;
}
.cloud-3 span {
  width: 150px;
  height: 110px;
  top: 15px;
  left: -30px;
}

/* All clouds start fully off-screen so they drift in naturally */
@keyframes drift-1 {
  0%   { transform: translateX(calc(-100% - 200px)); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

@keyframes drift-2 {
  0%   { transform: translateX(calc(100vw + 200px)); }
  100% { transform: translateX(calc(-100% - 200px)); }
}

@keyframes drift-3 {
  0%   { transform: translateX(calc(-100% - 200px)); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

/* ── Birds (dynamic) ──────────────────────────── */
#bird-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.bird {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: none;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ── Hero ─────────────────────────────────────── */
.hero {
  text-align: center;
  width: 100%;
}

.hero-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

h1 em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  text-decoration: underline;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #533483 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Signup Form ──────────────────────────────── */
.signup-form {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-row input {
  width: 100%;
  padding: 22px 28px;
  font-size: 1.15rem;
  font-family: var(--font);
  border: none;
  border-radius: 50px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.25s;
}

.input-row input:focus {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

.input-row input::placeholder {
  color: #b0b8c4;
}

.input-row button {
  width: 100%;
  padding: 22px 28px;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font);
  background: linear-gradient(180deg, #333 0%, #111 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s;
  white-space: nowrap;
  position: relative;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.input-row button:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.input-row button:active {
  transform: scale(0.97);
}

.input-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-spinner[hidden] { display: none; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-message {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
  transition: opacity 0.3s;
}

.form-message.success { color: #16a34a; }
.form-message.error { color: #dc2626; }

/* ── Card Stack ───────────────────────────────── */
.cards-section {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
}

/* ── Footer ──────────────────────────────────── */
.site-footer {
  width: 100%;
  text-align: center;
  padding: 20px 16px 0;
  position: relative;
  z-index: 1;
}

.social-proof {
  font-size: 0.8rem;
  color: rgba(30, 60, 80, 0.5);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-stack {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 240px;
  perspective: 800px;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity;
  cursor: default;
  user-select: none;
}

/* Stack: cards behind peek out at the top */
.card[data-pos="0"] {
  z-index: 10;
  transform: translateY(0) scale(1);
  opacity: 1;
  box-shadow: var(--shadow-card);
}

.card[data-pos="1"] {
  z-index: 9;
  transform: translateY(-10px) scale(0.97);
  opacity: 1;
  box-shadow: var(--shadow-card-top);
}

.card[data-pos="2"] {
  z-index: 8;
  transform: translateY(-18px) scale(0.94);
  opacity: 0.7;
  box-shadow: var(--shadow-card-top);
}

.card[data-pos="hidden"] {
  z-index: 1;
  transform: translateY(30px) scale(0.94);
  opacity: 0;
  pointer-events: none;
}

/* Exit animation: slide out to the bottom */
.card.exiting {
  z-index: 20;
  transform: translateY(120%) scale(0.95) !important;
  opacity: 0 !important;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.4s ease;
}

/* ── Email-style card content ─────────────────── */
.card-email {
  padding: 18px 20px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-email .email-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.card-email .email-label {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #9ca3af;
  width: 24px;
  flex-shrink: 0;
}

.card-email .email-addr {
  color: var(--text-muted);
}

.card-divider {
  height: 1px;
  background: var(--border-light);
  margin: 10px 20px;
}

.card-email .email-body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin-top: 4px;
}

.card-reply {
  background: #f9fafb;
  border-top: 1px solid var(--border-light);
  border-left: 3px solid #d1d5db;
  margin-left: 0;
  border-radius: 0 0 var(--radius) 0;
  padding: 14px 17px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-reply .email-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-reply .email-label {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #9ca3af;
  width: 24px;
  flex-shrink: 0;
}

.card-reply .email-addr {
  color: var(--text-muted);
}

.card-reply .email-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Water mirage ─────────────────────────────── */
.water-filters {
  position: absolute;
  width: 0;
  height: 0;
}

.water {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0%, black 35%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 35%);
}

/* Flipped sky gradient = reflection */
.water-reflection {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #a8dff0 0%, #87CEEB 40%, #7ec8e3 80%, #6db8d4 100%);
  opacity: 0.5;
  filter: url(#water-ripple);
}

/* Darker tint to make it read as water */
.water-surface {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(60, 140, 180, 0.05) 0%,
    rgba(50, 120, 160, 0.2) 50%,
    rgba(40, 100, 140, 0.35) 100%
  );
}

/* Specular highlights that drift */
.water-highlights {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120px 8px at 20% 60%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(ellipse 80px 5px at 55% 45%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(ellipse 150px 6px at 80% 70%, rgba(255,255,255,0.18) 0%, transparent 100%);
  animation: highlight-drift 10s ease-in-out infinite;
  filter: url(#water-ripple);
}

@keyframes highlight-drift {
  0%, 100% { transform: translateX(-15px); opacity: 0.7; }
  33%      { transform: translateX(10px); opacity: 1; }
  66%      { transform: translateX(-8px); opacity: 0.8; }
}

/* ── Floating particles ──────────────────────── */
#particle-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  opacity: 0;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 480px) {
  main {
    padding: 32px 16px;
    gap: 36px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .subtitle {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }

  .input-row input {
    padding: 18px 24px;
    font-size: 1.05rem;
  }

  .input-row button {
    padding: 18px 24px;
    font-size: 1.05rem;
  }

  .card-stack {
    height: 220px;
  }

  .card-email {
    padding: 14px 16px 10px;
  }

  .card-reply {
    padding: 12px 16px;
  }

  .card-divider {
    margin: 8px 16px;
  }
}
