/* Hambit landing — shared stylesheet
   Brand canvas warm cream #F5EEE6, accent indigo #5b6cff, near-black text.
   Mobile-first. No build step. No external CSS. */

:root {
  --bg: #F5EEE6;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6e7787;
  --accent: #5b6cff;
  --accent-strong: #3d4ede;
  --border: #e7e1d6;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06);
  --maxw: 720px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

h1, h2, h3 {
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 24px;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

small,
.small {
  font-size: 13px;
  color: var(--muted);
}

/* Layout */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.section {
  margin-top: 56px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 12px 20px;
  background: var(--accent-strong);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease;
}

.btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent-strong);
}

.btn-secondary:hover {
  background: rgba(91, 108, 255, 0.08);
  color: var(--accent-strong);
}

/* Forms */

form.email {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 8px;
}

form.email input[type="email"] {
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 120ms ease;
}

form.email input[type="email"]:focus {
  border-color: var(--accent);
}

form.email button {
  padding: 12px 20px;
  background: var(--accent-strong);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

form.email button:hover {
  background: var(--accent);
}

.field-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: -2px;
}

/* Header / hero */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.hero {
  padding-top: 24px;
}

.hero h1 {
  margin-top: 16px;
}

.hero .subhead {
  font-size: 18px;
  color: var(--muted);
  max-width: 60ch;
}

/* Steps */

.steps {
  display: grid;
  gap: 24px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.step h3 {
  margin-bottom: 6px;
}

/* Pricing tiers */

.tiers {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.tier.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.tier .price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0;
}

.tier .price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.tier .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: rgba(91, 108, 255, 0.1);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

/* Comparison table */

table.compare {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table.compare th,
table.compare td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

table.compare th {
  background: rgba(91, 108, 255, 0.04);
  font-weight: 700;
}

table.compare tr:last-child td {
  border-bottom: 0;
}

/* Store badges */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.store-badge {
  display: inline-block;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #ffffff;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.store-badge:hover {
  background: #000000;
  color: #ffffff;
}

.store-badge .label {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
  margin-bottom: -2px;
}

/* Auth callback pages */

.callback {
  text-align: center;
  padding-top: 48px;
}

.callback .spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin: 0 auto 16px;
}

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

.fallback {
  display: none;
  margin-top: 24px;
}

.fallback.visible {
  display: block;
}

/* Privacy policy */

.policy h1 { font-size: 32px; margin-bottom: 8px; }
.policy h2 { font-size: 20px; margin-top: 32px; }
.policy ul { padding-left: 20px; }
.policy li { margin-bottom: 8px; }
.policy table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.policy table th,
.policy table td { padding: 10px 12px; text-align: left; border: 1px solid var(--border); vertical-align: top; }
.policy table th { background: rgba(91, 108, 255, 0.04); font-weight: 700; }
.policy .meta { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.policy hr { margin: 32px 0; }

/* Footer */

footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

footer .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Utility */

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

.center { text-align: center; }
.muted { color: var(--muted); }

/* Responsive */

@media (min-width: 768px) {
  body { font-size: 17px; }
  h1 { font-size: 52px; }
  h2 { font-size: 32px; }
  .wrap { padding: 48px 24px 64px; }
  .hero .subhead { font-size: 20px; }
  form.email {
    flex-direction: row;
    align-items: stretch;
  }
  form.email input[type="email"] { flex: 1; }
  .steps { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  :root { --maxw: 760px; }
}

/* Reduced motion */

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

/* Subscribe-success toast — fires when Brevo redirects back with ?subscribed=1 */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  z-index: 9999;
  max-width: calc(100% - 32px);
  text-align: center;
  animation: toast-in 0.32s ease-out;
}

.toast strong {
  color: #fff;
  font-weight: 600;
  margin-right: 4px;
}

.toast.fade-out {
  animation: toast-out 0.6s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* Inline form error (rendered by /api/subscribe AJAX handler) */
.field-error {
  color: var(--danger);
  margin-top: 8px;
  font-weight: 500;
}

/* Disabled state for submit button while request is in flight */
form.email button[type="submit"][disabled] {
  opacity: 0.6;
  cursor: progress;
}
