/* ═══════════════════════════════════════════════════════
   Mooffers — Clean & Elegant Design System
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────── */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --accent: #10B981;
  --accent-light: #D1FAE5;
  --text: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --bg: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --max-width: 54rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 18px; scroll-behavior: smooth; overflow-x: clip; overflow-y: scroll; width: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; object-fit: contain; }

/* ── Typography ─────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 3.2rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; }

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
}

.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.875rem; }

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: clip;
}

.section {
  padding: 3rem 0;
  overflow-x: clip;
}

.section-gray {
  background: var(--bg-secondary);
}

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand .dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--primary); }

.nav-cta-mobile { display: none; }
.navbar .nav-links.nav-open .nav-cta-mobile { display: list-item; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-cta .btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
}

/* ── Language Switcher ───────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.38rem 0.65rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.lang-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.lang-switch .lang-icon {
  font-size: 1rem;
}

.lang-switch .lang-label {
  letter-spacing: 0.02em;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-white {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn-white:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

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

.btn-accent:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  padding: 9rem 0 2rem;
  text-align: center;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  max-width: 800px;
  margin: 0 auto 1.25rem;
  line-height: 1.15;
}

.hero .highlight {
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Stats ──────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.stat-item { text-align: center; }
.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.2s;
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.card-icon.blue { background: var(--primary-light); color: var(--primary); }
.card-icon.green { background: var(--accent-light); color: var(--accent); }

.card h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }
.card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Feature Rows ───────────────────────────────── */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.feature-content h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.feature-content p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feature-list li .check {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.feature-visual {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1px dashed var(--border);
}

.feature-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.feature-visual:has(img) {
  border: none;
  background: transparent;
  padding: 0;
}

.feature-visual .placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ── CTA Section ────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 4rem 3rem;
  background: linear-gradient(135deg, var(--primary), #1E40AF);
  color: #fff;
  border-radius: var(--radius-lg);
}

.cta-section h2 {
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
  background: var(--text);
  color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer h4 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
}

.footer a:hover { color: #fff; }

.footer-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff !important;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ── Forms ──────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
  font-family: var(--font-sans);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.form-card h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.form-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ── Utility ────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.gap-2 { gap: 2rem; }
.gap-3 { gap: 3rem; }

/* Responsive grid helpers */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Page Header ────────────────────────────────── */
.page-header {
  padding: 7rem 0 2.5rem;
  text-align: center;
  background: var(--bg-secondary);
}

.page-header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 550px;
  margin: 0 auto;
}

/* ── Dashboard ──────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.dash-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 5rem 1.5rem 2rem;
}

.dash-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dash-sidebar a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.dash-sidebar a:hover,
.dash-sidebar a.active {
  background: #fff;
  color: var(--primary);
}

.dash-main {
  padding: 5rem 2.5rem 3rem;
}

/* ── Image Placeholder ──────────────────────────── */
.img-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  gap: 0.4rem;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  position: relative;
}

.img-placeholder:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.img-placeholder .img-icon {
  font-size: 2rem;
  opacity: 0.4;
}

.img-placeholder .img-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.img-placeholder .img-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.img-placeholder:has(img) {
  border: none;
  background: transparent;
}

.img-placeholder.full { width: 100%; min-height: 200px; }
.img-placeholder.wide { width: 100%; min-height: 160px; }
.img-placeholder.square { width: 100%; min-height: 200px; }
.img-placeholder.small { width: 100%; min-height: 100px; }
.img-placeholder.hero-img { width: 100%; max-width: 1100px; min-height: 400px; margin: 0 auto; }
.img-placeholder.inline-right { width: 100%; min-height: 200px; }

/* ── Flow Timeline ──────────────────────────────── */
.flow-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 2.5rem;
  position: relative;
}

.flow-step {
  flex: 1;
  text-align: center;
  padding: 0 1rem;
  position: relative;
}

.flow-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 auto 0.75rem;
}

.flow-step:nth-child(even) .flow-num {
  background: var(--accent-light);
  color: var(--accent);
}

