/* ============================================
   Grammar-Check.in Design System
   Modern, Dark-Mode-First, Premium Design
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors - Dark Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(15, 23, 42, 0.6);
  --bg-tool: #1a1f2e;

  /* Brand Colors */
  --brand-primary: #10b981;
  --brand-primary-light: #34d399;
  --brand-primary-dark: #059669;
  --brand-accent: #8b5cf6;
  --brand-accent-light: #a78bfa;
  --brand-warning: #f59e0b;
  --brand-error: #ef4444;
  --brand-info: #3b82f6;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --gradient-brand: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
  --gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  --gradient-cta: linear-gradient(135deg, #10b981 0%, #8b5cf6 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15) 0%, transparent 60%);

  /* Borders */
  --border-color: rgba(148, 163, 184, 0.1);
  --border-highlight: rgba(16, 185, 129, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.2);
  --shadow-glow-accent: 0 0 30px rgba(139, 92, 246, 0.2);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 900px;
  --header-height: 72px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-primary-light); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

::selection {
  background: var(--brand-primary);
  color: var(--text-inverse);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}
.container--narrow {
  max-width: var(--container-narrow);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Background Animations --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.1); }
  50% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.25); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}
.site-header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: var(--shadow-lg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: var(--font-size-xl);
}
.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-bounce);
}
.logo:hover .logo-icon {
  transform: rotate(-10deg) scale(1.1);
}
.logo-text {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.nav-links a {
  position: relative;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(16, 185, 129, 0.1);
}
.nav-links a.active {
  color: var(--brand-primary);
}
.nav-links a.nav-cta {
  background: var(--gradient-brand);
  color: white;
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.nav-links a.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-dropdown-trigger::after {
  content: '';
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 2px;
  transition: transform var(--transition-fast);
}
.nav-dropdown:hover .nav-dropdown-trigger::after {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
.nav-dropdown-menu a:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-primary);
}
.nav-dropdown-menu a .tool-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  cursor: pointer;
}
.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  padding-top: calc(var(--header-height) + var(--space-3xl));
  padding-bottom: var(--space-2xl);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glow);
  pointer-events: none;
}

/* Animated mesh background */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}
.hero-bg .orb-1 {
  width: 400px;
  height: 400px;
  background: var(--brand-primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}
.hero-bg .orb-2 {
  width: 300px;
  height: 300px;
  background: var(--brand-accent);
  bottom: -50px;
  left: -50px;
  animation-delay: -3s;
}
.hero-bg .orb-3 {
  width: 200px;
  height: 200px;
  background: var(--brand-info);
  top: 50%;
  left: 50%;
  animation-delay: -5s;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--brand-primary-light);
  font-weight: 500;
  margin-bottom: var(--space-lg);
}
.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.hero h1 {
  font-size: var(--font-size-5xl);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}
.hero h1 .highlight {
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

/* ============================================
   TOOL AREA
   ============================================ */
.tool-section {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) 0 var(--space-4xl);
}
@media (max-width: 768px) {
  .tool-section {
    padding: var(--space-md) 0 var(--space-xl);
  }
}

.tool-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.tool-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.tool-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}
.tool-header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Textarea / Editor */
.tool-editor {
  position: relative;
  min-height: 300px;
}
.tool-textarea {
  width: 100%;
  min-height: 300px;
  padding: var(--space-xl);
  background: var(--bg-tool);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: background var(--transition-fast);
}
.tool-textarea::placeholder {
  color: var(--text-muted);
}
.tool-textarea:focus {
  background: rgba(26, 31, 46, 0.9);
}

