/* ==========================================================================
   MEME GENERATOR — DESIGN SYSTEM
   Tokens, resets, layout primitives
   ========================================================================== */

:root {
  /* Brand palette — dark theme, bright accents */
  --color-primary: #7C7CFF;
  --color-primary-dark: #5B5BD6;
  --color-secondary: #B478FF;
  --color-accent: #FF5C7A;
  --color-bg: #0E1016;
  --color-card: #171A23;
  --color-text: #F1F3F9;
  --color-muted: #9BA3B4;
  --color-border: #2A2E3A;
  --color-bg-alt: #14161F;

  --gradient-brand: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, #FF8A9B 100%);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radii & shadows */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(124, 124, 255, 0.28);

  --container-max: 1280px;
  --header-height: 76px;
}

/* Light theme overrides */
html[data-theme="light"] {
  --color-bg: #F6F7FB;
  --color-card: #FFFFFF;
  --color-text: #1B1E27;
  --color-muted: #5B6272;
  --color-border: #E1E4EC;
  --color-bg-alt: #EDEFF6;
  color-scheme: light;
}
html[data-theme="light"] .site-header { background: rgba(246, 247, 251, 0.82); }
html[data-theme="light"] select { color-scheme: light; }

/* ---------------------------------- Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}
ul[class], ol[class] { list-style: none; padding: 0; }
img, picture, svg, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

section { position: relative; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(91, 91, 214, 0.08);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
}

.section-head {
  max-width: 680px;
  margin: 0 auto var(--space-8);
  text-align: center;
}
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-block: var(--space-3); }
.section-head p { color: var(--color-muted); font-size: 1.05rem; }

.section-pad { padding-block: var(--space-9); }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* -------------------------------- Buttons -------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  border: none;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.25);
}
.btn-accent:hover { transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(91,91,214,0.05); }

.btn-ghost {
  background: rgba(91, 91, 214, 0.08);
  color: var(--color-primary);
}
.btn-ghost:hover { background: rgba(91, 91, 214, 0.14); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn-icon {
  width: 42px; height: 42px; padding: 0; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-card); border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}
.btn-icon:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-1px); }
.btn-icon.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.btn-icon svg { width: 18px; height: 18px; }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.55); transform: scale(0); animation: ripple 0.6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(3); opacity: 0; } }

/* --------------------------------- Header -------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(14, 16, 22, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); width: 100%; }

.logo { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.logo-mark {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem; font-weight: 800;
  transform: rotate(-6deg);
  box-shadow: var(--shadow-sm);
}
.logo span { color: var(--color-accent); }

.main-nav { display: flex; align-items: center; gap: var(--space-6); }
.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  padding-block: var(--space-2);
}
.main-nav a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--gradient-brand);
  transition: width 0.25s ease;
  border-radius: var(--radius-pill);
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: var(--space-4); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  align-items: center;
  justify-content: center;
}
.hamburger span { width: 20px; height: 2px; background: var(--color-text); border-radius: 2px; transition: all 0.3s ease; }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: var(--color-bg);
  z-index: 999;
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  visibility: hidden;
}
.mobile-nav.is-open { transform: translateX(0); visibility: visible; }
.mobile-nav a {
  display: block;
  padding: var(--space-4) 0;
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav .btn { margin-top: var(--space-6); width: 100%; }

/* --------------------------------- Hero ---------------------------------- */
.hero {
  padding-top: var(--space-9);
  padding-bottom: var(--space-8);
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(124, 77, 255, 0.14), transparent 60%),
    radial-gradient(50% 45% at 90% 15%, rgba(255, 77, 109, 0.1), transparent 60%),
    var(--color-bg);
  overflow: hidden;
}
.hero-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-shapes span {
  position: absolute;
  border-radius: 40%;
  opacity: 0.5;
  filter: blur(2px);
  animation: float 9s ease-in-out infinite;
}
.hero-shapes span:nth-child(1) { width: 90px; height: 90px; top: 12%; left: 6%; background: var(--gradient-brand); transform: rotate(12deg); animation-delay: 0s; }
.hero-shapes span:nth-child(2) { width: 60px; height: 60px; top: 65%; left: 10%; background: var(--color-accent); border-radius: 50%; animation-delay: 1.5s; }
.hero-shapes span:nth-child(3) { width: 70px; height: 70px; top: 20%; right: 8%; background: var(--gradient-accent); transform: rotate(-15deg); animation-delay: 0.8s; }
.hero-shapes span:nth-child(4) { width: 40px; height: 40px; top: 70%; right: 15%; background: var(--color-secondary); border-radius: 50%; animation-delay: 2.2s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-22px) rotate(8deg); } }

