/* ============================================================
   FACE-SWAPPER.ORG - Premium Design System
   Dark theme inspired by Pixlr.com
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Backgrounds */
  --bg:              #0f1117;
  --bg-2:            #161820;
  --bg-3:            #1c1f2b;

  /* Surfaces (glass) */
  --surface:         rgba(255, 255, 255, 0.06);
  --surface-strong:  rgba(255, 255, 255, 0.10);
  --surface-hover:   rgba(255, 255, 255, 0.13);

  /* Text */
  --text:            #f0f2f7;
  --text-dim:        #c0c4d0;
  --muted:           #8b90a0;

  /* Borders */
  --line:            rgba(255, 255, 255, 0.10);
  --line-strong:     rgba(255, 255, 255, 0.18);

  /* Accents */
  --accent:          #007aff;
  --accent-hover:    #0a84ff;
  --accent-dim:      rgba(0, 122, 255, 0.15);
  --accent-2:        #7c5cff;
  --accent-2-dim:    rgba(124, 92, 255, 0.15);
  --accent-gradient: linear-gradient(135deg, #007aff 0%, #7c5cff 100%);

  /* Semantic */
  --success:         #16a34a;
  --success-dim:     rgba(22, 163, 74, 0.15);
  --warning:         #f59e0b;
  --warning-dim:     rgba(245, 158, 11, 0.15);
  --danger:          #dc2626;
  --danger-dim:      rgba(220, 38, 38, 0.15);

  /* Radius */
  --radius-xl:       28px;
  --radius-lg:       20px;
  --radius-md:       14px;
  --radius-sm:       8px;
  --radius-xs:       4px;
  --radius-pill:     999px;

  /* Shadows */
  --shadow-soft:     0 24px 80px rgba(0, 0, 0, 0.4);
  --shadow-card:     0 14px 40px rgba(0, 0, 0, 0.3);
  --shadow-btn:      0 4px 20px rgba(0, 122, 255, 0.35);
  --shadow-sm:       0 2px 12px rgba(0, 0, 0, 0.25);

  /* Spacing scale */
  --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: 128px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-relaxed:1.75;

  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Transitions */
  --transition:      all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-w:       1200px;
  --max-w-wide:  1440px;
  --max-w-narrow: 780px;
  --nav-h:       64px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button { cursor: pointer; }

/* The hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* Decorative background gradients/glows removed site-wide - flat dark backgrounds */
.hero-bg-radial, .hero-bg-glow, .hero-glow-blue, .hero-glow-purple,
.sf-hero-bg, .ape-hero-bg, .ig-hero-bg, .ic-hero-bg, .pr-hero-bg,
.how-section-bg, .faq-section-bg, .hero-bg, .section-glow, .section-bg-glow {
  display: none !important;
}
.hero::before, .hero::after,
.cta-band__inner::before, .cta-band__inner::after,
.hero-section::before, .hero-section::after {
  content: none !important;
  background: none !important;
  display: none !important;
}

/* Brand logo mark - clip with a percentage radius slightly larger than the
   artwork's own corner radius so corners are always a clean rounded square
   (no white corner ever shows, even from a cached opaque-corner version). */
.brand-mark { border-radius: 22%; display: block; flex-shrink: 0; }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--space-6) 0;
}

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: var(--surface-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  line-height: var(--leading-tight);
  color: var(--text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, var(--text-6xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  color: var(--text-dim);
  line-height: var(--leading-relaxed);
  max-width: 68ch;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: var(--text-lg);
  color: var(--text-dim);
  line-height: var(--leading-relaxed);
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--surface-strong);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--accent-2);
}

pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
}

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container--wide  { max-width: var(--max-w-wide); }
.container--narrow { max-width: var(--max-w-narrow); }

/* ============================================================
   STATIC / LEGAL / CONTACT PAGES
   (contact, terms, privacy, content-policy, consent, etc.)
   ============================================================ */
.page-section { padding: 56px 0 72px; }
.container--narrow { max-width: 820px; }

