/* =========================================================
   main.css — Landing page styles
   Vibe: Dark charcoal, warm amber accent, editorial typography
   Fonts: Fraunces (display), Satoshi (body)
   ========================================================= */

/* --- Variables --- */
:root {
  --bg:         #0e0e0e;
  --bg-card:    #161616;
  --border:     #2a2a2a;
  --text:       #e8e3dc;
  --text-muted: #7a7269;
  --accent:     #f59e0b;
  --accent-dim: rgba(245, 158, 11, 0.12);
  --success:    #10b981;
  --error:      #ef4444;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Satoshi', 'Helvetica Neue', Arial, sans-serif;

  --radius:     4px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
}

/* --- Page layout --- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* --- Hero --- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 100px 0 80px;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 1;
}

/* --- Headline --- */
.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
}

.headline em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* --- Sub-headline --- */
.subhead {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 420px;
  margin-bottom: 44px;
  font-weight: 400;
}

/* --- Hero count badge (live waitlist count) --- */
.hero-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding: 6px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 100px;
  line-height: 1.4;
}

.hero-count strong {
  color: var(--accent);
  font-weight: 600;
}

/* --- Form shell --- */
.form-shell {
  margin-bottom: 20px;
}

.waitlist-form {}

.input-group {
  display: flex;
  gap: 0;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.email-input {
  flex: 1;
  background: var(--bg-card);
  border: none;
  outline: none;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  min-width: 0;
}

.email-input::placeholder {
  color: var(--text-muted);
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0e0e0e;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
  min-width: 160px;
}

.submit-btn:hover:not(:disabled) {
  background: #fbbf24;
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner (hidden by default, shown via .is-submitting class) */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #0e0e0e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.is-submitting .btn-label { display: none; }
.is-submitting .btn-spinner { display: block; }

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

/* --- Field error --- */
.field-error {
  font-size: 0.8125rem;
  color: var(--error);
  margin-top: 8px;
  min-height: 1.25em;
  font-weight: 500;
}

/* --- Success state --- */
.success-state {
  max-width: 480px;
  padding: 28px 24px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  animation: fadeUp 0.35s ease;
}

.success-icon {
  width: 36px;
  height: 36px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.success-heading {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.success-body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Trust line --- */
.trust-line {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* --- Hero aside (decorative orbs) --- */
.hero-aside {
  position: relative;
  height: 400px;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.glow-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
  top: 10%;
  left: 20%;
  animation: drift 8s ease-in-out infinite alternate;
}

.glow-2 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  bottom: 10%;
  right: 10%;
  animation: drift 11s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, -20px) scale(1.05); }
}

/* --- Footer --- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* =========================================================
   Mobile (≤ 640px)
   ========================================================= */
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 60px 0 48px;
    gap: 0;
  }

  .hero-aside {
    display: none;
  }

  .headline {
    font-size: 2.25rem;
  }

  .subhead {
    font-size: 1rem;
    max-width: 100%;
    margin-bottom: 32px;
  }

  .input-group {
    flex-direction: column;
    max-width: 100%;
  }

  .submit-btn {
    min-width: 100%;
    justify-content: center;
    padding: 15px 22px;
  }

  .success-state {
    max-width: 100%;
  }
}

/* =========================================================
   Tablet (641px – 900px)
   ========================================================= */
@media (min-width: 641px) and (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-aside {
    display: none;
  }
}

/* =========================================================
   Referral card
   Appears inside .success-state after a successful signup.
   Matches dark/amber design language.
   ========================================================= */
.referral-card {
  margin-top: 20px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeUp 0.35s ease;
}

/* Large position stat block */
.referral-card__position-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.referral-card__position-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.referral-card__position-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.referral-card__position-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Referral mechanic explainer */
.referral-card__mechanic {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.referral-card__mechanic strong {
  color: var(--text);
  font-weight: 600;
}

/* Share on X primary button */
.referral-card__share-x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: #000;
  border: 1px solid #333;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  margin-bottom: 14px;
  white-space: nowrap;
}

.referral-card__share-x-btn:hover {
  background: #111;
  border-color: #555;
}

.referral-card__share-x-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.referral-card__cta {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.referral-card__count-line {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.referral-card__count-num {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
}

.referral-card__url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.referral-card__url {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  word-break: break-all;
  flex: 1;
  min-width: 0;
  /* Truncate long URLs visually */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.referral-card__copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0e0e0e;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.referral-card__copy-btn:hover {
  background: #fbbf24;
}

.referral-card__copy-btn.is-copied {
  background: var(--success);
  color: #fff;
}

@media (max-width: 640px) {
  .referral-card__url-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .referral-card__url {
    max-width: 100%;
    white-space: normal;
  }

  .referral-card__copy-btn {
    width: 100%;
    justify-content: center;
  }
}
