/* FreeKeywordChecker — styles */
:root {
  --bg: #f8f9fc;
  --bg-alt: #eef1f7;
  --panel: #ffffff;
  --text: #131a2a;
  --text-dim: #59637a;
  --border: #dde2ec;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --accent-hover: #4338ca;
  --accent-soft: #e4e7fd;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --shadow-lg: 0 4px 10px rgba(16, 24, 40, .08), 0 12px 32px rgba(16, 24, 40, .10);
  --glow-1: rgba(99, 102, 241, .14);
  --glow-2: rgba(6, 182, 212, .12);
  --header-bg: rgba(255, 255, 255, .82);
  --grid-line: rgba(79, 70, 229, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1017;
    --bg-alt: #131926;
    --panel: #1a2233;
    --text: #e8ecf5;
    --text-dim: #98a3ba;
    --border: #2a3550;
    --accent: #818cf8;
    --accent-2: #22d3ee;
    --accent-hover: #a5b0ff;
    --accent-soft: #232c54;
    --green: #4ade80;
    --green-soft: #143824;
    --red: #f87171;
    --amber: #fbbf24;
    --amber-soft: #3a2e10;
    --shadow: 0 1px 3px rgba(0, 0, 0, .45);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, .55);
    --glow-1: rgba(99, 102, 241, .17);
    --glow-2: rgba(6, 182, 212, .10);
    --header-bg: rgba(12, 16, 23, .82);
    --grid-line: rgba(129, 140, 248, .07);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
:root { --font-display: "Space Grotesk", "Inter", -apple-system, sans-serif; }
h1, h2, h3, .brand-name { font-family: var(--font-display); }

/* film grain */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E") repeat;
  opacity: .028;
  pointer-events: none;
  z-index: 60;
}
@media (prefers-color-scheme: dark) {
  body::after { opacity: .05; }
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
code { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: .88em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; text-decoration: none; color: var(--text); }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-weight: 500; letter-spacing: -.02em; }
.brand-name b {
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: .92rem; font-weight: 500; }
.site-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 84px 0 56px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -10%;
  background:
    radial-gradient(600px 320px at 25% 10%, var(--glow-1), transparent 70%),
    radial-gradient(600px 320px at 75% 20%, var(--glow-2), transparent 70%);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, black, transparent 72%);
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(2%, 3%, 0) scale(1.06); }
}
.hero > .container { position: relative; z-index: 1; }