.page-title {
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text, #f0f2f7);
  margin: 0 0 14px;
}
.page-meta {
  font-size: 0.85rem;
  color: var(--muted, #8b90a0);
  margin: 0 0 26px;
}
.page-meta time { color: var(--text-dim, #c0c4d0); }
.page-lead {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-dim, #c0c4d0);
  margin: 0 0 36px;
  max-width: 680px;
}
.section-heading {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text, #f0f2f7);
  margin: 40px 0 14px;
  scroll-margin-top: 80px;
}
.page-section p {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--text-dim, #c0c4d0);
  margin: 0 0 16px;
}
.page-section p strong,
.content-list strong { color: var(--text, #f0f2f7); font-weight: 600; }
.page-section a {
  color: var(--accent, #007aff);
  text-decoration: none;
  font-weight: 600;
}
.page-section a:hover { text-decoration: underline; }
.page-section a.btn,
.page-section a.btn:hover { text-decoration: none; }

.content-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}
.content-list li {
  position: relative;
  padding: 0 0 0 28px;
  margin-bottom: 12px;
  font-size: 0.975rem;
  line-height: 1.7;
  color: var(--text-dim, #c0c4d0);
}
.content-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #007aff);
}
/* "blocked / not allowed" variant uses a red marker */
.content-list--blocked li::before { background: #f87171; border-radius: 2px; }

.page-note {
  margin-top: 36px;
  padding: 16px 18px;
  background: var(--bg-2, #161820);
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--text-dim, #c0c4d0);
  line-height: 1.65;
}

/* Contact page cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 8px 0 8px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
  background: var(--bg-2, #161820);
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  border-radius: 16px;
}
.contact-card__heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #f0f2f7);
  margin: 0;
}
.contact-card__body {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-dim, #c0c4d0);
  margin: 0;
  flex: 1;
}
.contact-card .btn { margin-top: 6px; }
@media (max-width: 680px) {
  .contact-cards { grid-template-columns: 1fr; }
}

.grid { display: grid; }
.flex { display: flex; }

.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }

.flex-center    { display: flex; align-items: center; justify-content: center; }
.flex-between   { display: flex; align-items: center; justify-content: space-between; }
.flex-col       { display: flex; flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

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

.visually-hidden { opacity: 0; pointer-events: none; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}
.section-header h2 { margin-bottom: var(--space-3); }
.section-header p  { margin-inline: auto; }

/* ============================================================
   5. HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.site-header.scrolled {
  background: rgba(15, 17, 23, 0.97);
  box-shadow: 0 1px 30px rgba(0, 0, 0, 0.5);
}

/* Inner flex row: logo | nav | auth */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
  gap: var(--space-5);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-bold);
  font-size: var(--text-base);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}
.site-logo:hover { color: var(--text); }
.logo-icon { flex-shrink: 0; }
.logo-wordmark { font-size: var(--text-base); font-weight: 700; color: var(--text); }

/* Primary nav - horizontal list on desktop */
.primary-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { display: flex; }

.nav-link {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--accent); }

/* Auth buttons */
.nav-auth {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.btn-nav-login {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  white-space: nowrap;
}
.btn-nav-login:hover { color: var(--text); }

.btn-nav-signup {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}
.btn-nav-signup:hover { background: var(--accent-hover); transform: translateY(-1px); color: #fff; }

/* Hamburger - hidden on desktop */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--surface-strong); }
.hamburger-icon { display: block; }
.hamburger-close { display: none; }
.hamburger[aria-expanded="true"] .hamburger-open { display: none; }
.hamburger[aria-expanded="true"] .hamburger-close { display: block; }

/* Mobile nav drawer */
/* Hide desktop auth on mobile, show hamburger */
@media (max-width: 768px) {
  .nav-auth--desktop { display: none; }
  .hamburger { display: flex; }

  .primary-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) var(--space-4) var(--space-5);
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  .primary-nav.nav-open { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .nav-link {
    font-size: var(--text-base);
    padding: 12px 16px;
  }
  .primary-nav .nav-auth {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
  }
  .primary-nav .nav-auth .btn-nav-login,
  .primary-nav .nav-auth .btn-nav-signup { display: block; }
}

/* ============================================================
   6. FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding-top: var(--space-10);
  padding-bottom: var(--space-6);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: var(--space-8);
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--line);
}

/* Brand column */
.footer-brand { }
.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--text);
  text-decoration: none;
  margin-bottom: var(--space-3);
}
.footer-logo:hover { color: var(--text); }
.footer-logo svg { flex-shrink: 0; }
.footer-logo span { font-size: var(--text-sm); font-weight: 700; }
.footer-tagline {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  max-width: 26ch;
  margin: 0;
}

/* Link columns */
.footer-nav { display: contents; }
.footer-col { }
.footer-col-heading {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-4);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col a {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); }

/* Bottom bar */
.footer-bottom {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
  padding-top: var(--space-5);
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.footer-copy {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}
.footer-legal {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}
.footer-legal a { color: var(--muted); text-decoration: none; }
.footer-legal a:hover { color: var(--text); }

@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
  .footer-legal { flex-wrap: wrap; justify-content: center; }
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 44px;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-md);
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  letter-spacing: -0.01em;
}

.btn--sm  { height: 36px; padding: 0 var(--space-4); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn--lg  { height: 54px; padding: 0 var(--space-7); font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn--xl  { height: 64px; padding: 0 var(--space-8); font-size: var(--text-lg); border-radius: var(--radius-xl); }

/* Primary */
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 122, 255, 0.45);
  color: #fff !important;
}
.btn--primary:active { transform: translateY(0); }

/* Gradient */
.btn--gradient {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 92, 255, 0.35);
}
.btn--gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(124, 92, 255, 0.5);
  color: #fff;
}

/* Secondary / ghost */
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn--secondary:hover {
  background: var(--surface-strong);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  color: var(--text) !important;
}

/* Ghost */
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  background: var(--surface);
  color: var(--text) !important;
}

/* Danger */
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover {
  background: #ef4444;
  transform: translateY(-1px);
  color: #fff;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Ripple shimmer on primary */
.btn--primary::after,
.btn--gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn--primary:hover::after,
.btn--gradient:hover::after { opacity: 1; }

/* ============================================================
   8. CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition);
}

.card--hover:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.card--glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-card);
}

.card--accent {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.card--elevated {
  background: var(--bg-3);
  box-shadow: var(--shadow-soft);
}

.card__icon {
  width: 52px;
  height: 52px;
  background: var(--accent-dim);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  color: var(--accent);
  font-size: 22px;
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}

.card__body {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   9. BADGES / CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--default {
  background: var(--surface-strong);
  color: var(--text-dim);
  border: 1px solid var(--line);
}

.badge--accent {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 122, 255, 0.25);
}

.badge--purple {
  background: var(--accent-2-dim);
  color: var(--accent-2);
  border: 1px solid rgba(124, 92, 255, 0.25);
}

.badge--success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.badge--warning {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge--danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.badge--new {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

/* ============================================================
   10. FORM INPUTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-dim);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  transition: var(--transition-fast);
  appearance: none;
}

.form-textarea {
  height: auto;
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
}

.form-input.error,
.form-textarea.error { border-color: var(--danger); }

/* Range input */
.form-range {
  width: 100%;
  height: 4px;
  appearance: none;
  background: var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Toggle / checkbox */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.toggle input { display: none; }
.toggle__track {
  width: 44px; height: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: var(--transition);
  position: relative;
}
.toggle__track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle__track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle__track::after {
  transform: translateX(20px);
  background: #fff;
}

/* ============================================================
   11. UPLOAD ZONE
   ============================================================ */
.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  min-height: 280px;
  padding: var(--space-8) var(--space-6);
  background: var(--surface);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-xl);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-zone:hover,
.upload-zone:focus-within {
  background: var(--surface-strong);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.upload-zone.dragover {
  background: var(--accent-dim);
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--accent-dim), var(--shadow-card);
  transform: scale(1.01);
}

.upload-zone__icon {
  width: 72px; height: 72px;
  background: var(--accent-dim);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 32px;
  transition: var(--transition);
}
.upload-zone:hover .upload-zone__icon,
.upload-zone.dragover .upload-zone__icon {
  transform: scale(1.1);
}

.upload-zone__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.upload-zone__subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
}

