@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;700&display=swap');

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

:root {
  --ink: #0f0f10;
  --ink-2: #3a3a3f;
  --ink-3: #6b6b72;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #efeff1;
  --border: #e2e2e6;
  --accent: #5b4cf5;
  --accent-light: #ede9ff;
  --accent-dark: #3d31d4;
  --green: #16a34a;
  --green-light: #dcfce7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 12px 32px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--ink); background: var(--surface-2); line-height: 1.6; font-size: 15px; }

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 20px; color: var(--accent);
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--ink); }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  text-decoration: none; color: var(--ink-2); font-size: 14px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }

/* HERO */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--accent-light); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  padding: 4px 12px; border-radius: 100px;
  margin-bottom: 1.25rem; text-transform: uppercase;
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700;
  line-height: 1.15; color: var(--ink);
  max-width: 640px; margin: 0 auto 1rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  font-size: 17px; color: var(--ink-3); max-width: 500px;
  margin: 0 auto 2rem; line-height: 1.7;
}
.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; color: var(--ink);
}
.hero-stat-label { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* AD SLOTS */
.ad-slot {
  background: var(--surface-3); border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.ad-banner { height: 90px; max-width: 728px; margin: 1.5rem auto; }
.ad-rect { height: 250px; width: 300px; }

/* MAIN LAYOUT */
.page-wrapper { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }

/* TOOLS GRID */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: block;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 1rem;
}
.tool-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.tool-card p { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin-bottom: 1rem; }
.tool-tag {
  display: inline-block; font-size: 11px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-3);
  padding: 3px 8px; border-radius: 100px;
  border: 1px solid var(--border);
}
.tool-cta {
  float: right; font-size: 13px; color: var(--accent);
  font-weight: 500; display: flex; align-items: center; gap: 4px;
}

/* TOOL PAGE */
.tool-page { display: none; }
.tool-page.active { display: block; }
.tool-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.5rem;
}
.back-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  cursor: pointer; font-size: 13px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.back-btn:hover { background: var(--surface-3); }
.tool-page-title { font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; }

.tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.tool-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* FORM ELEMENTS */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
textarea, input, select {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); transition: border-color 0.15s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,76,245,0.1);
}
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 11px 24px; font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%; margin-top: 0.5rem;
  transition: background 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { background: var(--ink-3); cursor: not-allowed; }

/* RESULT */
.result-box {
  margin-top: 1.25rem; padding: 1rem 1.25rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); display: none;
}
.result-box.visible { display: block; }
.result-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 8px;
}
.result-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--ink); }
.result-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-copy, .btn-regen {
  font-size: 12px; font-weight: 500; padding: 6px 14px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); transition: background 0.15s;
}
.btn-copy:hover, .btn-regen:hover { background: var(--surface-3); }
.btn-copy.copied { background: var(--green-light); color: var(--green); border-color: var(--green); }

/* LOADING */
.loader {
  display: none; align-items: center; justify-content: center;
  gap: 8px; margin-top: 1rem; color: var(--ink-3); font-size: 14px;
}
.loader.visible { display: flex; }
.loader-dots span {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* SIDEBAR WIDGETS */
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow);
}
.sidebar-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 0.75rem; }
.other-tools a {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--border); text-decoration: none;
  color: var(--ink-2); font-size: 13px; transition: color 0.15s;
}
.other-tools a:last-child { border-bottom: none; }
.other-tools a:hover { color: var(--accent); }

/* FOOTER */
footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 2rem 1.5rem; margin-top: 3rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-brand {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 16px; color: var(--accent);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--ink-3); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--ink); }
.footer-copy { font-size: 12px; color: var(--ink-3); }

/* HOME / TOOL PAGE VISIBILITY */
#home-page { display: block; }

/* SEO SECTIONS */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; margin-bottom: 0.75rem;
}
.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem; }
.faq-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.faq-a { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* AFFILIATE CTA */
.affiliate-cta {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.affiliate-cta-text { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.affiliate-cta-text strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.affiliate-cta-btn {
  display: inline-block; white-space: nowrap;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: #fff;
  transition: background 0.15s;
}
.affiliate-cta-btn:hover { background: var(--accent-dark); }

@media (max-width: 600px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-stats { gap: 1.5rem; }
  .nav-links { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