.flow-step h4 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.flow-arrow {
  position: absolute;
  right: -0.5rem;
  top: 0.8rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
}

.flow-step:last-child .flow-arrow {
  display: none;
}

/* ── Highlights Grid ────────────────────────────── */
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.highlight-cell {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.highlight-cell:hover {
  background: var(--bg-secondary);
}

.hl-bullet {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.highlight-cell:nth-child(even) .hl-bullet {
  background: var(--accent-light);
}

.highlight-cell h4 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.highlight-cell p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Steps Grid ─────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ── Mobile Nav Toggle ──────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px 6px;
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Animate toggle to X when menu is open */
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav dropdown */
.navbar .nav-links.nav-open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  gap: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  animation: slideDown 0.25s ease-out;
}

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

.navbar .nav-links.nav-open a {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: color 0.15s, background 0.15s;
  border-radius: var(--radius-sm);
}

.navbar .nav-links.nav-open a:last-of-type {
  border-bottom: none;
}

.navbar .nav-links.nav-open a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

/* Mobile CTA — show inside the dropdown via JS-generated buttons
   (fallback: keep .nav-cta visible on mobile as standalone row) */
.navbar .nav-links.nav-open + .nav-actions-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.navbar .nav-links.nav-open + .nav-actions-mobile .btn {
  width: 100%;
  justify-content: center;
  padding: 0.8rem;
  font-size: 1rem;
}

/* ── Desktop: hide duplicate Contact Us btn in nav-cta ── */
@media (min-width: 769px) {
  .nav-cta .btn-primary { display: none; }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.8rem; }
  .hero { padding: 6rem 0 1.5rem; }
  .hero h1 { font-size: 2.4rem; }
  .stats-bar { gap: 2rem; flex-wrap: wrap; }
  .feature-row { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-actions { gap: 0.35rem; }
  .nav-cta { display: none; }
  .lang-switch { padding: 0.35rem 0.55rem; font-size: 0.72rem; }
  .section { padding: 2rem 0; }

  /* Mobile: prevent horizontal scroll */
  html, body { overflow-x: hidden; width: 100%; }
  main, section, .container { overflow-x: hidden; }

  /* flow timeline → vertical stack */
  .flow-timeline { flex-direction: column; gap: 1.5rem; }
  .flow-arrow {
    position: static;
    display: block;
    text-align: center;
    transform: rotate(90deg);
    margin-top: 0.5rem;
  }
  .flow-step:last-child .flow-arrow { display: none; }

  /* highlights → single column */
  .highlights-grid { grid-template-columns: 1fr; }

  /* steps → 2-column on tablet */
  .steps-grid { grid-template-columns: repeat(2, 1fr); }

  /* grid helpers → 1 col */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* CTA full-width on mobile */
  .cta-section {
    margin: 0;
    border-radius: 0;
  }

  /* page header smaller */
  .page-header { padding: 5rem 0 2rem; }
  .page-header h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero h1 { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 3rem 1.5rem; }
  .cta-section h2 { font-size: 1.6rem; }
  .steps-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }

  /* Small mobile: further shrink nav elements */
  .nav-brand { font-size: 1.15rem; }
  .nav-brand .dot { width: 6px; height: 6px; }
  .nav-cta { display: none; }
  .lang-switch { padding: 0.3rem 0.45rem; font-size: 0.68rem; }
  .nav-toggle { padding: 8px 4px; }
  .nav-toggle span { width: 20px; }
  .navbar .nav-links.nav-open a { font-size: 1rem; padding: 0.75rem 0.4rem; }

/* ═══════════════════════════════════════════════════════
   Why Choose Mooffers — Orchestrated Animations
   ═══════════════════════════════════════════════════════ */

/* ── Badge: drop + elastic bounce ─────────────── */
@keyframes badgeDrop {
  0%   { opacity: 0; transform: translateY(-20px); }
  60%  { opacity: 1; transform: translateY(4px); }
  80%  { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
.anim-badge {
  opacity: 0;
  transform: translateY(-20px);
}
.anim-badge.run {
  animation: badgeDrop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Title: character-by-character ─────────────── */
.anim-char-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.3s ease-out, transform 0.35s ease-out;
}
.anim-char-title .char.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Subtitle: fade up ─────────────────────────── */
.anim-subtitle {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.anim-subtitle.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Cards: hidden until triggered ─────────────── */
.anim-cards .card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.anim-cards .card.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════
   General Animations
   ═══════════════════════════════════════════════════════ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slamIn {
  0%   { opacity: 0; transform: scale(0.3) translateY(160px); }
  55%  { opacity: 1; transform: scale(1.06) translateY(-10px); }
  75%  { transform: scale(0.96) translateY(4px); }
  90%  { transform: scale(1.02) translateY(-2px); }
  100% { transform: scale(1)   translateY(0); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Hero entrance */
.hero h1 { animation: fadeInUp 0.8s ease-out both; }
.hero p  { animation: fadeInUp 0.8s 0.2s ease-out both; }
.hero .hero-cta { animation: fadeInUp 0.8s 0.4s ease-out both; }

/* Scroll reveal generic */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Ecosystem cards slide-in ──────────────────── */
.eco-card.animate-on-scroll[data-slide="left"] {
  transform: translateX(-20px);
}
.eco-card.animate-on-scroll[data-slide="left"].is-visible {
  transform: translateX(0);
}
.eco-card.animate-on-scroll:not([data-slide]) {
  transform: translateX(20px);
}
.eco-card.animate-on-scroll:not([data-slide]).is-visible {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .eco-card.animate-on-scroll[data-slide="left"],
  .eco-card.animate-on-scroll:not([data-slide]) {
    transform: translateY(30px);
  }
  .eco-card.animate-on-scroll.is-visible {
    transform: translateY(0);
  }
}

/* ── Slam-in cards (publisher value & integration) ── */
.slam-card.animate-on-scroll {
  opacity: 0;
  transform: scale(0.3) translateY(160px);
}
.slam-card.animate-on-scroll.is-visible {
  animation: slamIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0s;   opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════════════════════
   Wave Cards
   ═══════════════════════════════════════════════════════ */

@keyframes waveFloat {
  0%, 100% { transform: scale(var(--s)) translateY(0); }
  25%      { transform: scale(var(--s)) translateY(-14px); }
  75%      { transform: scale(var(--s)) translateY(14px); }
}

.wave-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
}

.wave-card {
  --s: 1;
  --d: 0s;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.8rem;
  text-align: center;
  transform: scale(var(--s));
  animation: waveFloat 5s var(--d) ease-in-out infinite;
  transition: box-shadow 0.3s, border-color 0.3s;
  position: relative;
}
.wave-card:nth-child(1) { --s: 1;    --d: 0s;   max-width: 380px; flex: 1; }
.wave-card:nth-child(2) { --s: 0.88; --d: 0.5s; max-width: 340px; flex: 0.88; }
.wave-card:nth-child(3) { --s: 0.76; --d: 1s;   max-width: 300px; flex: 0.76; }

.wave-card:hover {
  animation-play-state: paused;
  transform: scale(calc(var(--s) + 0.04));
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border-color: var(--primary);
  z-index: 10;
}
.wave-card .card-icon { margin: 0 auto 1rem; }
.wave-card h3 { margin-bottom: 0.6rem; }
.wave-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

@media (max-width: 768px) {
  .wave-cards { flex-direction: column; gap: 1.5rem; }
  .wave-card:nth-child(1),
  .wave-card:nth-child(2),
  .wave-card:nth-child(3) {
    max-width: 100%; flex: 1; --s: 1;
    animation: none; opacity: 1; transform: scale(1);
  }
}

/* ── Large Screen — 图片随字体/屏幕放大 ────────── */
@media (min-width: 1600px) {
  :root { --max-width: 64rem; }
}
@media (min-width: 2200px) {
  :root { --max-width: 72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .anim-badge, .anim-char-title .char, .anim-subtitle, .anim-cards .card,
  .wave-card, .hero h1, .hero p, .hero .hero-cta {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
