/* ============================================================
   WellSend Design System — Tokens & Element Defaults
   Dark mode, always. Editorial, direct-response DNA.
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Inter+Tight:wght@300..600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---------- Color: surfaces ---------- */
  --bg:            #0F172A;  /* default navy canvas */
  --bg-deep:       #0A0F1C;  /* hero sections, heavier blocks */
  --surface:       #1A2236;  /* cards, panels */
  --surface-2:     #212B42;  /* hover / raised card */

  /* ---------- Color: brand ---------- */
  --accent:        #16A34A;  /* primary green */
  --accent-hover:  #22C55E;  /* hover state */
  --accent-glow:   rgba(22,163,74,0.35);
  --accent-soft:   rgba(22,163,74,0.12);

  /* ---------- Color: text ---------- */
  --fg:            #E2E8F0;  /* primary */
  --fg-muted:      #94A3B8;  /* secondary */
  --fg-dim:        #64748B;  /* tertiary / disabled */

  /* ---------- Color: utility ---------- */
  --amber:         #FBBF24;  /* star ratings, sniper highlights only */
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --border-soft:   rgba(255,255,255,0.05);

  /* ---------- Type families ---------- */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Inter Tight', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* ---------- Type scale ---------- */
  --fs-hero:   clamp(42px, 6vw, 78px);
  --fs-h1:     clamp(36px, 4.5vw, 56px);
  --fs-h2:     clamp(28px, 3.2vw, 40px);
  --fs-h3:     22px;
  --fs-body:   17px;
  --fs-small:  14px;
  --fs-mono:   13px;
  --fs-eyebrow:12px;

  /* ---------- Spacing ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 120px;

  /* ---------- Layout ---------- */
  --max-content:   1200px;
  --max-longform:  720px;
  --max-headline:  920px;
  --section-y:     clamp(60px, 10vw, 120px);

  /* ---------- Radius ---------- */
  --r-btn:  7px;
  --r-card: 14px;
  --r-pill: 999px;

  /* ---------- Shadows / glows ---------- */
  --shadow-cta:    0 8px 24px -8px rgba(22,163,74,0.35);
  --shadow-cta-hi: 0 12px 32px -8px rgba(22,163,74,0.55);
  --shadow-card:   0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 40px -24px rgba(0,0,0,0.6);
  --glow-hero:     radial-gradient(60% 60% at 50% 40%, rgba(22,163,74,0.18), transparent 70%);

  /* ---------- Motion ---------- */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro:     150ms;
  --dur-base:      300ms;
  --dur-reveal:    600ms;
}

/* ============================================================
   Semantic element defaults
   ============================================================ */

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); line-height: 1.02; }
h2 { font-size: var(--fs-h1);   line-height: 1.05; }
h3 { font-size: var(--fs-h2);   line-height: 1.1;  }
h4 { font-size: var(--fs-h3);   line-height: 1.2;  }

em, .italic-accent {
  font-style: italic;
  color: var(--fg); /* italic is a voice move, not a color move */
}

p {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--fg-muted);
  max-width: var(--max-longform);
  margin: 0 0 1em 0;
  text-wrap: pretty;
}

small, .small { font-size: var(--fs-small); color: var(--fg-muted); }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
}

/* Eyebrow label — UPPERCASE mono, tracked */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow--accent { color: var(--accent-hover); }
.eyebrow--accent::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-hover);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Stats — Fraunces numeral, italic green accent */
.stat { font-family: var(--font-display); font-size: clamp(36px, 5vw, 52px); line-height: 1; letter-spacing: -0.03em; color: var(--fg); }
.stat em { font-style: italic; color: var(--accent-hover); }
.stat-label { font-family: var(--font-mono); font-size: var(--fs-eyebrow); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); margin-top: 10px; display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease), box-shadow var(--dur-base) var(--ease), color var(--dur-micro) var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--shadow-cta), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-cta-hi), inset 0 1px 0 rgba(255,255,255,0.22); }
.btn-primary:active { background: #15803D; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.22); }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

/* ---------- Divider ---------- */
hr, .divider {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-6) 0;
}

/* ---------- Case Study Slider ---------- */
.cs-slide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
  position: absolute;
  inset: 0;
  padding: 48px 52px;
}
.cs-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}
.cs-slide.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}
.cs-progress-bar {
  height: 2px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  flex: 1;
}
.cs-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}
.cs-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 24px 64px rgba(0,0,0,0.5);
  position: relative;
}
.cs-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  pointer-events: none;
}
.cs-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  transition: background var(--dur-micro) var(--ease), border-color var(--dur-micro) var(--ease);
  flex-shrink: 0;
}
.cs-nav-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.cs-stat-chip {
  background: var(--accent-soft);
  border: 1px solid rgba(22,163,74,0.25);
  border-radius: 8px;
  padding: 14px 20px;
}

/* ---------- Responsive helpers ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.nav-links { display: flex; gap: 28px; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; }
.footer-cols { display: flex; gap: 60px; }
.cs-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-bottom: 56px; }
.cs-pill-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .book-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .book-grid-outer { padding: 0 !important; }
  /* Nav */
  .nav-links { display: none; }

  /* Grids */
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .grid-stats { grid-template-columns: 1fr !important; }
  .grid-stats > div { text-align: center !important; }

  /* Case study */
  .cs-slide { grid-template-columns: 1fr !important; gap: 28px !important; padding: 28px 20px !important; }
  .cs-header { flex-direction: column; align-items: flex-start; margin-bottom: 32px; }
  .cs-pill-nav { display: none; }
  .cs-stat-chips { grid-template-columns: 1fr 1fr !important; }

  /* Footer */
  .footer-inner { flex-direction: column; }
  .footer-cols { flex-direction: column; gap: 32px; }

  /* Buttons */
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn { width: 100%; max-width: 320px; justify-content: center; }
  .cta-btns { flex-direction: column; align-items: center; }
  .cta-btns .btn { width: 100%; max-width: 320px; justify-content: center; }

  /* Typography scale down */
  h1 { font-size: clamp(34px, 9vw, 52px) !important; }
  h2 { font-size: clamp(26px, 7vw, 38px) !important; }

  /* Section padding */
  .section-hero { padding: 80px 20px 64px !important; }
  .section-std { padding: 80px 20px !important; }
  .section-sm { padding: 56px 20px !important; }
}

@media (max-width: 480px) {
  .cs-stat-chips { grid-template-columns: 1fr !important; }
  .cs-slide { padding: 20px 16px !important; }
}

/* ---------- Grain texture (apply to body or hero) ---------- */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/noise.svg");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ---------- Hero glow ---------- */
.hero-glow {
  position: absolute;
  inset: 0;
  background: var(--glow-hero);
  pointer-events: none;
}
