/* ============================================================
   Mail Studio Frontend — landing page
   Matches the current builder app design: light Tailwind-style
   theme, white surfaces, slate palette, blue-600 accent.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --emerald-100: #d1fae5;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --amber-300: #fcd34d;
  --red-500: #ef4444;
  --red-100: #fee2e2;

  --page-bg: #eef2f7;

  --font-text: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --radius-input: 8px;
  --radius-btn: 8px;
  --radius-card: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --ring-blue: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

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

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--slate-800);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; }
button { font-family: inherit; }
code { font-family: inherit; }

::selection { background: var(--blue-100); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring-blue);
  border-radius: 6px;
}

.hidden { display: none !important; }
.muted { color: var(--slate-400); font-weight: 400; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--slate-800);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--blue-600);
  color: #ffffff;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slate-200);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1152px;
  margin: 0 auto;
  padding: 12px 32px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--slate-600);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover { background: var(--slate-100); color: var(--slate-900); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-btn);
  padding: 10px 16px;
  font: 600 14px/1.2 var(--font-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--blue-600); color: #ffffff; }
.btn-primary:hover { background: var(--blue-700); }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  font: 400 14px/1.5 var(--font-text);
  color: var(--slate-700);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder { color: var(--slate-400); }

.input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-100);
}

.input.invalid {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px var(--red-100);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
}

.field { margin-bottom: 14px; }

/* ---------- Badges & tokens ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10000px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-blue { background: var(--blue-100); color: var(--blue-700); }

.badge-on-dark { background: rgba(255, 255, 255, 0.18); color: #ffffff; }

.inline-token {
  font-size: 0.875em;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--blue-100);
  padding: 1px 8px;
  border-radius: 10000px;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1000px 420px at 80% -10%, rgba(37, 99, 235, 0.08), transparent 60%),
    #ffffff;
  border-bottom: 1px solid var(--slate-200);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
  max-width: 1152px;
  margin: 0 auto;
  padding: 88px 32px 96px;
}

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

.hero-title {
  margin-top: 0;
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--slate-800);
}

.accent-underline {
  position: relative;
  white-space: nowrap;
}

.accent-underline::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 9px;
  background: var(--blue-100);
  border-radius: 4px;
  transform: rotate(-1deg);
  z-index: -1;
}

.hero-sub {
  margin-top: 18px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--slate-500);
}

.signup-form {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 480px;
}

.signup-input { flex: 1; min-width: 0; }

.form-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--slate-400);
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.proof-avatars { display: flex; }

.proof-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10000px;
  border: 2px solid #ffffff;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.proof-avatar + .proof-avatar { margin-left: -8px; }

.proof-avatar-green { background: var(--emerald-100); color: var(--emerald-700); }
.proof-avatar-amber { background: #fef3c7; color: #b45309; }
.proof-avatar-slate { background: var(--slate-200); color: var(--slate-600); }

.proof-text { font-size: 13.5px; color: var(--slate-500); }
.proof-text strong { color: var(--slate-800); font-weight: 700; }

/* Hero visual — inbox mock */
.hero-visual { position: relative; z-index: 1; }

.email-mock {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.mock-head {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
}

.mock-from { align-items: center; }

.mock-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10000px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 14px;
  font-weight: 700;
}

.mock-person { display: flex; flex-direction: column; line-height: 1.3; }
.mock-name { font-size: 13.5px; font-weight: 700; color: var(--slate-800); }
.mock-email { font-size: 12.5px; color: var(--slate-500); }

.mock-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
}

.mock-label {
  flex: none;
  width: 48px;
  font-size: 12.5px;
  color: var(--slate-400);
}

.mock-value { min-width: 0; overflow-wrap: anywhere; color: var(--slate-600); }
.mock-subject { font-weight: 600; color: var(--slate-800); }

.mock-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }

.pb-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--slate-800);
}

.pb-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  color: var(--slate-600);
}

.pb-muted { color: var(--slate-400); font-size: 12.5px; }

.pb-button {
  align-self: flex-start;
  display: inline-block;
  background: var(--blue-600);
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.pb-button:hover { background: var(--blue-700); }

.pb-divider {
  border: none;
  border-top: 1px solid var(--slate-200);
  margin: 2px 0;
  width: 100%;
}

.var-pill {
  display: inline-block;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 600;
  font-size: 0.9em;
  padding: 1px 8px;
  border-radius: 10000px;
  margin: 0 1px;
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }

.section-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-narrow { max-width: 820px; }

.section-head { max-width: 620px; margin-bottom: 40px; }

.section-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--slate-800);
}

