/* ============================================================
   REPEATLY — Design System & Custom Styles
   ============================================================ */

/* --- CSS Custom Properties (Dark Theme — Default) --- */
:root {
  /* Backgrounds */
  --bg-base: #080A0F;
  --bg-elevated: #0E1118;
  --bg-card: #121620;
  --bg-secondary: #171C27;

  /* Text */
  --text-primary: #F7F8FA;
  --text-secondary: #9CA3AF;
  --text-muted: #697386;

  /* Accent */
  --accent-primary: #7C5CFC;
  --accent-secondary: #A78BFA;
  --accent-highlight: #22D3EE;

  /* Status */
  --color-success: #22C55E;
  --color-warning: #F59E0B;
  --color-error: #EF4444;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #7C5CFC, #9F7AEA);
  --gradient-hero-word: linear-gradient(135deg, #7C5CFC, #A78BFA, #22D3EE);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(124, 92, 252, 0.15) 0%, transparent 60%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(124, 92, 252, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(124, 92, 252, 0.25);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transition */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --content-max-width: 1200px;
  --nav-height: 64px;
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-base: #F7F8FC;
  --bg-elevated: #F1F3F8;
  --bg-card: #FFFFFF;
  --bg-secondary: #E8EBF0;

  --text-primary: #111827;
  --text-secondary: #667085;
  --text-muted: #9CA3AF;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 20px rgba(124, 92, 252, 0.10);
  --shadow-glow-strong: 0 0 30px rgba(124, 92, 252, 0.15);

  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(124, 92, 252, 0.08) 0%, transparent 60%);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* ============================================================
   TYPOGRAPHY — Responsive clamp()
   ============================================================ */
.text-hero {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.text-section {
  font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-card-title {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: clamp(0.938rem, 1vw + 0.25rem, 1.063rem);
  line-height: 1.7;
  color: var(--text-secondary);
}

.text-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Gradient text */
.gradient-text {
  background: var(--gradient-hero-word);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container { padding: 0 2rem; }
}

@media (min-width: 1280px) {
  .container { padding: 0 2.5rem; }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition-smooth),
              border-color var(--transition-smooth),
              backdrop-filter var(--transition-smooth);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background-color: rgba(8, 10, 15, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom-color: var(--border-subtle);
}

[data-theme="light"] .nav.scrolled {
  background-color: rgba(247, 248, 252, 0.85);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .nav-inner { padding: 0 2rem; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.nav-logo svg {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-link {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-secondary);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root .theme-toggle .icon-sun { display: none; }
:root .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 3rem) 0 2rem;
  text-align: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero { padding: calc(var(--nav-height) + 4rem) 0 3rem; }
}

/* Ambient background */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(124, 92, 252, 0.12) 0%, transparent 70%);
  animation: ambient-pulse 8s ease-in-out infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 70%);
  animation: ambient-pulse 10s ease-in-out infinite 2s;
}

/* Dot grid texture */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: badge-pulse 2s ease-in-out infinite;
}

.hero h1 {
  animation: fadeInUp 0.6s ease-out 0.1s both;
  position: relative;
  z-index: 1;
}

.hero-description {
  max-width: 520px;
  margin: 1.25rem auto 2rem;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
}

/* Floating emoji particles */
.hero-particle {
  position: absolute;
  font-size: 2rem;
  opacity: 0.15;
  animation: float-particle 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero-particle:nth-child(1) { top: 15%; left: 8%; animation-delay: 0s; font-size: 2.5rem; }
.hero-particle:nth-child(2) { top: 12%; right: 8%; animation-delay: 3s; font-size: 2rem; }
.hero-particle:nth-child(3) { bottom: 25%; left: 15%; animation-delay: 6s; font-size: 1.5rem; }
.hero-particle:nth-child(4) { bottom: 30%; right: 12%; animation-delay: 4s; font-size: 1.8rem; }
.hero-particle:nth-child(5) { top: 40%; left: 3%; animation-delay: 7s; font-size: 1.2rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.938rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
}

.btn-primary:active {
  transform: scale(0.97) translateY(0);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Success state */
.btn-success {
  background: var(--color-success) !important;
  color: #fff !important;
  border-color: var(--color-success) !important;
}

/* Large */
.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Full width on mobile */
@media (max-width: 640px) {
  .btn-full-mobile { width: 100%; }
}

/* ============================================================
   TOOL SWITCHER
   ============================================================ */
.tool-switcher {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto 2.5rem;
  padding: 5px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.tool-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius-xl) - 4px);
  font-size: 0.938rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  transition: color var(--transition-fast);
  position: relative;
  z-index: 1;
}

