/* ============================================
   FYNGROO — Design Tokens
   ============================================ */
:root {
  --bg: #08090D;
  --bg-alt: #10121A;
  --text-primary: #F5F7FA;
  --text-secondary: #9CA3AF;
  --accent: #7C5CFF;
  --accent-2: #20D6C7;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;

  --container: 1200px;
  --radius: 14px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-heading); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font-family: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 10px; top: 10px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 780px; }

/* ============================================
   Scroll progress
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 300;
  transition: width 0.1s linear;
}

/* ============================================
   Header / Nav
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background 0.3s var(--ease), padding 0.3s var(--ease), border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  padding: 14px 0;
  background: rgba(8,9,13,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
}
.logo-img {
  height: 20px;
  width: auto;
  display: block;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-menu a {
  font-size: 14.5px;
  color: var(--text-secondary);
  transition: color 0.2s;
  position: relative;
}
.nav-menu a:hover { color: var(--text-primary); }
.nav-cta-item { margin-left: 4px; }
.nav-cta-item a { color: #fff !important; }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  z-index: 110;
}
.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6a4be0);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(124,92,255,0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(124,92,255,0.7); }
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
  opacity: 0.5;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.hero-glow-a { width: 480px; height: 480px; background: var(--accent); top: -120px; right: -100px; }
.hero-glow-b { width: 380px; height: 380px; background: var(--accent-2); bottom: -140px; left: -80px; opacity: 0.2; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { display: flex; justify-content: center; }
.node-graph { width: 100%; max-width: 440px; }
.node-lines .line {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  animation: dash-flow 6s linear infinite;
  animation-delay: calc(var(--d) * 0.15s);
}
.node-dots .dot {
  fill: var(--accent-2);
  animation: pulse-dot 3s ease-in-out infinite;
  animation-delay: calc(var(--d) * 0.3s);
}
.core-ring {
  fill: rgba(124,92,255,0.08);
  stroke: var(--accent);
  stroke-width: 1.5;
  animation: core-pulse 4s ease-in-out infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -100; } }
@keyframes pulse-dot { 0%, 100% { opacity: 0.6; r: 5; } 50% { opacity: 1; r: 7; } }
@keyframes core-pulse { 0%, 100% { stroke-opacity: 0.5; } 50% { stroke-opacity: 1; } }

/* ============================================
   Sections
   ============================================ */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  max-width: 720px;
  margin-bottom: 20px;
}
.section-lead {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 640px;
  margin-bottom: 8px;
}
.section-cta { margin-top: 52px; text-align: center; }

/* ============================================
   Services grid
   ============================================ */
.services-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card {
  position: relative;
  background: var(--bg);
  padding: 34px 28px;
  transition: background 0.3s var(--ease);
}
.service-card:hover { background: var(--bg-alt); }
.service-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--accent-2);
  margin-bottom: 20px;
  transition: border-color 0.3s, color 0.3s;
}
.service-icon svg { width: 20px; height: 20px; }
.service-card:hover .service-icon { border-color: var(--accent-2); color: var(--accent); }
.service-card h3 { font-size: 18px; margin-bottom: 10px; }
.service-card p { color: var(--text-secondary); font-size: 14.5px; }
.card-arrow {
  position: absolute;
  top: 32px; right: 28px;
  color: var(--text-secondary);
  transition: transform 0.3s var(--ease), color 0.3s;
}
.service-card:hover .card-arrow { transform: translate(4px, -4px); color: var(--accent-2); }

/* ============================================
   AI SEO compare panel
   ============================================ */
.compare-panel {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  align-items: start;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.015);
}
.compare-col h3 { font-size: 16px; margin-bottom: 18px; color: var(--text-secondary); }
.compare-vs {
  align-self: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.chip-accent {
  border-color: rgba(32,214,199,0.35);
  color: var(--accent-2);
  background: rgba(32,214,199,0.06);
}
.ai-engines {
  margin-top: 30px;
  color: var(--text-secondary);
  font-size: 15px;
}
.ai-engines strong { color: var(--text-primary); }

/* ============================================
   Ecosystem
   ============================================ */
.ecosystem { margin-top: 48px; display: flex; justify-content: center; }
.ecosystem-svg { width: 100%; max-width: 560px; }
.eco-lines .line {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  animation: dash-flow 7s linear infinite;
  animation-delay: calc(var(--d) * 0.12s);
}
.eco-node {
  fill: var(--bg-alt);
  stroke: var(--border-strong);
  stroke-width: 1.3;
  transition: stroke 0.3s;
}
.eco-core { fill: rgba(124,92,255,0.1); stroke: var(--accent); stroke-width: 1.6; }

/* ============================================
   Process
   ============================================ */
.process-list { margin-top: 48px; }
.process-step {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.process-step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--accent-2);
  font-weight: 600;
}
.process-step h3 { font-size: 19px; margin-bottom: 8px; }
.process-step p { color: var(--text-secondary); font-size: 15px; }