.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 760px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-block: var(--space-5) var(--space-4);
}
.hero h1 .accent-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: 1.15rem; color: var(--color-muted); max-width: 560px; margin-inline: auto; }
.hero-cta { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-6); flex-wrap: wrap; }

.hero-trust { display: flex; align-items: center; justify-content: center; gap: var(--space-6); margin-top: var(--space-7); flex-wrap: wrap; color: var(--color-muted); font-size: 0.85rem; font-family: var(--font-mono); }
.hero-trust strong { color: var(--color-text); font-family: var(--font-display); }

/* ---------------------------- Meme Editor Tool ---------------------------- */
.editor-wrap { margin-top: var(--space-8); position: relative; z-index: 1; }
.editor-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-6);
  text-align: left;
}
.editor-tape {
  position: absolute;
  top: -14px; left: 40px;
  width: 90px; height: 26px;
  background: rgba(255, 209, 102, 0.85);
  box-shadow: var(--shadow-sm);
  transform: rotate(-5deg);
  z-index: 2;
}
.editor-tape.right { left: auto; right: 60px; top: -12px; transform: rotate(6deg); background: rgba(124, 77, 255, 0.25); }

.editor-preview-col { display: flex; flex-direction: column; gap: var(--space-4); }
.canvas-shell {
  position: relative;
  background: repeating-conic-gradient(#1c2030 0% 25%, #14172200 0% 50%) 50% / 20px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
#memeCanvas { width: 100%; height: 100%; object-fit: contain; cursor: grab; touch-action: none; }
.canvas-shell.dragover { outline: 2px dashed var(--color-primary); outline-offset: -6px; }

.canvas-empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-6);
  color: var(--color-muted);
  pointer-events: none;
}
.canvas-empty-state.hidden { display: none; }
.canvas-empty-state svg { width: 48px; height: 48px; color: var(--color-primary); }

.upload-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.upload-row .btn { flex: 1; }

.canvas-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.editor-controls-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-height: 640px;
  overflow-y: auto;
  padding-right: var(--space-2);
}
.editor-controls-col::-webkit-scrollbar { width: 6px; }
.editor-controls-col::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-pill); }

.control-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.control-group input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.control-group input[type="text"]:focus { border-color: var(--color-primary); }

.control-row { display: flex; gap: var(--space-3); }
.control-row .control-group { flex: 1; }

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  appearance: none;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gradient-brand);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--color-primary);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--color-primary); border: 3px solid #fff; cursor: pointer;
}

select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color-scheme: dark;
}

input[type="color"] {
  width: 100%; height: 42px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  background: var(--color-card);
}

.toggle-grid { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.toggle-grid .btn-icon { flex-shrink: 0; }

.text-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.text-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
}
.text-tab.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }

.emoji-panel, .sticker-panel, .shape-panel {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  max-height: 130px;
  overflow-y: auto;
}
.emoji-panel button, .sticker-panel button {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.emoji-panel button:hover, .sticker-panel button:hover { border-color: var(--color-primary); transform: scale(1.08); }

.shape-panel button { aspect-ratio: 1; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-card); display: flex; align-items: center; justify-content: center; }
.shape-panel svg { width: 22px; height: 22px; color: var(--color-primary); }

.editor-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-3); border-top: 1px dashed var(--color-border); }
.editor-actions .btn { flex: 1; min-width: 140px; }

.divider-label {
  display: flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted);
}
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