/* Hero live demo */
.hero-demo { max-width: 560px; margin: 36px auto 0; text-align: left; }
.demo-bar {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 1.02rem; font-weight: 500;
  min-height: 52px;
}
.demo-glass { width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; }
.demo-caret { width: 2px; height: 1.15em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-list {
  list-style: none; margin: 10px 0 0; padding: 7px 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  min-height: 172px;
}
.demo-list li {
  padding: 9px 19px;
  color: var(--text-dim);
  font-size: .95rem;
  opacity: 0; transform: translateY(5px);
  transition: opacity .3s ease, transform .3s ease;
}
.demo-list li.show { opacity: 1; transform: none; }
.demo-list li:first-child { color: var(--text); font-weight: 600; }
.demo-list .badge { margin-left: 8px; }
.demo-list li.skel { opacity: 1; transform: none; }
.demo-list li.skel .bar {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-alt) 25%, color-mix(in srgb, var(--border) 55%, var(--bg-alt)) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Keyword marquee */
.kw-marquee {
  position: relative;
  margin-top: 44px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.kw-track {
  display: flex; gap: 12px;
  width: max-content;
  padding: 4px 0;
  will-change: transform;
  animation: marquee 36s linear infinite;
}
.hero.offscreen .kw-track,
.hero.offscreen::before { animation-play-state: paused; }
.kw-marquee:hover .kw-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.chip {
  white-space: nowrap;
  padding: 7px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: .84rem; font-weight: 500;
  box-shadow: var(--shadow);
}
.chip b {
  font-size: .66rem; font-weight: 800; letter-spacing: .04em;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 2px 7px; margin-left: 6px;
  vertical-align: 1px;
}
.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  vertical-align: 3px;
  margin-right: 9px;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  font-weight: 800; letter-spacing: -.03em;
  line-height: 1.12;
  margin: 0 0 18px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { max-width: 680px; margin: 0 auto 28px; color: var(--text-dim); font-size: 1.1rem; }
.trust-row {
  list-style: none; padding: 0; margin: 26px 0 0;
  display: flex; gap: 10px 26px; justify-content: center; flex-wrap: wrap;
  color: var(--text-dim); font-size: .9rem; font-weight: 500;
}

/* ---------- Sections ---------- */
.tool-section, .content-section { padding: 56px 0; }
.alt { background: var(--bg-alt); }
h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 10px; }
h3 { font-size: 1.15rem; margin: 30px 0 8px; }
.section-sub { color: var(--text-dim); margin: 0 0 24px; max-width: 840px; }
.tag {
  vertical-align: middle;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 4px 10px; margin-left: 6px;
}

/* ---------- Panel / form ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.field-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.field.grow { flex: 1 1 260px; }
.field label { font-size: .84rem; font-weight: 600; }
.hint { font-weight: 400; color: var(--text-dim); }
input[type="text"], textarea, select {
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.estimate-box { justify-content: flex-end; color: var(--text-dim); font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn-row.center { justify-content: center; }
.btn {
  display: inline-block;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border-radius: 9px; padding: 10px 18px;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s, border-color .12s, filter .12s;
}
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 220% 100%;
  background-position: 0% 0;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
  transition: background-position .45s ease, transform .12s, box-shadow .12s;
}
.btn-primary:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79, 70, 229, .45); }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Status / progress ---------- */
.status { margin: 16px 0 0; color: var(--text-dim); font-size: .92rem; }
.status.error { color: var(--red); }
.progress-wrap { margin-top: 18px; }
.progress-bar { height: 10px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill {
  position: relative; overflow: hidden;
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; transition: width .2s;
}
.progress-fill::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(45deg,
    rgba(255,255,255,.2) 25%, transparent 25%, transparent 50%,
    rgba(255,255,255,.2) 50%, rgba(255,255,255,.2) 75%, transparent 75%);
  background-size: 22px 22px;
  animation: stripes .7s linear infinite;
}
@keyframes stripes { to { background-position: 22px 0; } }

/* ---------- Summary cards ---------- */
.summary-cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 22px 0; }
.summary-card {
  flex: 1 1 170px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px;
}
.summary-card .k { font-size: .76rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.summary-card .v { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .73rem; font-weight: 700; letter-spacing: .02em; }
.badge-exact { background: var(--green-soft); color: var(--green); }
.badge-exact::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 1px;
}
.badge-no { background: var(--bg-alt); color: var(--text-dim); }
.badge-hot { background: var(--green-soft); color: var(--green); }
.badge-warm { background: var(--amber-soft); color: var(--amber); }
.badge-cold { background: var(--bg-alt); color: var(--text-dim); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin: 14px 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); background: var(--bg-alt); }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-alt) 45%, transparent); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.match-hl { color: var(--accent); font-weight: 700; }
.expansions { color: var(--text-dim); font-size: .85rem; }
#checker-table.single-mode .col-source,
#checker-table.single-mode td:nth-child(3) { display: none; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 26px auto; text-align: center; }
.ad-label {
  display: block;
  font-size: .64rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 5px;
}
.ad-box {
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim); font-size: .82rem;
  background: var(--bg-alt);
}

/* ---------- Bento cards ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
.bento-wide { grid-column: span 2; }
.card {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-bignum {
  position: absolute; top: -16px; right: 4px;
  font-family: var(--font-display);
  font-size: 5.4rem; font-weight: 700; line-height: 1;
  color: var(--text); opacity: .05;
  user-select: none; pointer-events: none;
}
.card-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  margin-bottom: 13px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}
.card-icon svg { width: 20px; height: 20px; }
.card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .92rem; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 15px 20px; font-size: .92rem; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- FAQ ---------- */
details { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; padding: 0 20px; }
details[open] { border-color: var(--accent); }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
details p { margin-top: 0; color: var(--text-dim); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 26px; font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; margin-bottom: 26px; }
.footer-grid p { color: var(--text-dim); margin: 10px 0 0; }
.footer-grid h4 { margin: 4px 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.footer-grid a { display: block; color: var(--text-dim); text-decoration: none; padding: 3px 0; }
.footer-grid a:hover { color: var(--accent); }
.brand.small { font-size: 1.1rem; }
.brand.small .logo { width: 24px; height: 24px; }
.legal { border-top: 1px solid var(--border); padding-top: 18px; color: var(--text-dim); font-size: .8rem; }
.legal a { color: var(--accent); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ---------- Anchors under sticky header ---------- */
section[id] { scroll-margin-top: 74px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .bento { grid-template-columns: 1fr; }
  .bento-wide { grid-column: auto; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding: 52px 0 36px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .brand-name { font-size: 1.05rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .demo-caret, .progress-fill::after, .kw-track { animation: none; }
  .demo-list li { transition: none; }
  .card, .btn { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