.tool-tab:hover {
  color: var(--text-secondary);
}

.tool-tab.active {
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow);
}

.tool-tab:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.tool-tab svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   WORKSPACE
   ============================================================ */
.workspace {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast);
}

.workspace:hover {
  border-color: var(--border-medium);
}

@media (min-width: 768px) {
  .workspace { padding: 2rem; }
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* Workspace panels */
.workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
/* Labels */
.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.form-label-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-label-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* Textarea */
.form-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 300px;
  resize: vertical;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.938rem;
  line-height: 1.6;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

/* Number input group */
.number-input-group {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  overflow: hidden;
}

.number-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.number-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.number-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.number-input {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  min-width: 0;
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.number-input:focus {
  outline: none;
}

/* Quick select chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.813rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  font-weight: 600;
}

.chip:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Separator selector */
.separator-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sep-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.813rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sep-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.sep-chip.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.sep-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sep-chip.active .dot {
  background: #fff;
}

.sep-chip:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Custom separator input */
.custom-sep-wrap {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--transition-smooth), opacity var(--transition-smooth), margin var(--transition-smooth);
  margin-top: 0;
}

.custom-sep-wrap.visible {
  max-height: 60px;
  opacity: 1;
  margin-top: 0.5rem;
}

.custom-sep-input {
  width: 100%;
  height: 38px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-sep-input::placeholder {
  color: var(--text-muted);
}

.custom-sep-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

/* Emoji input */
.emoji-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.emoji-input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

.emoji-input {
  font-size: 2.5rem;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-primary);
  width: 100%;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.emoji-input:focus {
  outline: none;
}

.emoji-input::placeholder {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Quick emoji suggestions */
.emoji-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emoji-suggestion {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.emoji-suggestion:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

.emoji-suggestion:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Emoji categories */
.emoji-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.emoji-cat {
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.emoji-cat:hover {
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.emoji-cat.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.emoji-cat:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ============================================================
   OUTPUT PANEL
   ============================================================ */
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.output-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.output-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.output-badge.ready {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}

.output-badge.generating {
  background: rgba(124, 92, 252, 0.12);
  color: var(--accent-primary);
}

.output-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Output display */
.output-display {
  min-height: 180px;
  max-height: 350px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

/* Custom scrollbar */
.output-display::-webkit-scrollbar {
  width: 6px;
}

.output-display::-webkit-scrollbar-track {
  background: transparent;
}

.output-display::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.output-display::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Empty state */
.output-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  gap: 0.75rem;
  color: var(--text-muted);
}

.output-empty svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
  animation: sparkle-pulse 3s ease-in-out infinite;
}

.output-empty p {
  font-size: 0.875rem;
}

/* Output actions */
.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .output-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   FEATURE CARDS
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 3rem 0;
}

@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.feature-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

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

/* ============================================================
   PRIVACY BADGE (inline)
   ============================================================ */
.privacy-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.813rem;
  color: var(--text-secondary);
  max-width: max-content;
  margin: 0 auto 3rem;
}

.privacy-inline svg {
  width: 18px;
  height: 18px;
  color: var(--color-success);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-section {
  margin: 3rem 0;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-medium);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.938rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.faq-question svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-smooth);
  flex-shrink: 0;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth);
}

.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}

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

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.5fr; }
}

.footer-brand p {
  font-size: 0.813rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 240px;
}

.footer-heading {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  font-size: 0.813rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.footer-privacy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  flex-shrink: 0;
}

.footer-privacy-icon svg {
  width: 18px;
  height: 18px;
}

.footer-privacy-text h4 {
  font-size: 0.813rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.footer-privacy-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent-secondary);
  text-decoration: none;
}

/* ============================================================
   WARNING / ERROR
   ============================================================ */
.inline-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
  font-size: 0.813rem;
  font-weight: 500;
}

.inline-warning svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.inline-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-error);
  font-size: 0.813rem;
  font-weight: 500;
}

.inline-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   TOOL PANEL VISIBILITY
   ============================================================ */
.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* ============================================================
   SCREEN READER ONLY
   ============================================================ */
.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;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes ambient-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes float-particle {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  25% { transform: translateY(-12px) rotate(3deg); opacity: 0.25; }
  50% { transform: translateY(-6px) rotate(-2deg); opacity: 0.15; }
  75% { transform: translateY(-18px) rotate(4deg); opacity: 0.2; }
}

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 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;
  }
}

/* --- Support Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.qr-code-wrapper {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
}

.qr-code-img {
  width: 200px;
  height: auto;
  display: block;
}
