@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400..800;1,9..40,400..800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #f5f6fa;
  --ink: #111827;
  --muted: #667085;
  --line: #e6e8ef;
  --card: #ffffff;
  --accent: #6957e8;
  --accent-hover: #5544d4;
  --focus-ring: rgba(105, 87, 232, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

/* Site Header */
.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(6vw, 24px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.8px;
  display: inline-flex;
  align-items: center;
}

.brand > span:last-child {
  color: var(--accent);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #eeeaff;
  color: var(--accent);
  margin-right: 8px;
  font-weight: 700;
}

.site-header nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-header nav a {
  font-size: 14px;
  color: #475467;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--accent);
  font-weight: 700;
}

/* Hero Section */
.hero {
  padding: 72px 24px 64px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, #e9e5ff 0%, transparent 60%), #ffffff;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -1px;
  color: var(--ink);
}

h1 {
  font-size: clamp(34px, 5.5vw, 64px);
  line-height: 1.08;
  margin: 16px 0;
}

h1 span {
  color: var(--accent);
}

.hero p {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.primary-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  padding: 14px 26px;
  border-radius: 12px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(105, 87, 232, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}

.primary-link:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.hero-note {
  margin-top: 20px;
  font-size: 12px;
  color: #7b8495;
  display: inline-flex;
  align-items: center;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28b67a;
  margin-right: 7px;
}

/* Tool Grid & Sections */
.tools-section, .workspace, .content-section, .page-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

h2 {
  font-size: 28px;
  margin: 8px 0 0;
}

.tool-count {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #9299a8;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  min-width: 0;
}

.tool-card:hover, .tool-card.active {
  border-color: #b7adff;
  box-shadow: 0 8px 24px rgba(32, 32, 64, 0.06);
  transform: translateY(-2px);
}

.tool-card > span:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tool-card b {
  font-size: 15px;
  color: var(--ink);
}

.tool-card small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.tool-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
}

.violet { background: #eeeaff; color: #6957e8; }
.orange { background: #fff0e4; color: #d97825; }
.green  { background: #e5f8ef; color: #169b60; }
.blue   { background: #e8f2ff; color: #387ad4; }
.pink   { background: #ffebf1; color: #d34b7b; }
.yellow { background: #fff6d9; color: #b58a13; }

.arrow {
  margin-left: auto;
  color: #9aa1af;
  font-size: 16px;
}

/* Workspace / Tool Component */
.workspace {
  padding-top: 16px;
}

.workspace-top {
  background: #151d2e;
  color: #ffffff;
  padding: 28px 32px;
  border-radius: 18px 18px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-top .eyebrow {
  color: #b9adff;
}

.workspace-top h1 {
  margin: 6px 0;
  font-size: 26px;
  color: #ffffff;
}

.workspace-top p {
  margin: 0;
  color: #b9c1d0;
  font-size: 14px;
}

.spark {
  font-size: 28px;
  color: #b9adff;
}

.tool-panel-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 0;
  padding: 32px;
  border-radius: 0 0 18px 18px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.fields.single-col {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}

.field input, .field textarea, .field select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #dfe2ea;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.calculate {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.calculate:hover {
  background: var(--accent-hover);
}

.hint {
  font-size: 12px;
  color: #9299a8;
}

.result {
  margin-top: 22px;
  padding: 22px 26px;
  background: #f0edff;
  border: 1px solid #ded8ff;
  border-radius: 14px;
  color: #352b7e;
}

.result.error-result {
  background: #fff0f0;
  border-color: #ffd0d0;
  color: #900000;
}

.result.error-result small {
  color: #b30000;
}

.result strong {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.result small {
  color: #675ca5;
  font-size: 13px;
  font-weight: 600;
}

.result[hidden] {
  display: none;
}

/* Breadcrumbs & Content */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs span.sep {
  color: #bbb;
}

.breadcrumbs span.current {
  color: var(--ink);
  font-weight: 600;
}

.seo-content {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px;
  margin-top: 32px;
}

.seo-content h2 {
  font-size: 24px;
  margin: 28px 0 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content h3 {
  font-size: 19px;
  margin: 20px 0 10px;
}

.seo-content p {
  color: #475467;
  line-height: 1.75;
  margin: 0 0 16px;
}

.seo-content ul, .seo-content ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: #475467;
}

.seo-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.formula-box, .example-box {
  background: #f8f9fc;
  border: 1px solid #e2e5ed;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 18px 0 24px;
}

.formula-box code {
  font-family: monospace;
  font-size: 15px;
  color: var(--accent);
  background: #ede9fe;
  padding: 3px 8px;
  border-radius: 4px;
}

.example-box h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ink);
}

/* FAQ Accordion / Cards */
.faq-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.faq-card {
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.faq-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
  color: var(--ink);
}

.faq-card p {
  margin: 0;
  font-size: 14px;
  color: #667085;
  line-height: 1.65;
}

/* Related Tools Bar */
.related-tools {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.related-tools h3 {
  font-size: 20px;
  margin-bottom: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* Page Containers */
.static-page {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 44px;
  margin-top: 24px;
}

.static-page h1 {
  font-size: 36px;
  margin-bottom: 16px;
}

.contact-card {
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin: 24px 0;
}

.contact-card a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
  padding: 40px max(6vw, 24px) 30px;
  margin-top: 60px;
  font-size: 13px;
  color: #667085;
}

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

.footer-tagline {
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.footer-links a {
  color: #475467;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #98a2b3;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .site-header {
    height: 65px;
    padding: 0 18px;
  }
  .site-header nav {
    gap: 14px;
  }
  .site-header nav a {
    font-size: 13px;
  }
  .hero {
    padding: 48px 18px 40px;
  }
  .hero p {
    font-size: 15px;
  }
  .tools-section, .workspace, .content-section, .page-container {
    padding: 32px 16px;
  }
  .tool-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tool-card {
    padding: 14px 12px;
    gap: 10px;
  }
  .tool-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
  .tool-card b {
    font-size: 13px;
  }
  .tool-card small {
    font-size: 11px;
  }
  .arrow {
    display: none;
  }
  .workspace-top {
    padding: 20px;
  }
  .tool-panel-box {
    padding: 20px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .seo-content, .static-page {
    padding: 24px;
  }
  .footer-links {
    gap: 12px 18px;
  }
}

@media (max-width: 480px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