.upload-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-zone__formats {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

/* Image preview strip */
.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.upload-preview__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.upload-preview__item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.upload-preview__remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.upload-preview__remove:hover { background: var(--danger); }

/* ============================================================
   12. STAT COUNTERS
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-5);
}

.stat {
  text-align: center;
  padding: var(--space-5);
}

.stat__number {
  font-size: clamp(2rem, 4vw, var(--text-5xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  line-height: 1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-2);
}

.stat__label {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.stats--dividers .stat + .stat {
  border-left: 1px solid var(--line);
}

/* ============================================================
   13. SECTIONS
   ============================================================ */

/* --- Hero --- */
.hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(60px, 8vw, 120px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(0,122,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124,92,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero__eyebrow {
  margin-bottom: var(--space-4);
}

.hero__title {
  font-size: clamp(2.5rem, 7vw, var(--text-7xl));
  font-weight: var(--fw-bold);
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: var(--space-5);
  position: relative;
  z-index: 1;
}

.hero__subtitle {
  font-size: clamp(var(--text-base), 2.5vw, var(--text-xl));
  color: var(--text-dim);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--space-7);
  line-height: var(--leading-relaxed);
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.hero__media {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

/* Trust bar */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-6);
}

.trust-bar__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Features --- */
.features {
  padding: var(--space-10) 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

/* --- Testimonials --- */
.testimonials {
  padding: var(--space-10) 0;
  background: var(--bg-2);
}

.testimonials__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-5);
}

.testimonial {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  transition: var(--transition);
}
.testimonial:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.testimonial__stars {
  color: #fbbf24;
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
  letter-spacing: 2px;
}

.testimonial__text {
  font-size: var(--text-sm);
  color: var(--text-dim);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  font-style: italic;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-gradient);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: var(--text-sm);
}

.testimonial__name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

.testimonial__handle {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ============================================================
   14. BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--muted);
  padding: var(--space-4) 0;
}

.breadcrumb__item { display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb__link { color: var(--muted); text-decoration: none; transition: var(--transition-fast); }
.breadcrumb__link:hover { color: var(--text); }
.breadcrumb__sep { color: var(--line-strong); font-size: 10px; }
.breadcrumb__current { color: var(--text); font-weight: var(--fw-medium); }

.breadcrumb-item a, .breadcrumb-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-item a:hover, .breadcrumb-link:hover { color: var(--text); }

/* ============================================================
   15. FAQ ACCORDION
   ============================================================ */
.faq {
  padding: var(--space-10) 0;
}

.faq__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 780px;
  margin-inline: auto;
}

.faq__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.faq__item.open {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.faq__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}
.faq__question:hover { color: var(--accent); }

.faq__icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: var(--surface-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform 0.25s ease;
}
.faq__item.open .faq__icon { transform: rotate(45deg); }

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq__item.open .faq__answer { max-height: 400px; }

.faq__answer-inner {
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   16. TOOL GRID
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.2s;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.tool-card:hover::before { opacity: 0.04; }

.tool-card__icon {
  width: 48px; height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.tool-card__name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  position: relative;
  z-index: 1;
  line-height: 1.3;
}

.tool-card__desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  position: relative;
  z-index: 1;
}

.tool-card__badge {
  position: relative;
  z-index: 1;
}

/* ============================================================
   17. ARTICLE LAYOUT (3-column)
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: var(--space-8);
  align-items: start;
  padding: var(--space-8) 0;
}

.article-toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-5));
  font-size: var(--text-sm);
}

.article-toc__title {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.article-toc__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.article-toc__link {
  display: block;
  padding: var(--space-1) var(--space-3);
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid var(--line);
  transition: var(--transition-fast);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
}
.article-toc__link:hover,
.article-toc__link.active {
  color: var(--text);
  border-left-color: var(--accent);
}

.article-content {
  min-width: 0;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}
.article-content h1:first-child,
.article-content h2:first-child { margin-top: 0; }

.article-content p { margin-bottom: var(--space-5); }

.article-content ul,
.article-content ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-5);
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-bottom: var(--space-2);
  line-height: var(--leading-relaxed);
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-5);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-6) 0;
  font-style: italic;
  color: var(--text-dim);
}

.article-aside {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ============================================================
   18. CTA BAND
   ============================================================ */
.cta-band {
  padding: var(--space-10) 0;
  position: relative;
  overflow: hidden;
}

.cta-band__inner {
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 122, 255, 0.3);
}

.cta-band__inner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -25%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.cta-band__inner::after {
  content: "";
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,92,255,0.3) 0%, transparent 60%);
  pointer-events: none;
}