/* ============================================
   Why Fyngroo
   ============================================ */
.why-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 28px;
}
.why-item h3 { font-size: 16.5px; margin-bottom: 8px; color: var(--text-primary); }
.why-item p { font-size: 14px; color: var(--text-secondary); }
.why-item::before {
  content: "";
  display: block;
  width: 24px; height: 2px;
  background: var(--accent-2);
  margin-bottom: 14px;
}

/* ============================================
   Results
   ============================================ */
.results-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.result-card {
  background: var(--bg-alt);
  padding: 40px 24px;
  text-align: center;
}
.result-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-label { display: block; margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.results-note { margin-top: 20px; font-size: 12.5px; color: var(--text-secondary); opacity: 0.7; }

/* ============================================
   Insights
   ============================================ */
.insights-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.insight-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.insight-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.insight-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  font-weight: 600;
}
.insight-card h3 { font-size: 18px; margin: 14px 0 10px; }
.insight-card p { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 18px; }
.card-link { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ============================================
   About
   ============================================ */
#about p { color: var(--text-secondary); font-size: 17px; margin-bottom: 16px; }
#about p:last-child { margin-bottom: 0; }

/* ============================================
   Audit form
   ============================================ */
.audit-form { margin-top: 44px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color 0.2s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent-2);
}
.form-field textarea { resize: vertical; }
.field-error {
  display: block;
  color: #ff8080;
  font-size: 12.5px;
  margin-top: 6px;
  min-height: 16px;
}
.form-note { margin-top: 16px; font-size: 13px; color: var(--text-secondary); text-align: center; }
.form-status { margin-top: 12px; font-size: 14px; text-align: center; min-height: 20px; }
.form-status.success { color: var(--accent-2); }
.form-status.error { color: #ff8080; }

/* ============================================
   Contact
   ============================================ */
.contact-block { text-align: center; }
.contact-details { margin: 32px 0; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.contact-details p { display: flex; gap: 10px; font-size: 16px; color: var(--text-secondary); }
.contact-details span { color: var(--text-primary); font-weight: 600; }
.contact-details a { transition: color 0.2s; }
.contact-details a:hover { color: var(--accent-2); }

/* ============================================
   FAQ Accordion
   ============================================ */
.accordion { margin-top: 40px; border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger {
  width: 100%;
  text-align: left;
  padding: 22px 0;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.accordion-trigger::after {
  content: "+";
  font-size: 20px;
  color: var(--accent-2);
  transition: transform 0.3s var(--ease);
  flex-shrink: 0;
}
.accordion-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.accordion-panel p { padding-bottom: 22px; color: var(--text-secondary); font-size: 15px; max-width: 640px; }

/* ============================================
   Final CTA
   ============================================ */
.final-cta {
  position: relative;
  padding: 120px 0;
  text-align: center;
  overflow: hidden;
}
.final-cta-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 40%, rgba(124,92,255,0.18), transparent 70%);
  animation: drift 10s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translateY(-10px); } to { transform: translateY(10px); } }
.final-cta-inner { position: relative; z-index: 1; }
.final-cta h2 { font-size: clamp(2rem, 4vw, 3rem); max-width: 780px; margin: 0 auto 18px; }
.final-cta p { color: var(--text-secondary); font-size: 17px; max-width: 560px; margin: 0 auto 34px; }
.final-cta .hero-actions { justify-content: center; }

/* ============================================
   Footer
   ============================================ */
.site-footer { border-top: 1px solid var(--border); padding: 70px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin-top: 14px; max-width: 260px; }
.footer-brand .logo { margin-bottom: 0; }
.footer-social { display: flex; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.footer-social a { font-size: 13px; color: var(--text-secondary); transition: color 0.2s; }
.footer-social a:hover { color: var(--accent-2); }
.footer-col h3 { font-size: 14px; margin-bottom: 16px; color: var(--text-primary); }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--text-secondary); transition: color 0.2s; }
.footer-col a:hover { color: var(--accent-2); }
.footer-bottom {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   Back to top
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 90;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* ============================================
   Scroll reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 1; }
  .hero-visual { order: 0; margin-bottom: 20px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: repeat(2, 1fr); }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(320px, 80vw);
    background: var(--bg-alt);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    border-left: 1px solid var(--border);
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-cta-item { margin-left: 0; }
  .services-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .compare-panel { grid-template-columns: 1fr; }
  .compare-vs { justify-self: center; }
}

@media (max-width: 576px) {
  .section { padding: 80px 0; }
  .hero { padding-top: 120px; }
  .insights-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .process-step { grid-template-columns: 60px 1fr; }
}

@media (max-width: 375px) {
  .hero h1 { font-size: 2.2rem; }
  .btn { padding: 12px 20px; font-size: 13.5px; }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .node-lines .line, .eco-lines .line, .node-dots .dot, .core-ring, .final-cta-bg {
    animation: none !important;
  }
  * { transition-duration: 0.01ms !important; }
}