/* Content Editable Area (for highlighting) */
.editor-area {
  position: relative;
  min-height: 300px;
  padding: var(--space-xl);
  background: var(--bg-tool);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.8;
  outline: none;
  overflow-y: auto;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.editor-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Error Highlighting */
.error-highlight {
  position: relative;
  cursor: pointer;
  border-radius: 2px;
  transition: background var(--transition-fast);
  text-decoration: underline wavy;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.error-highlight.spelling {
  text-decoration-color: var(--brand-error);
  background: rgba(239, 68, 68, 0.15);
}
.error-highlight.grammar {
  text-decoration-color: var(--brand-info);
  background: rgba(59, 130, 246, 0.15);
}
.error-highlight.style {
  text-decoration-color: var(--brand-accent);
  background: rgba(139, 92, 246, 0.15);
}
.error-highlight:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Suggestion Popup */
.suggestion-popup {
  position: absolute;
  z-index: 100;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.2s ease-out;
  display: none;
}
.suggestion-popup.active { display: block; }
.suggestion-popup .error-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
.suggestion-popup .error-type.spelling { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.suggestion-popup .error-type.grammar { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.suggestion-popup .error-type.style { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.suggestion-popup .error-message {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}
.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}
.suggestion-item {
  padding: var(--space-xs) var(--space-md);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  color: var(--brand-primary-light);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.suggestion-item:hover {
  background: var(--brand-primary);
  color: white;
  transform: translateY(-1px);
}

/* Statistics Bar */
.stats-bar, .counter-stats-grid {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  flex-wrap: wrap;
}
.stat-item, .counter-stat {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
.stat-item .stat-value, .counter-stat .stat-number {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.stat-item .stat-label, .counter-stat .stat-name {
  color: var(--text-muted);
}

/* Tool Actions */
.tool-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  color: white;
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(16, 185, 129, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--font-size-base);
  border-radius: var(--radius-xl);
}

.btn-icon {
  padding: var(--space-sm);
  border-radius: var(--radius-md);
}

/* Loading state */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}
.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl);
}
.section-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}
.section-header p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* SEO Content */
.seo-content {
  padding: var(--space-4xl) 0;
  border-top: 1px solid var(--border-color);
}
.seo-content .container {
  max-width: var(--container-narrow);
}
.seo-content h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}
.seo-content h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}
.seo-content p {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}
.seo-content ul, .seo-content ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.seo-content li {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.7;
  list-style: disc;
}
.seo-content ol li { list-style: decimal; }
.seo-content blockquote {
  padding: var(--space-lg) var(--space-xl);
  border-left: 3px solid var(--brand-primary);
  background: rgba(16, 185, 129, 0.05);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-lg);
  font-style: italic;
  color: var(--text-secondary);
}

/* ============================================
   TOOLS GRID (homepage / tools listing)
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.tool-grid-card {
  position: relative;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  display: block;
  overflow: hidden;
}
.tool-grid-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--brand-primary) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.tool-grid-card:hover::before { opacity: 1; }
.tool-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  color: inherit;
}

.tool-grid-card .tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-lg);
}
.tool-grid-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.tool-grid-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}
.tool-grid-card .tool-arrow {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--brand-primary);
  margin-top: var(--space-lg);
  transition: gap var(--transition-fast);
}
.tool-grid-card:hover .tool-arrow { gap: var(--space-sm); }

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.feature-card {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
}
.feature-card .feature-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto var(--space-lg);
  background: rgba(16, 185, 129, 0.1);
}
.feature-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.feature-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  text-align: center;
  padding: var(--space-md) 0;
  min-height: 90px;
}
.ad-slot-sidebar {
  min-height: 250px;
}
.ad-slot--placeholder {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
}

/* ============================================
   PLAGIARISM CHECKER RESULTS
   ============================================ */
.plagiarism-results {
  margin-top: var(--space-xl);
}

.plagiarism-progress {
  text-align: center;
  padding: var(--space-2xl);
}
.plagiarism-progress .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

.uniqueness-score {
  text-align: center;
  padding: var(--space-xl);
  font-size: var(--font-size-3xl);
  font-weight: 800;
}
.uniqueness-score.good { color: var(--brand-primary); }
.uniqueness-score.bad { color: var(--brand-error); }

