/* ProductExtractor — design system
   Fonts: Sora (display), Inter (body), JetBrains Mono (accents)
   Look: deep ink-navy hero, animated gradient mesh, glass tool card,
   crisp white sections, emerald CTA. No frameworks. */

:root {
  --ink: #0b1526;
  --ink-2: #101f38;
  --emerald: #059669;
  --emerald-bright: #10b981;
  --teal: #0d9488;
  --indigo: #4f46e5;
  --text: #16233a;
  --muted: #52607a;
  --line: #e3e9f2;
  --bg: #f7f9fc;
  --card: #ffffff;
  --radius: 18px;
  --shadow-lg: 0 24px 60px -18px rgba(6, 24, 48, 0.35);
  --shadow-md: 0 12px 32px -12px rgba(6, 24, 48, 0.18);
  --shadow-sm: 0 4px 14px -6px rgba(6, 24, 48, 0.14);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--ink); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(16, 185, 129, 0.55); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--font-mono); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(9, 18, 34, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.16rem; color: #fff; letter-spacing: -0.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--emerald-bright), var(--teal)); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); flex: none; }
.logo-mark svg { width: 20px; height: 20px; }
.main-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.main-nav a { color: #c6d3e6; font-weight: 500; font-size: 0.96rem; padding: 9px 13px; border-radius: 10px; }
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.main-nav a[aria-current="page"] { color: #fff; background: rgba(16, 185, 129, 0.22); }
.nav-toggle { display: none; margin-left: auto; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); color: #fff; border-radius: 10px; min-width: 44px; min-height: 44px; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1100px 520px at 85% -10%, rgba(79, 70, 229, 0.5), transparent 60%),
              radial-gradient(900px 480px at 8% 0%, rgba(13, 148, 136, 0.42), transparent 55%),
              linear-gradient(160deg, #081120 0%, var(--ink) 45%, #0a1f2e 100%);
  color: #dce7f5;
  padding: 64px 0 120px;
}
.hero::before {
  content: ""; position: absolute; inset: -40%;
  background:
    radial-gradient(420px 420px at 22% 30%, rgba(16, 185, 129, 0.28), transparent 65%),
    radial-gradient(520px 520px at 78% 22%, rgba(45, 212, 191, 0.20), transparent 65%),
    radial-gradient(460px 460px at 60% 85%, rgba(79, 70, 229, 0.26), transparent 65%);
  animation: mesh-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes mesh-drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2.5%, 2%, 0) scale(1.06); }
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 17ch; }
.hero h1 .grad {
  background: linear-gradient(92deg, #34d399, #2dd4bf 48%, #818cf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 1.13rem; color: #b9c9de; max-width: 62ch; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8ff0cf; background: rgba(16, 185, 129, 0.13); border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.hero-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22); }

/* ---------- tool card ---------- */
.tool-card {
  position: relative; z-index: 2;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 26px;
  margin-top: 34px;
  color: var(--text);
}
.tool-card h2 { font-size: 1.25rem; margin-bottom: 4px; }
.tool-card .tool-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; font-size: 0.92rem; margin: 14px 0 6px; color: var(--ink); }
textarea, input[type="text"], input[type="number"], input[type="email"], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 108px; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.55; }
textarea:focus, input:focus, select:focus { border-color: var(--emerald-bright); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); outline: none; }
.mode-rows { display: grid; gap: 8px; margin-top: 14px; }
.mode-row { display: flex; gap: 10px; align-items: flex-start; background: #f2f6fb; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.mode-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--emerald); flex: none; }
.mode-row label { font-weight: 600; font-size: 0.94rem; color: var(--ink); cursor: pointer; }
.mode-row .mode-url { margin-top: 8px; display: none; }
.mode-row.active .mode-url { display: block; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-top: 6px; }
.settings-grid .field-label { margin-top: 12px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  border: none; border-radius: 13px; padding: 13px 22px; cursor: pointer;
  min-height: 48px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--emerald-bright), var(--emerald)); color: #fff; box-shadow: 0 10px 24px -8px rgba(5, 150, 105, 0.55); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 30px -8px rgba(5, 150, 105, 0.55); }