.section-sub {
  margin-top: 10px;
  color: var(--slate-500);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 26px 24px;
  transition: box-shadow 0.2s ease;
}

.feature-card:hover { box-shadow: var(--shadow-lg); }

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-600);
  margin-bottom: 18px;
}

.feature-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--slate-800);
}

.feature-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--slate-500);
}

/* ---------- Showcase ---------- */
.shot-grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 920px;
}

.shot-card {
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.shot-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--slate-100);
  border-bottom: 1px solid var(--slate-200);
}

.shot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--slate-300);
}

.shot-label {
  margin-left: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate-500);
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 2px 10px;
}

.shot-card img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-caption { padding: 18px 22px 22px; }

.shot-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--slate-800);
}

.shot-text {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate-500);
}

/* ---------- Extensions ---------- */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 20px;
}

.ext-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 22px 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ext-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.ext-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}

.ext-stripe { background: #635bff; }
.ext-shopify { background: #95bf47; }
.ext-slack { background: #4a154b; }
.ext-zapier { background: #ff4f00; }
.ext-hubspot { background: #ff7a59; }

.ext-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-800);
}

.ext-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--slate-500);
}

/* ---------- Email list card ---------- */
#list { background: #ffffff; border-top: 1px solid var(--slate-200); border-bottom: 1px solid var(--slate-200); }

.list-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #ffffff;
  border-radius: 20px;
  padding: 48px;
  box-shadow: var(--shadow-lg);
}

.list-copy { position: relative; z-index: 1; }

.list-title {
  margin-top: 16px;
  font-size: clamp(23px, 2.8vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.list-sub {
  margin-top: 12px;
  max-width: 460px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15.5px;
  line-height: 1.6;
}

.list-perks {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.perk-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-300);
}

.list-form-col { position: relative; z-index: 1; }

.list-form {
  background: #ffffff;
  color: var(--slate-800);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-xl);
}

.list-submit { width: 100%; }

.form-note-dark {
  margin-top: 10px;
  margin-bottom: 0;
  text-align: center;
}

/* Success state replaces the form after joining */
.list-success {
  background: #ffffff;
  color: var(--slate-800);
  border-radius: 14px;
  padding: 40px 24px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 10000px;
  background: var(--emerald-100);
  color: var(--emerald-600);
}

.success-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--slate-800);
}

.success-sub {
  margin-top: 8px;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 14px; }

.faq-item {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--slate-800);
  cursor: pointer;
  list-style: none;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
  content: '+';
  flex: none;
  font-size: 18px;
  font-weight: 500;
  color: var(--blue-600);
  transition: transform 0.15s ease;
}

.faq-item[open] .faq-q::after { transform: rotate(45deg); }

.faq-a {
  padding: 0 22px 18px;
  color: var(--slate-500);
  font-size: 14px;
  line-height: 1.65;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--slate-900);
  color: #ffffff;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1152px;
  margin: 0 auto;
  padding: 44px 32px 24px;
}

.site-footer .brand-name { color: #ffffff; }

.footer-tag {
  margin-top: 10px;
  font-size: 13px;
  color: var(--slate-400);
}

.footer-nav { display: flex; gap: 20px; }

.footer-link {
  padding: 6px 0;
  color: var(--slate-400);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover { color: #ffffff; }

.footer-base {
  max-width: 1152px;
  margin: 0 auto;
  padding: 16px 32px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: var(--slate-500);
}

/* ---------- Thank-you modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  animation: overlay-in 0.2s ease;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 16px;
  padding: 38px 32px 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: modal-pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--slate-400);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover { background: var(--slate-100); color: var(--slate-700); }

.modal-title {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--slate-800);
}

.modal-text {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--slate-500);
}

.modal-btn { width: 100%; margin-top: 22px; }

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Confetti ---------- */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  display: block;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  from { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  to { transform: translate(var(--drift, 0px), 108vh) rotate(var(--spin, 720deg)); opacity: 0.85; }
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  background: var(--slate-800);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  animation: toast-in 0.25s ease;
}

.toast.leaving { animation: toast-out 0.22s ease forwards; }

.toast-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.toast-dot-info { background: var(--amber-300); }

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

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

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 64px 32px 72px;
  }

  .hero-visual { max-width: 560px; }

  .feature-grid { grid-template-columns: 1fr; }

  .list-card {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 28px;
  }
}

@media (max-width: 720px) {
  .site-nav { display: none; }

  .header-inner { justify-content: space-between; padding: 12px 20px; }

  .section { padding: 64px 0; }

  .section-inner { padding: 0 20px; }

  .signup-form { flex-direction: column; }

  .signup-form .btn { width: 100%; }

  .hero-proof { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .toast { animation: none; }
}