/* ------------------------------ Card grids -------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.template-card, .category-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.template-card:hover, .category-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.template-thumb { aspect-ratio: 1; overflow: hidden; }
.template-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.template-card:hover .template-thumb img { transform: scale(1.06); }
.template-body { padding: var(--space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.template-body h3 { font-size: 0.95rem; font-weight: 600; }

.filter-row { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; margin-bottom: var(--space-7); }
.filter-chip {
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-card);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: all 0.2s ease;
}
.filter-chip.active, .filter-chip:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* ------------------------------- Masonry gallery -------------------------- */
.masonry {
  columns: 4 220px;
  column-gap: var(--space-5);
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
  background: var(--color-card);
}
.masonry-item img { width: 100%; display: block; transition: transform 0.4s ease; }
.masonry-item:hover img { transform: scale(1.05); }
.masonry-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(31,41,55,0.75), transparent 55%);
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: var(--space-4);
  opacity: 0; transition: opacity 0.3s ease;
}
.masonry-item:hover .masonry-overlay { opacity: 1; }
.masonry-actions { display: flex; gap: var(--space-2); }
.masonry-actions button {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text);
}
.masonry-actions button svg { width: 16px; height: 16px; }
.masonry-title { color: #fff; font-size: 0.85rem; font-weight: 600; }

/* --------------------------------- Features ------------------------------- */
.feature-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  margin-bottom: var(--space-4);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: var(--space-2); }
.feature-card p { color: var(--color-muted); font-size: 0.92rem; }

/* -------------------------------- Timeline -------------------------------- */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-5); position: relative; }
.timeline::before {
  content: '';
  position: absolute; top: 34px; left: 8%; right: 8%; height: 2px;
  background: repeating-linear-gradient(to right, var(--color-border) 0 8px, transparent 8px 16px);
  z-index: 0;
}
.timeline-step { position: relative; z-index: 1; text-align: center; }
.timeline-num {
  width: 68px; height: 68px; margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--color-card);
  border: 2px solid var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.timeline-step h3 { font-size: 1rem; margin-bottom: var(--space-2); }
.timeline-step p { font-size: 0.85rem; color: var(--color-muted); }

/* ------------------------------- Showcase rows ----------------------------- */
.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  padding-block: var(--space-7);
  border-bottom: 1px solid var(--color-border);
}
.showcase-row:last-child { border-bottom: none; }
.showcase-row.reverse .showcase-media { order: 2; }
.showcase-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
.showcase-text .eyebrow { margin-bottom: var(--space-4); }
.showcase-text h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: var(--space-3); }
.showcase-text p { color: var(--color-muted); margin-bottom: var(--space-4); }
.showcase-list { display: flex; flex-direction: column; gap: var(--space-3); }
.showcase-list li { display: flex; align-items: center; gap: var(--space-3); font-weight: 500; font-size: 0.95rem; }
.showcase-list svg { width: 20px; height: 20px; color: var(--color-primary); flex-shrink: 0; }

/* ------------------------------ Compare cards ------------------------------ */
.compare-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.compare-card {
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-5); text-align: center; box-shadow: var(--shadow-sm);
}
.compare-card .feature-icon { margin-inline: auto; }
.compare-card h3 { font-size: 0.95rem; }

/* --------------------------------- Stats ----------------------------------- */
.stats-section {
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  text-align: center;
}
.stat-num { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
.stat-label { font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; margin-top: var(--space-2); }

/* ------------------------------ Testimonials -------------------------------- */
.testimonial-slider { position: relative; max-width: 760px; margin: 0 auto; overflow: hidden; }
.testimonial-track { display: flex; transition: transform 0.5s ease; }
.testimonial-slide { flex: 0 0 100%; padding: var(--space-4); }
.testimonial-card {
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-7); text-align: center; box-shadow: var(--shadow-sm);
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto var(--space-4);
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-brand); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
}
.stars { color: var(--color-accent); margin-bottom: var(--space-3); letter-spacing: 2px; }
.testimonial-card p.quote { font-size: 1.05rem; margin-bottom: var(--space-4); }
.testimonial-name { font-weight: 700; }
.testimonial-role { color: var(--color-muted); font-size: 0.85rem; }
.slider-dots { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-5); }
.slider-dots button { width: 9px; height: 9px; border-radius: 50%; background: var(--color-border); border: none; }
.slider-dots button.active { background: var(--color-primary); width: 24px; border-radius: var(--radius-pill); }
.slider-arrows { display: flex; justify-content: center; gap: var(--space-3); margin-top: var(--space-5); }