.cta-band h2 {
  font-size: clamp(1.75rem, 4vw, var(--text-4xl));
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.cta-band p {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.85);
  margin-inline: auto;
  margin-bottom: var(--space-7);
  position: relative;
  z-index: 1;
}

.cta-band__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.cta-band .btn--secondary {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.cta-band .btn--secondary:hover {
  background: rgba(255,255,255,0.25);
}

/* ============================================================
   19. PROGRESS / LOADING
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--lg { width: 40px; height: 40px; border-width: 3px; }
.spinner--sm { width: 16px; height: 16px; border-width: 2px; }

/* ============================================================
   20. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }

  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-toc,
  .article-aside {
    position: static;
    display: none;
  }

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

/* Mobile: <= 768px */
@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
    --space-10: 80px;
    --space-9:  64px;
    --space-8:  48px;
  }

  .nav__links,
  .nav__actions .btn { display: none; }
  .nav__toggle { display: flex; }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

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

  .features__grid,
  .testimonials__grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero__title { letter-spacing: -0.03em; }

  .hero__actions {
    flex-direction: column;
    align-items: center;
  }
  .hero__actions .btn { width: 100%; max-width: 320px; }

  .cta-band__inner { padding: var(--space-7) var(--space-5); }
  .cta-band__actions { flex-direction: column; align-items: center; }
  .cta-band__actions .btn { width: 100%; max-width: 300px; }

  .stats--dividers .stat + .stat { border-left: none; border-top: 1px solid var(--line); }

  .trust-bar { gap: var(--space-4); }

  .upload-zone { min-height: 200px; padding: var(--space-6) var(--space-4); }

  .article-content h1,
  .article-content h2 { margin-top: var(--space-6); }
}

/* Small mobile: <= 480px */
@media (max-width: 480px) {
  .container { padding-inline: var(--space-4); }

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

  .btn--xl { height: 54px; padding: 0 var(--space-6); font-size: var(--text-base); }

  .card { padding: var(--space-4); }
  .faq__question { padding: var(--space-4); }
  .faq__answer-inner { padding: 0 var(--space-4) var(--space-4); }
}

/* ============================================================
   21. ANIMATIONS
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0,122,255,0.2); }
  50%       { box-shadow: 0 0 40px rgba(0,122,255,0.5); }
}

/* Animation utility classes */
.animate-fade-up    { animation: fadeUp 0.5s ease both; }
.animate-fade-in    { animation: fadeIn 0.3s ease both; }
.animate-scale-in   { animation: scaleIn 0.3s ease both; }
.animate-float      { animation: float 3s ease-in-out infinite; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-glow       { animation: glow 2.5s ease-in-out infinite; }

/* Stagger delays */
.delay-1  { animation-delay: 0.1s; }
.delay-2  { animation-delay: 0.2s; }
.delay-3  { animation-delay: 0.3s; }
.delay-4  { animation-delay: 0.4s; }
.delay-5  { animation-delay: 0.5s; }

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface) 25%,
    var(--surface-strong) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* Scroll reveal (JS adds .revealed) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

/* ============================================================
   22. MISC UTILITY
   ============================================================ */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--muted);
  font-size: var(--text-sm);
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tooltip {
  position: relative;
  display: inline-flex;
}
.tooltip__content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.tooltip:hover .tooltip__content { opacity: 1; }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.dot--green { background: var(--success); }
.dot--blue  { background: var(--accent); }
.dot--pulse { animation: pulse 2s ease-in-out infinite; }

.pill-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}

.pill-group__btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition-fast);
  background: none;
  border: none;
}
.pill-group__btn.active,
.pill-group__btn:hover {
  background: var(--surface-strong);
  color: var(--text);
}
.pill-group__btn.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   23. SIDEBAR LAYOUT
   ============================================================ */

/* Layout wrapper */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #161820;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 200;
}

