/* ======================================================
   Tokens
   ====================================================== */
:root {
  /* Core palette — brand blue is an EXACT match to the real extension
     (popup.css .score { color: #2563eb }) for visual continuity between
     this site and the product itself. */
  --ink: #0F172A;
  --ink-soft: #475569;
  --muted: #6B7280;
  --paper: #FFFFFF;
  --surface: #F8FAFC;
  --line: #E5E7EB;
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-tint: #EFF6FF;

  /* Score-band colors — copied verbatim from
     content-scripts/serp-overlay.js's badge CSS, not reinvented. */
  --band-unknown-bg: #F9FAFB;
  --band-unknown-fg: #9CA3AF;
  --band-unknown-border: #E5E7EB;
  --band-low-bg: #F3F4F6;
  --band-low-fg: #4B5563;
  --band-low-border: #E5E7EB;
  --band-mid-bg: #FEF3C7;
  --band-mid-fg: #92400E;
  --band-mid-border: #FDE68A;
  --band-high-bg: #D1FAE5;
  --band-high-fg: #065F46;
  --band-high-border: #A7F3D0;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -12px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; }

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

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

/* ======================================================
   Buttons
   ====================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-large {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-large:hover {
  transform: translateY(-1px);
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 20px;
}

/* ======================================================
   Header
   ====================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .site-nav { display: none; }
}

/* ======================================================
   Hero
   ====================================================== */
.hero {
  padding: 88px 0 96px;
  background:
    radial-gradient(600px 300px at 85% -10%, var(--brand-tint), transparent 70%),
    var(--paper);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand);
  text-transform: uppercase;
  margin: 0 0 16px;
}

.hero-copy h1 {
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  color: var(--ink);
}

.hero-sub {
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 13px;
  color: var(--muted);
}

/* --- Hero interactive demo card --- */
.hero-demo {
  animation: hero-rise 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.demo-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.demo-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.demo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.demo-url {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.demo-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.demo-results {
  padding: 8px 4px;
}

.demo-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--surface);
}

.demo-result:last-child { border-bottom: none; }

.demo-result-text cite {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #1a7a4c;
  margin-bottom: 2px;
}

.demo-result-text h3 {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #1a0dab;
  margin: 0 0 4px;
  line-height: 1.35;
}

.demo-result-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 40ch;
}

.demo-caption {
  margin: 14px 4px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* --- The actual badge component, byte-for-byte from
   content-scripts/serp-overlay.js's injected styles. This is not a
   separate "marketing" version — it's the real thing. --- */
.da-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 1px 7px 2px;
  min-width: 19px;
  box-sizing: border-box;
  border-radius: 5px;
  border: 1px solid transparent;
  font: 600 12px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
  transition: border-color 200ms ease, background-color 200ms ease, opacity 200ms ease, transform 200ms ease;
}

.da-badge[data-band="unknown"] {
  background: var(--band-unknown-bg);
  color: var(--band-unknown-fg);
  border-style: dashed;
  border-color: var(--band-unknown-border);
}

.da-badge[data-band="low"] {
  background: var(--band-low-bg);
  color: var(--band-low-fg);
  border-color: var(--band-low-border);
}

.da-badge[data-band="mid"] {
  background: var(--band-mid-bg);
  color: var(--band-mid-fg);
  border-color: var(--band-mid-border);
}

.da-badge[data-band="high"] {
  background: var(--band-high-bg);
  color: var(--band-high-fg);
  border-color: var(--band-high-border);
}

/* Toggled-off state, driven by JS adding .is-hidden to the results wrapper */
.demo-results.is-off .da-badge {
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

/* --- Toggle switch, same component/markup pattern as popup.css --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  border-radius: 999px;
  transition: background-color 150ms ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 15px;
  width: 15px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 150ms ease;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--brand);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(15px);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ======================================================
   Problem
   ====================================================== */
.problem {
  padding: 80px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 12px;
}

.problem-lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 40px;
}

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

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

.problem-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px 24px;
}

.problem-stat {
  display: block;
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 12px;
}

.problem-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ======================================================
   How it works
   ====================================================== */
.how { padding: 96px 0; }

.section-lead {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 0 0 48px;
  max-width: 50ch;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

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

.how-panel-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 16px;
}

.how-panel-copy {
  margin: 20px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* --- mock popup reconstruction --- */
.mock-popup {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.mock-popup-score {
  margin-bottom: 8px;
}

.mock-score-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.mock-score-label {
  font-size: 12px;
  color: var(--muted);
}

.mock-popup-stats {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
}

.mock-popup-stats .dot { margin: 0 6px; color: var(--line); }

.mock-sparkline {
  width: 100%;
  height: 32px;
}

/* --- mock mini SERP reconstruction --- */
.mock-serp-mini {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-card);
}

.mock-serp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  border-bottom: 1px solid var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: #1a0dab;
}

.mock-serp-row:last-child { border-bottom: none; }

/* ======================================================
   Pricing (mirrors options.html's plan-card system)
   ====================================================== */
.pricing {
  padding: 96px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 760px;
}

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

.plan-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.plan-card-pro {
  border: 1.5px solid #93c5fd;
  background: linear-gradient(180deg, var(--brand-tint) 0%, var(--paper) 140px);
}

.plan-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.plan-header { margin-bottom: 18px; }

.plan-price {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.plan-price-note {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.plan-everything-in {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.feature-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 11px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: 700;
}

/* ======================================================
   Trust
   ====================================================== */
.trust { padding: 88px 0; }

.trust-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

@media (max-width: 760px) {
  .trust-inner { grid-template-columns: 1fr; }
}

.trust-mark {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--brand);
  margin-bottom: 14px;
}

.trust-item h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.trust-item p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ======================================================
   FAQ
   ====================================================== */
.faq {
  padding: 88px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.faq-list {
  max-width: 720px;
}

.faq-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 4px 20px;
  margin-bottom: 12px;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--brand);
  transition: transform 200ms ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.faq-item a {
  color: var(--brand);
  text-decoration: underline;
}

/* ======================================================
   Final CTA
   ====================================================== */
.final-cta { padding: 100px 0; }

.final-cta-inner {
  text-align: center;
}

.final-cta h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin-bottom: 32px;
}

/* ======================================================
   Scroll reveal (driven by script.js's IntersectionObserver)
   ====================================================== */
.reveal-pending {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-pending.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 620ms cubic-bezier(0.16, 1, 0.3, 1), transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ======================================================
   Footer
   ====================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

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