/* ---------------------------------- FAQ -------------------------------------- */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-3); }
.faq-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5); background: none; border: none; text-align: left;
  font-weight: 600; font-size: 1rem;
}
.faq-question svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.3s ease; color: var(--color-primary); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-answer p { padding: 0 var(--space-5) var(--space-5); color: var(--color-muted); }

/* ---------------------------------- CTA -------------------------------------- */
.cta-section {
  background: linear-gradient(135deg, #2A1F4D 0%, #4B2A6B 55%, #6E2A48 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-9) var(--space-6);
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-section h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: var(--space-5); }
.cta-section::before {
  content: '';
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,77,255,0.35), transparent 70%);
  top: -120px; right: -80px;
}

/* -------------------------------- Contact ------------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); align-items: start; }
.contact-form { display: flex; flex-direction: column; gap: var(--space-4); background: var(--color-card); padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 0.85rem 1rem; border: 1.5px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg-alt); color: var(--color-text);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-info { display: flex; flex-direction: column; gap: var(--space-4); }
.contact-info-card {
  display: flex; gap: var(--space-4); align-items: flex-start;
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-5);
}
.contact-info-card .feature-icon { margin: 0; flex-shrink: 0; width: 44px; height: 44px; }
.contact-info-card h4 { font-size: 0.95rem; margin-bottom: var(--space-1); }
.contact-info-card p { color: var(--color-muted); font-size: 0.88rem; }
.form-status { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.success { color: #16a34a; }

/* --------------------------------- Footer -------------------------------------- */
.site-footer { background: #0A0B11; color: #cbd2dc; padding-top: var(--space-8); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: var(--space-4); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.footer-col a { color: #cbd2dc; font-size: 0.9rem; transition: color 0.2s ease; }
.footer-col a:hover { color: #fff; }
.footer-about p { font-size: 0.9rem; margin-block: var(--space-4); color: #a3adba; }
.footer-logo { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff; transition: opacity 0.2s ease; }
.footer-logo:hover { opacity: 0.8; }
.social-icons { display: flex; gap: var(--space-3); }
.social-icons a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
}
.social-icons a:hover { background: var(--gradient-brand); }
.social-icons svg { width: 17px; height: 17px; }
.footer-bottom { padding-block: var(--space-5); text-align: center; font-size: 0.85rem; color: #8a93a3; }

/* ------------------------------ Reveal animations -------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-zoom { opacity: 0; transform: scale(0.92); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-zoom.is-visible { opacity: 1; transform: scale(1); }
.stagger .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger .reveal:nth-child(2) { transition-delay: 0.15s; }
.stagger .reveal:nth-child(3) { transition-delay: 0.25s; }
.stagger .reveal:nth-child(4) { transition-delay: 0.35s; }

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-primary); color: #fff;
  padding: var(--space-3) var(--space-5); z-index: 2000; border-radius: var(--radius-sm);
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

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

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1180px) {
  .editor-card { grid-template-columns: 1fr; }
  .editor-controls-col { max-height: none; }
  .masonry { columns: 3 200px; }
}

@media (max-width: 992px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .header-actions .btn.btn-primary { display: none; }
  .showcase-row, .showcase-row.reverse { grid-template-columns: 1fr; }
  .showcase-row.reverse .showcase-media { order: 0; }
  .compare-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-section { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(1, 1fr); gap: var(--space-6); }
  .timeline::before { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --space-9: 3.5rem; --space-10: 4.5rem; }
  .container { padding-inline: var(--space-5); }
  .masonry { columns: 2 160px; }
  .header-actions .btn span.hide-mobile { display: none; }
}

@media (max-width: 576px) {
  .compare-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .masonry { columns: 2 140px; }
  .emoji-panel, .sticker-panel { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 425px) {
  .editor-card { padding: var(--space-4); }
  .canvas-toolbar { justify-content: center; }
  .masonry { columns: 1; }
  .masonry-item img { height: 220px !important; }
  .stats-section { grid-template-columns: 1fr; gap: var(--space-5); padding: var(--space-6) var(--space-5); }
}

/* ---------------------------- Theme toggle (sticky) ---------------------------- */
.theme-toggle {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 1200;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--color-primary); color: var(--color-primary); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }

@media (max-width: 576px) {
  .theme-toggle { right: var(--space-4); bottom: var(--space-4); width: 42px; height: 42px; }
}