/* Main content offset */
.main-content {
  margin-left: 240px;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   TOP BAR - Pricing + Log in (all pages, desktop)
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-crumb {
  min-width: 0;
  display: flex;
  align-items: center;
}
/* Breadcrumb sits inline in the top bar - strip its own padding */
.topbar-crumb .breadcrumbs { padding: 0; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}
.topbar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.topbar-cta {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 10px;
  transition: background 0.15s;
}
.topbar-cta:hover { background: var(--accent-hover); color: #fff; }
@media (max-width: 900px) {
  .topbar { display: none; }
}

/* Sidebar logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  font-weight: 700;
  font-size: 1rem;
  color: #f0f2f7;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.sidebar-logo:hover { color: #f0f2f7; }
.sidebar-logo svg { flex-shrink: 0; }

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #5f6673;
  padding: 12px 16px 6px;
  text-transform: uppercase;
}

.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #8b90a0;
  text-decoration: none;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
}
.sidebar-link:hover {
  color: #f0f2f7 !important;
  background: rgba(255, 255, 255, 0.05);
}
.sidebar-link.active {
  color: #007aff;
  background: rgba(0, 122, 255, 0.1);
}
.sidebar-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-login-btn {
  display: block;
  text-align: center;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #8b90a0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-login-btn:hover {
  color: #f0f2f7 !important;
  border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-signup-btn {
  display: block;
  text-align: center;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: #007aff;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-signup-btn:hover {
  background: #0a84ff;
  color: #fff !important;
}

/* ---- Footer login card + utility icons (Pixlr-style) ---- */
.sidebar-login-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-login-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}
.login-card-icon { color: #c0c4d0; flex-shrink: 0; display: flex; }
.login-card-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.login-card-text strong { color: #f0f2f7; font-size: 0.9rem; font-weight: 700; }
.login-card-text span { color: #8b90a0; font-size: 0.78rem; }

.sidebar-footer-icons {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  margin-top: 4px;
}
.footer-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 38px;
  border: none;
  background: transparent;
  color: #8b90a0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.footer-icon-btn:hover { color: #f0f2f7; background: rgba(255, 255, 255, 0.06); }

/* ============================================================
   MODALS - What's New + Settings
   ============================================================ */
.fs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1000;
}
.fs-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: #1c1f2a;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  overflow: hidden;
}
.fs-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #c0c4d0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fs-modal-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.fs-modal-head {
  padding: 26px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.fs-modal-title { font-size: 1.4rem; font-weight: 800; color: #f0f2f7; margin: 0 0 6px; letter-spacing: -0.02em; }
.fs-modal-sub { font-size: 0.9rem; color: #8b90a0; margin: 0; }
.fs-modal-body { padding: 12px 28px 26px; overflow-y: auto; }

/* What's New list */
.whatsnew-list { list-style: none; margin: 0; padding: 0; }
.whatsnew-item { padding: 18px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.whatsnew-item:last-child { border-bottom: none; }
.whatsnew-date {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #007aff);
  margin-bottom: 6px;
}
.whatsnew-item h3 { font-size: 1.02rem; font-weight: 700; color: #f0f2f7; margin: 0 0 6px; }
.whatsnew-item p { font-size: 0.92rem; color: #c0c4d0; line-height: 1.6; margin: 0; }
.whatsnew-item a { color: var(--accent, #007aff); text-decoration: none; }
.whatsnew-item a:hover { text-decoration: underline; }

/* Settings rows + toggles */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { display: flex; flex-direction: column; gap: 3px; }
.settings-label strong { font-size: 0.95rem; font-weight: 600; color: #f0f2f7; }
.settings-label span { font-size: 0.84rem; color: #8b90a0; }
.fs-toggle {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.18s ease;
}
.fs-toggle[aria-checked="true"] { background: var(--accent, #007aff); }
.fs-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.fs-toggle[aria-checked="true"] .fs-toggle-knob { transform: translateX(20px); }

/* Output watermark is burned into the result image server-side (see routes._watermark_image). */

/* Featured (colorful) sidebar link icon, e.g. Gallery */
.sidebar-link-img { width: 20px; height: 20px; flex-shrink: 0; display: block; border-radius: 5px; }
.sidebar-link--featured { color: #f0f2f7; }

/* ---- Logged-in vs anonymous UI toggling ---- */
.topbar-anon { display: contents; }
.topbar-loggedin { display: none; }
body:not(.fs-anon) .topbar-anon { display: none; }
body:not(.fs-anon) .topbar-loggedin { display: contents; }
.js-auth-in { display: none; }
body:not(.fs-anon) .js-auth-out { display: none; }
body:not(.fs-anon) .js-auth-in { display: flex; }
.js-logout { cursor: pointer; background: none; border: none; font: inherit; }

/* ============================================================
   SHARED PROGRESS BAR (estimated) for tool loading states
   ============================================================ */
.fs-progress {
  width: 100%;
  max-width: 320px;
  height: 6px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}
.fs-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent, #007aff);
  transition: width 0.7s ease;
}

/* Reduce motion preference */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
  scroll-behavior: auto !important;
}

/* ============================================================
   CREDIT METER + PREMIUM (out of credits) MODAL
   ============================================================ */
.credit-meter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  color: var(--text, #f0f2f7);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.credit-meter:hover { border-color: var(--accent, #007aff); background: var(--accent-dim, rgba(0,122,255,0.08)); }
.credit-meter-gem { color: var(--accent, #007aff); flex-shrink: 0; }
.credit-meter-label { color: var(--muted, #8b90a0); font-weight: 600; }
.credit-meter--empty { border-color: rgba(248,113,113,0.5); }
.credit-meter--empty .credit-meter-gem { color: #f87171; }
/* compact variant in the top bar */
.credit-meter--top { width: auto; padding: 7px 11px; }
.credit-meter--top .credit-meter-gem { width: 15px; height: 15px; }

/* Premium modal */
.premium-modal { width: min(540px, calc(100vw - 32px)); }

/* Sign-up gate extras */
.gate-perks { list-style: none; margin: 0 0 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; background: rgba(255,255,255,0.03); border: 1px solid var(--line, rgba(255,255,255,0.10)); border-radius: 14px; }
.gate-perks li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9rem; color: var(--text-dim, #c0c4d0); line-height: 1.4; }
.gate-perks svg { flex-shrink: 0; color: #34c759; margin-top: 1px; }
.gate-perks b { color: var(--text, #f0f2f7); }
.gate-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: 11px; background: #fff; color: #1f2330; font-weight: 700; font-size: 0.95rem; text-decoration: none; border: 1px solid rgba(0,0,0,0.1); transition: opacity 0.15s; margin-bottom: 10px; }
.gate-google:hover { opacity: 0.9; color: #1f2330; }
.gate-google svg { width: 18px; height: 18px; }
.gate-fullbtn { display: block; width: 100%; text-align: center; padding: 13px; }
.gate-foot { text-align: center; font-size: 0.86rem; color: var(--text-dim, #c0c4d0); margin: 16px 0 0; }
.gate-foot a { color: var(--accent, #007aff); font-weight: 600; text-decoration: none; }
.gate-note { text-align: center; color: var(--muted, #8b90a0); font-size: 0.8rem; margin: 8px 0 0; }
.premium-head { text-align: center; }
.premium-spark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px; height: 54px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--accent-dim, rgba(0,122,255,0.14));
  color: var(--accent, #007aff);
}
.premium-ways { display: flex; flex-direction: column; gap: 12px; }
.premium-way {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.premium-way--featured { border-color: var(--accent, #007aff); background: var(--accent-dim, rgba(0,122,255,0.07)); }
.premium-way-icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 11px;
  background: rgba(255,255,255,0.05);
  color: var(--accent, #007aff);
}
.premium-way-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.premium-way-text strong { font-size: 0.97rem; font-weight: 700; color: var(--text, #f0f2f7); }
.premium-way-text span { font-size: 0.86rem; color: var(--text-dim, #c0c4d0); line-height: 1.45; }
.premium-way-text b { color: var(--text, #f0f2f7); font-weight: 700; }
.premium-way-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line-strong, rgba(255,255,255,0.18));
  color: var(--text, #f0f2f7);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.premium-way-btn:hover { background: rgba(255,255,255,0.06); color: var(--text, #f0f2f7); }
.premium-way-btn--primary { background: var(--accent, #007aff); border-color: var(--accent, #007aff); color: #fff; }
.premium-way-btn--primary:hover { background: var(--accent-hover, #0a84ff); color: #fff; }
@media (max-width: 520px) {
  .premium-way { flex-wrap: wrap; }
  .premium-way-btn { width: 100%; text-align: center; }
}

/* ============================================================
   SIDEBAR - collapse / expand + "More" flyout
   ============================================================ */
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.sidebar-head .sidebar-logo {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

/* Edge chevron toggle straddling the sidebar's right border */
.sidebar-edge-toggle {
  position: fixed;
  top: 26px;
  left: 227px; /* 240 sidebar width - 13 */
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c1f2a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #c0c4d0;
  cursor: pointer;
  z-index: 250;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: left 0.2s ease, background 0.15s, color 0.15s;
}
.sidebar-edge-toggle:hover { background: #262b39; color: #fff; }
.sb-edge-chevron { transition: transform 0.2s ease; }
.sidebar-collapsed .sb-edge-chevron { transform: rotate(180deg); } /* points right > to expand */

/* "More" trigger (inline in nav) */
.sidebar-more { margin-bottom: 8px; }
.sidebar-more-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #8b90a0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}
.sidebar-more-btn:hover,
.sidebar-more-btn[aria-expanded="true"] {
  color: #f0f2f7;
  background: rgba(255, 255, 255, 0.05);
}
.sidebar-more-btn .sb-more-dots { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-more-label { flex: 1; }
.sidebar-more-caret { flex-shrink: 0; color: #5f6673; }

/* "More" flyout panel (popout to the right of the sidebar) */
.sidebar-more-panel {
  position: fixed;
  z-index: 300;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
  background: #1c1f2a;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  padding: 22px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.sidebar-more-panel .sidebar-section { margin-bottom: 0; min-width: 140px; }
.sidebar-more-panel .sidebar-section-label {
  padding: 0 0 12px;
  color: #8b90a0;
  font-size: 0.68rem;
}
.sidebar-more-panel .sidebar-link {
  padding: 7px 0 !important;
  gap: 0 !important;
  font-size: 0.92rem !important; /* override collapsed icon-only rule */
  justify-content: flex-start !important;
  color: #c0c4d0;
  background: transparent;
}
.sidebar-more-panel .sidebar-link svg { display: none; }
.sidebar-more-panel .sidebar-link:hover {
  background: transparent;
  color: #fff !important;
}

/* ---- Collapsed (icon-only) state - desktop only ---- */
@media (min-width: 901px) {
  .sidebar { transition: width 0.2s ease, min-width 0.2s ease; }
  .main-content { transition: margin-left 0.2s ease; }

  .sidebar-collapsed .sidebar {
    width: 72px;
    min-width: 72px;
  }
  .sidebar-collapsed .main-content {
    margin-left: 72px;
  }
  .sidebar-collapsed .sidebar-edge-toggle { left: 59px; } /* 72 - 13 */
  .sidebar-collapsed .sidebar-head {
    justify-content: center;
    padding-left: 0;
  }
  .sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 16px 0 14px;
    gap: 0;
  }
  .sidebar-collapsed .sidebar-logo span { display: none; }
  .sidebar-collapsed .sidebar-section-label { display: none; }
  .sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    font-size: 0; /* hides the bare text label, keeps the SVG */
    padding: 11px 0;
  }
  .sidebar-collapsed .sidebar-link svg { width: 20px; height: 20px; }
  .sidebar-collapsed .sidebar-more-btn {
    justify-content: center;
    gap: 0;
    font-size: 0;
    padding: 11px 0;
  }
  .sidebar-collapsed .sidebar-more-btn .sb-more-dots { width: 20px; height: 20px; }
  .sidebar-collapsed .sidebar-more-label,
  .sidebar-collapsed .sidebar-more-caret { display: none; }
  .sidebar-collapsed .sidebar-footer { display: none; }
}

/* Reusable FAQ accordion (tool pages, create pages) */
.faq-section { padding: 56px 0 8px; }
.faq-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.faq-heading { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--text, #f0f2f7); text-align: center; margin: 0 0 28px; letter-spacing: -0.02em; }
.faq-item { border: 1px solid var(--line, rgba(255,255,255,0.10)); border-radius: 12px; background: var(--bg-2, #161820); margin-bottom: 12px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; font-size: 0.95rem; color: var(--text, #f0f2f7); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.25rem; color: var(--accent, #007aff); flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-a { padding: 0 20px 16px; font-size: 0.92rem; color: var(--text-dim, #c0c4d0); line-height: 1.65; }
.faq-a a { color: var(--accent, #007aff); }

/* Floating tooltip for the collapsed (icon-only) sidebar */
.sb-tip {
  position: fixed;
  z-index: 500;
  background: #1c1f2a;
  color: #f0f2f7;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Hide the edge toggle on mobile (sidebar becomes a slide-in drawer) */
@media (max-width: 900px) {
  .sidebar-edge-toggle { display: none; }
}

/* Mobile header */
.mobile-header {
  display: none;
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
}

/* Mobile */
@media (max-width: 900px) {
  /* Stack the shell vertically so the in-flow mobile header sits ABOVE the
     content instead of beside it (the fixed sidebar is out of flow). Without
     this the sticky header is a flex-row sibling and starves .main-content. */
  .layout {
    flex-direction: column;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: #161820;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    color: #f0f2f7;
    flex-shrink: 0;
  }
  .mobile-menu-btn:hover { background: rgba(255, 255, 255, 0.1); }
  .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #f0f2f7;
    text-decoration: none;
  }
  .mobile-logo:hover { color: #f0f2f7; }
  .mobile-logo svg { flex-shrink: 0; }
  .mobile-signup-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: #007aff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
  }
  /* "Log out" variant (on the account page) reads as a secondary action */
  .mobile-signup-btn.js-logout {
    background: transparent;
    color: var(--text-dim, #c0c4d0);
    border: 1px solid var(--line-strong, rgba(255,255,255,0.18));
  }
  .mobile-signup-btn:hover { background: #0a84ff; color: #fff; }

  /* Sidebar overlay on mobile */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.overlay-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================
   BREADCRUMB - non-BEM class names used in templates
   ============================================================ */
.breadcrumbs {
  padding: 16px 24px 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
}
.breadcrumb-item a,
.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-item a:hover,
.breadcrumb-link:hover { color: var(--text); }
.breadcrumb-separator,
.breadcrumb-sep {
  color: rgba(255,255,255,0.2);
  margin: 0 4px;
  user-select: none;
}
.breadcrumb-current,
.breadcrumb-item.breadcrumb-current {
  color: var(--text-dim);
  font-weight: 500;
}

/* ============================================================
   TOOL PAGE - hero, upload, steps, related tools
   ============================================================ */
.tool-hero {
  padding: 40px 24px 24px;
}
.tool-hero-inner {
  max-width: 760px;
}
.tool-hero-h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.tool-hero-intro {
  font-size: 1.0625rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 60ch;
}

.page-hero-visual {
  padding: 0 24px 40px;
}
.page-hero-img {
  width: 100%;
  max-width: 860px;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  display: block;
}

/* Upload UI */
.tool-ui-section {
  padding: 0 24px 40px;
}
.tool-ui-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  max-width: 700px;
}
.upload-zone {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255,255,255,0.02);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone:hover,
.upload-zone:focus-within,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(0,122,255,0.04);
  outline: none;
}
.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.upload-icon { margin-bottom: 4px; }
.upload-label {
  font-size: 0.9375rem;
  color: var(--text-dim);
  margin: 0;
  max-width: none;
}
.upload-hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  max-width: none;
}

/* Preview */
.upload-preview {
  position: relative;
  margin-top: 16px;
}
.preview-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
}
.btn-remove-upload {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-remove-upload:hover { background: rgba(220,38,38,0.7); }

/* Consent */
.consent-block {
  margin-top: 20px;
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
}
.consent-input {
  flex-shrink: 0;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.consent-text { max-width: none; }
.consent-link { color: var(--accent); }

/* Generate button */
.btn-generate {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-generate:hover:not(:disabled) { background: var(--accent-hover); }
.btn-generate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-generate-icon { flex-shrink: 0; }

/* Safety note */
.tool-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(124,92,255,0.08);
  border: 1px solid rgba(124,92,255,0.2);
  border-radius: 10px;
}
.safety-note-icon { flex-shrink: 0; margin-top: 1px; }
.safety-note-text {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
  max-width: none;
  line-height: 1.5;
}
.safety-note-link { color: var(--accent); }

/* How-to steps */
.how-to-section {
  padding: 0 24px 40px;
}
.how-to-inner { max-width: 1040px; margin: 0 auto; }
.how-to-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin-bottom: 28px;
}
.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.how-to-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0,122,255,0.3);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-body { flex: 1; }
.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.step-desc {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
  max-width: none;
}

/* Related tools grid */
.related-tools-section {
  padding: 8px 24px 48px;
}
.related-tools-inner { max-width: 1040px; margin: 0 auto; }
.related-tools-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-tool-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.related-tool-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}
.related-tool-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
}
.related-tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.related-tool-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.related-tool-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.related-tool-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}
.related-tool-arrow {
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  transition: transform 0.2s, color 0.2s;
}
.related-tool-card:hover .related-tool-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Footer CTA links */
.tool-footer-links {
  padding: 0 24px 48px;
}
.tool-footer-links-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
}
.tool-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.tool-cta-link:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
}

/* ============================================================
   MAGAZINE SECTIONS (shared by index + tool pages)
   ============================================================ */
.mag-section { padding: 64px 0; }
.mag-row { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 0 32px; }
/* Reverse rows are authored image-first in the DOM, so they naturally
   render image-left / text-right - no direction flip needed. */
.mag-row--reverse { }
/* Eyebrow labels removed site-wide for a cleaner, more professional look */
.mag-eyebrow { display: none !important; }
.mag-heading { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 16px; color: var(--text); }
.mag-body { font-size: 1.0625rem; color: var(--muted); line-height: 1.7; max-width: 48ch; margin-bottom: 24px; }
.mag-link { font-size: 0.9375rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.mag-link:hover { text-decoration: underline; }
.mag-img { width: 100%; border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,0.45); display: block; }
@media (max-width: 768px) { .mag-row, .mag-row--reverse { grid-template-columns: 1fr; direction: ltr; gap: 28px; } }

/* tool hero split */
.tool-hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 48px 32px 32px; }
.tool-hero-split .lead { font-size: 1.125rem; color: var(--text-dim); line-height: 1.65; margin: 16px 0 28px; }
.tool-hero-split-img { width: 100%; border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,0.5); display: block; }
@media (max-width: 768px) { .tool-hero-split { grid-template-columns: 1fr; gap: 28px; padding: 24px 20px; } }

/* Before/After comparison slider */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
  background: var(--bg-2);
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-before { clip-path: inset(0 50% 0 0); }
.ba-divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; background: #fff; transform: translateX(-50%);
  pointer-events: none; box-shadow: 0 0 12px rgba(0,0,0,0.45);
}
.ba-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: #0f1117;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.45);
}
.ba-tag {
  position: absolute; top: 12px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,0.55); padding: 4px 10px; border-radius: 7px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); pointer-events: none;
}
.ba-tag-before { left: 12px; }
.ba-tag-after { right: 12px; }
.ba-range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: ew-resize;
}

/* tool result + loading */
.tool-loading { display: none; align-items: center; gap: 12px; margin-top: 20px; color: var(--text-dim); }
.tool-spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent); border-radius: 50%; animation: toolspin 0.8s linear infinite; }
@keyframes toolspin { to { transform: rotate(360deg); } }
.tool-result { display: none; margin-top: 20px; }
.tool-result img { width: 100%; border-radius: 12px; display: block; margin-bottom: 12px; }
.tool-error { display: none; margin-top: 16px; color: #f87171; font-size: 0.9rem; }

/* ============================================================
   FACE-SWAP DUAL-UPLOAD PANEL (shared: homepage, gif, video)
   ============================================================ */
.hero-panel-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text, #f0f2f7);
  margin: 0 0 4px;
}
.hero-panel-note {
  font-size: 0.8125rem;
  color: var(--muted, #8b90a0);
  margin: 0 0 20px;
}
.gfs-slots {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.gfs-slot {
  position: relative;
  min-height: 168px;
  border: 2px dashed var(--line-strong, rgba(255,255,255,0.18));
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 18px 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.gfs-slot:hover,
.gfs-slot.dragover {
  border-color: var(--accent, #007aff);
  background: var(--accent-dim, rgba(0,122,255,0.10));
}
.gfs-slot.loading { opacity: 0.6; pointer-events: none; }
.gfs-slot.has-file {
  border-style: solid;
  border-color: var(--accent, #007aff);
  background: var(--bg-3, #1c1f2b);
}
.gfs-slot-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-dim, rgba(0,122,255,0.15));
  color: var(--accent, #007aff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gfs-slot.has-file .gfs-slot-icon { display: none; }
.gfs-slot-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text, #f0f2f7);
}
.gfs-slot-hint {
  font-size: 0.8125rem;
  color: var(--muted, #8b90a0);
}
.gfs-slot.has-file .gfs-slot-hint { display: none; }
.gfs-arrow {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-3, #1c1f2b);
  border: 1px solid var(--line, rgba(255,255,255,0.10));
  color: var(--accent, #007aff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gfs-preview { display: none; width: 100%; position: relative; }
.gfs-thumb {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 12px;
}
.gfs-remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(10,12,18,0.78);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}
.gfs-remove:hover { background: rgba(220,38,38,0.85); }
.gfs-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-dim, #c0c4d0);
  cursor: pointer;
}
.gfs-consent input {
  margin-top: 2px;
  width: 16px; height: 16px;
  accent-color: var(--accent, #007aff);
  flex-shrink: 0;
  cursor: pointer;
}
.gfs-generate { width: 100%; }
.gfs-loading {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-dim, #c0c4d0);
  margin-top: 16px;
}
.gfs-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line-strong, rgba(255,255,255,0.2));
  border-top-color: var(--accent, #007aff);
  border-radius: 50%;
  animation: gfs-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes gfs-spin { to { transform: rotate(360deg); } }
.gfs-error {
  display: none;
  font-size: 0.8125rem;
  color: #f87171;
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.30);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
}
.gfs-result { display: none; margin-top: 4px; }
.gfs-hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted, #8b90a0);
}

/* Horizontal "how it works" stepper with arrows */
.how-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}
.how-step-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.how-step-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-dim, rgba(0,122,255,0.15));
  color: var(--accent, #007aff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.how-step-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text, #f0f2f7);
  margin: 0;
}
.how-step-desc {
  font-size: 0.875rem;
  color: var(--muted, #8b90a0);
  line-height: 1.55;
  margin: 0;
  max-width: none;
}
.how-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: center;
  color: var(--line-strong, rgba(255,255,255,0.25));
  padding-top: 6px;
}
@media (max-width: 768px) {
  .how-row { flex-direction: column; align-items: stretch; gap: 20px; }
  /* Keep the icon / title / description stacked vertically on mobile.
     Switching to row put title + desc in cramped columns (titles wrapped
     one word per line). */
  .how-step-card { flex-direction: column; }
  .how-arrow { transform: rotate(90deg); align-self: center; padding: 0; }
}
@media (max-width: 600px) {
  .gfs-slots { grid-template-columns: 1fr; }
  .gfs-arrow { transform: rotate(90deg); margin: 0 auto; }
}

/* ============================================================
   END OF DESIGN SYSTEM
   ============================================================ */
