
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #10b981;
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #475569;
  --card-bg: rgba(255, 255, 255, 0.9);
  --border-color: #e2e8f0;
  --glass-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --header-bg: rgba(255, 255, 255, 0.95);
  --input-bg: #ffffff;
  --focus-ring: rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] {
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --secondary: #34d399;
  --bg-color: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: rgba(30, 41, 59, 0.9);
  --border-color: #334155;
  --glass-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --header-bg: rgba(15, 23, 42, 0.95);
  --input-bg: #1e293b;
  --focus-ring: rgba(99, 102, 241, 0.4);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--primary-hover);
  outline: none;
}

a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

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

.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 15px;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--border-color);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--border-color);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.hero {
  padding: 180px 0 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(255,255,255,0) 70%);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.features-section, .benefits-section, .testimonials-section, .stats-section, .faq-section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  font-size: 36px;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 64px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.feature-card {
  padding: 40px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.feature-card h3 {
  font-size: 22px;
  margin-bottom: 16px;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Tool Interface */
.tool-section {
  padding: 120px 0 80px;
  min-height: calc(100vh - 400px);
}

.tool-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
}

.tool-modes {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.mode-btn.active, .mode-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--input-bg);
}

.tool-panel {
  display: flex;
  flex-direction: column;
  position: relative;
}

.tool-panel:first-child {
  border-right: 1px solid var(--border-color);
}

.textarea-container {
  flex-grow: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

.textarea-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 24px 0;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.icon-btn:hover {
  background: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-main);
}

textarea {
  width: 100%;
  height: 400px;
  padding: 16px 24px 24px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
  font-family: inherit;
  outline: none;
}

.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
}

.panel-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paraphrase-btn-container {
  padding: 24px;
  background: var(--card-bg);
  border-radius: 0 0 16px 16px;
  display: flex;
  justify-content: center;
}

.paraphrase-btn {
  width: 100%;
  max-width: 400px;
  padding: 16px 32px;
  font-size: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.paraphrase-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -3px rgba(79, 70, 229, 0.4);
}

.paraphrase-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.loader {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 80px 0 40px;
  margin-top: auto;
}

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

.footer-col h4 {
  font-size: 16px;
  margin-bottom: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 500;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header {
  padding: 160px 0 80px;
  text-align: center;
  background: linear-gradient(to bottom, var(--card-bg), var(--bg-color));
  border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: clamp(36px, 4vw, 48px);
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.content-section {
  padding: 80px 0;
}

.prose {
  max-width: 800px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-muted);
}

.prose h2, .prose h3 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.prose h2 {
  font-size: 32px;
  margin: 48px 0 24px;
}

.prose h3 {
  font-size: 24px;
  margin: 32px 0 16px;
}

.prose p {
  margin-bottom: 24px;
}

.prose ul, .prose ol {
  margin-bottom: 24px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 12px;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 800px;
  margin-top: 16px;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
  .tool-panel:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  textarea {
    height: 300px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .nav-links, .nav-actions .btn-outline {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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