.btn-primary:disabled { opacity: 0.65; cursor: wait; }
.btn-ghost { background: #eef3f9; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover:not(:disabled) { background: #e2ebf5; transform: translateY(-2px); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.tool-note { font-size: 0.88rem; color: var(--muted); }

/* progress */
.progress-wrap { display: none; margin-top: 20px; }
.progress-wrap.on { display: block; }
.progress-bar { height: 10px; border-radius: 999px; background: #e6edf5; overflow: hidden; }
.progress-bar > div { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--emerald-bright), var(--teal), #818cf8); transition: width 0.35s ease; }
.progress-text { font-size: 0.92rem; color: var(--muted); margin-top: 8px; font-weight: 500; }
.status-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 190px; overflow: auto; display: grid; gap: 5px; }
.status-list li { display: flex; gap: 9px; align-items: baseline; font-size: 0.88rem; background: #f2f6fb; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; }
.status-list .st { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; flex: none; }
.st-run { background: #e0e7ff; color: #3730a3; }
.st-ok { background: #d1fae5; color: #065f46; }
.st-err { background: #fee2e2; color: #991b1b; }
.status-list .u { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* results */
.results-wrap { display: none; margin-top: 24px; }
.results-wrap.on { display: block; }
.results-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.results-head h3 { margin: 0; }
.summary-line { font-size: 0.93rem; color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; }
table.results { border-collapse: collapse; width: 100%; min-width: 760px; background: #fff; }
table.results th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: #f2f6fb; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.results td { padding: 10px 12px; border-bottom: 1px solid #eef2f8; vertical-align: middle; font-size: 0.92rem; }
table.results tr:last-child td { border-bottom: none; }
table.results tr.is-error td { background: #fff7f7; }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eef2f8; }
.thumb-none { width: 52px; height: 52px; border-radius: 10px; background: #eef2f8; display: inline-flex; align-items: center; justify-content: center; color: #93a5bf; }
.cell-input { border: 1.5px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; font-size: 0.92rem; width: 100%; min-width: 110px; }
.cell-input:hover { border-color: var(--line); }
.cell-input:focus { border-color: var(--emerald-bright); background: #fff; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.cell-price { max-width: 110px; font-family: var(--font-mono); font-size: 0.86rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; padding: 3px 9px; border-radius: 999px; background: #e6fbf2; color: #065f46; border: 1px solid #a7f3d0; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-bright); }
.badge.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.warn::before { background: #f59e0b; }
.badge.err { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge.err::before { background: #ef4444; }
.row-remove { background: none; border: none; color: #b91c1c; font-size: 1.05rem; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 9px; }
.row-remove:hover { background: #fee2e2; }
.error-text { color: #991b1b; font-size: 0.86rem; }

/* ---------- sections ---------- */
.section { padding: 76px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 38px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -64px; position: relative; z-index: 3; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 22px; text-align: center; }
.stat .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink); }
.stat .lbl { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.step .n { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--emerald-bright), var(--teal)); color: #fff; font-family: var(--font-display); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); transition: transform 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card .icon { width: 46px; height: 46px; border-radius: 13px; background: #e6fbf2; color: var(--emerald); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--muted); font-size: 0.96rem; margin: 0; }
.platforms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.platform { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.platform .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; flex: none; }
.platform p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-family: var(--font-mono); font-size: 0.76rem; background: #eef4fb; border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; padding: 4px 11px; }

/* ad slots: render nothing unless a publisher ID is configured */
.ad-slot { display: none; }
body.ads-on .ad-slot { display: block; max-width: 1160px; margin: 26px auto; padding: 0 20px; }
body.ads-on .ad-slot .ad-box { border: 1.5px dashed #c3cede; border-radius: 14px; color: #8494ad; text-align: center; padding: 22px; font-size: 0.85rem; background: #fff; }

/* ---------- content pages ---------- */
.page-hero { background: linear-gradient(160deg, #081120, var(--ink) 55%, #0a1f2e); color: #dce7f5; padding: 56px 0 64px; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-hero p { color: #b9c9de; max-width: 68ch; font-size: 1.05rem; }
.crumbs { font-size: 0.86rem; color: #8fa6c4; margin-bottom: 16px; font-family: var(--font-mono); }
.crumbs a { color: #8ff0cf; }
.prose { max-width: 800px; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0 1.4em; font-size: 0.94rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: #f2f6fb; font-family: var(--font-display); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; background: #eef4fb; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.callout { background: #e6fbf2; border: 1px solid #a7f3d0; border-radius: 14px; padding: 18px 20px; margin: 1.2em 0; }
.callout.warn { background: #fffbeb; border-color: #fde68a; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.faq-item h3 { margin: 0 0 6px; }
.faq-item p { color: var(--muted); margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: #081120; color: #9db1c9; padding: 54px 0 30px; margin-top: 0; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.site-footer h4 { color: #fff; font-size: 0.98rem; margin-bottom: 12px; }
.site-footer a { color: #9db1c9; display: block; padding: 4px 0; font-size: 0.94rem; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-line { display: flex; gap: 10px; align-items: center; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin-bottom: 10px; }
.site-footer .fine { border-top: 1px solid rgba(255, 255, 255, 0.09); margin-top: 36px; padding-top: 20px; font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .steps, .cards { grid-template-columns: 1fr 1fr; }
  .platforms { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: rgba(9, 18, 34, 0.98); flex-direction: column; align-items: stretch; padding: 12px 16px 18px; gap: 2px; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .settings-grid { grid-template-columns: 1fr; }
  .steps, .cards { grid-template-columns: 1fr; }
  .stats-strip { margin-top: -52px; }
  .tool-card { padding: 20px 16px; }
  .hero { padding: 46px 0 96px; }
  .btn { width: 100%; justify-content: center; }
  .tool-actions { flex-direction: column; align-items: stretch; }
  .site-footer .cols { grid-template-columns: 1fr; }
}