.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: var(--space-lg);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.results-table th {
  background: var(--bg-tertiary);
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.results-table th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.results-table th:last-child { border-radius: 0 var(--radius-lg) 0 0; }
.results-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
.results-table tr:last-child td {
  border-bottom: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-good {
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-primary-light);
}
.badge-bad {
  background: rgba(239, 68, 68, 0.15);
  color: var(--brand-error);
}

/* ============================================
   WORD COUNTER STATS
   ============================================ */
.counter-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  padding: var(--space-xl);
  border-top: 1px solid var(--border-color);
}
.counter-stat {
  text-align: center;
  padding: var(--space-lg);
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}
.counter-stat .stat-number {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--brand-primary);
  font-family: var(--font-mono);
}
.counter-stat .stat-name {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   PARAPHRASE TOOL
   ============================================ */
.paraphrase-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.paraphrase-layout .pane {
  position: relative;
}
.paraphrase-layout .pane-divider {
  width: 1px;
  background: var(--border-color);
}
.paraphrase-output {
  padding: var(--space-xl);
  min-height: 300px;
  background: rgba(15, 23, 42, 0.3);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: 1.8;
}
.paraphrase-output .synonym {
  color: var(--brand-primary-light);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dashed var(--brand-primary);
  transition: color var(--transition-fast);
}
.paraphrase-output .synonym:hover {
  color: var(--brand-primary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-4xl) 0 var(--space-xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--space-md);
  line-height: 1.7;
  max-width: 300px;
}
.footer-col h4 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}
.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.footer-col a:hover {
  color: var(--brand-primary-light);
  padding-left: 4px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.footer-bottom p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
}
.footer-bottom-links a {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.footer-bottom-links a:hover {
  color: var(--text-secondary);
}

/* ============================================
   COOKIE CONSENT
   ============================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-lg) var(--space-xl);
  display: none;
  animation: fadeInUp 0.5s ease-out;
}
.cookie-banner.show { display: block; }
.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  gap: var(--space-lg);
  flex-wrap: wrap;
}
.cookie-inner p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex: 1;
}
.cookie-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ============================================
   CONTENT PAGES (About, Contact, Privacy)
   ============================================ */
.page-hero {
  padding-top: calc(var(--header-height) + var(--space-4xl));
  padding-bottom: var(--space-3xl);
  text-align: center;
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glow);
  pointer-events: none;
}
.page-hero h1 {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  position: relative;
}
.page-hero p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  position: relative;
}

.page-content {
  padding: var(--space-3xl) 0 var(--space-4xl);
}
.page-content .container {
  max-width: var(--container-narrow);
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: var(--space-lg);
}
.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}
.form-control {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.25rem;
    --font-size-4xl: 1.875rem;
    --font-size-3xl: 1.5rem;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg) var(--space-md);
    gap: var(--space-xs);
    overflow-y: auto;
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-links a,
  .nav-dropdown,
  .nav-dropdown-trigger {
    font-size: var(--font-size-base);
    padding: var(--space-md);
    width: 100%;
    text-align: left;
    border-radius: var(--radius-md);
  }
  .nav-dropdown-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    background: rgba(255, 255, 255, 0.03);
    min-width: unset;
    display: none;
    width: 100%;
    padding: 0;
    margin-top: 2px;
  }
  .nav-dropdown-menu a {
    padding: var(--space-md) var(--space-md) var(--space-md) var(--space-2xl);
    width: 100%;
  }
  .nav-dropdown.open .nav-dropdown-menu { display: block; }
  .nav-dropdown:hover .nav-dropdown-menu {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-toggle { display: flex; }

  .tool-header { padding: var(--space-md); }
  .tool-textarea,
  .editor-area { padding: var(--space-md); min-height: 200px; }
  .stats-bar { padding: var(--space-md); gap: var(--space-md); }
  .tool-actions {
    padding: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
  }
  .tool-actions .btn {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
  }

  .paraphrase-layout {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .counter-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-md); }
  .hero h1 { font-size: var(--font-size-3xl); }
  .counter-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-bar {
    gap: var(--space-sm);
  }
  .stat-item {
    font-size: var(--font-size-xs);
  }
}
