/* RankCheck — dark theme, mobile-first */
:root {
  --bg: #0b1120;
  --bg-soft: #111a2e;
  --card: #151f36;
  --card-border: #22304f;
  --text: #e8eefc;
  --muted: #93a1c0;
  --accent: #10d9a3;
  --accent-dim: rgba(16, 217, 163, 0.12);
  --pass: #10d9a3;
  --warn: #f5b942;
  --fail: #f2627a;
  --info: #5aa9ff;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(16, 217, 163, 0.08), transparent 60%),
              radial-gradient(900px 500px at 10% 0%, rgba(90, 169, 255, 0.07), transparent 60%),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.nav {
  max-width: 1080px; margin: 0 auto; padding: 0.9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #0aa37c);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; color: #06251c;
}
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav-link:hover { color: var(--accent); }

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem 3rem; }

.hero { text-align: center; padding: 3.5rem 0 2rem; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(16, 217, 163, 0.3);
  padding: 0.35rem 0.9rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.hero h1 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 1rem; }
.lede { color: var(--muted); font-size: 1.05rem; }

/* ---------- Input panel ---------- */
.panel {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.45rem; }
.optional { color: var(--muted); font-weight: 400; font-size: 0.82rem; }
.field input, .field textarea {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  padding: 0.75rem 0.9rem; font-family: var(--font); font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; resize: vertical; min-height: 170px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 217, 163, 0.18);
}
.field-row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
.error {
  background: rgba(242, 98, 122, 0.12); border: 1px solid rgba(242, 98, 122, 0.45);
  color: #ffb3c0; padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.92rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  border: none; border-radius: 10px; padding: 0.8rem 1.5rem;
  font-family: var(--font); font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0aa37c); color: #06251c;
  box-shadow: 0 8px 24px rgba(16, 217, 163, 0.3);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(16, 217, 163, 0.45); }
.btn-secondary { background: var(--bg-soft); color: var(--text); border: 1px solid var(--card-border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

/* ---------- Results ---------- */
.results { margin-top: 2.5rem; animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.score-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.75rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  text-align: center;
}
.gauge-wrap { position: relative; width: 180px; height: 180px; }
.gauge { width: 100%; height: 100%; }
.gauge-track { fill: none; stroke: var(--card-border); stroke-width: 14; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 439.823; stroke-dashoffset: 439.823;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s;
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-number { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.score-max { color: var(--muted); font-size: 0.9rem; }
.grade-badge {
  display: inline-block; font-size: 1.5rem; font-weight: 800;
  width: 58px; height: 58px; line-height: 58px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent); color: var(--accent);
}
.grade-badge.g-B { border-color: var(--info); color: var(--info); background: rgba(90, 169, 255, 0.12); }
.grade-badge.g-C { border-color: var(--warn); color: var(--warn); background: rgba(245, 185, 66, 0.12); }
.grade-badge.g-D, .grade-badge.g-F { border-color: var(--fail); color: var(--fail); background: rgba(242, 98, 122, 0.12); }
.score-summary { font-size: 1.05rem; font-weight: 600; }
.score-sub { color: var(--muted); font-size: 0.92rem; max-width: 420px; }

.section-title { font-size: 1.25rem; margin: 2rem 0 1rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.6rem; }
.count-pill {
  font-size: 0.75rem; font-weight: 700; background: var(--bg-soft);
  border: 1px solid var(--card-border); border-radius: 999px; padding: 0.15rem 0.7rem; color: var(--muted);
}

.checks-grid { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
.check-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 1.05rem 1.15rem;
  display: grid; grid-template-columns: auto 1fr; gap: 0.85rem; align-items: start;
  animation: fadeUp 0.45s ease both;
}
.status-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 0.35rem; flex-shrink: 0; }
.status-pass { background: var(--pass); box-shadow: 0 0 10px rgba(16, 217, 163, 0.7); }
.status-warn { background: var(--warn); box-shadow: 0 0 10px rgba(245, 185, 66, 0.7); }
.status-fail { background: var(--fail); box-shadow: 0 0 10px rgba(242, 98, 122, 0.7); }
.status-info { background: var(--info); box-shadow: 0 0 10px rgba(90, 169, 255, 0.7); }
.check-card h4 { font-size: 0.98rem; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.check-card p { color: var(--muted); font-size: 0.88rem; }
.check-tag {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem; border-radius: 6px;
}
.tag-pass { background: rgba(16, 217, 163, 0.15); color: var(--pass); }
.tag-warn { background: rgba(245, 185, 66, 0.15); color: var(--warn); }
.tag-fail { background: rgba(242, 98, 122, 0.15); color: var(--fail); }
.tag-info { background: rgba(90, 169, 255, 0.15); color: var(--info); }

.rec-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 0.5rem;
}
.rec-card .section-title { margin-top: 0; }
.rec-list { list-style: none; counter-reset: rec; display: grid; gap: 0.8rem; }
.rec-list li {
  counter-increment: rec; position: relative;
  background: var(--bg-soft); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 0.9rem 1rem 0.9rem 3.2rem; font-size: 0.93rem;
}
.rec-list li::before {
  content: counter(rec); position: absolute; left: 0.9rem; top: 0.85rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid rgba(16, 217, 163, 0.4);
  color: var(--accent); font-weight: 800; font-size: 0.85rem;
  display: grid; place-items: center;
}
.rec-list li strong { color: var(--text); }
.rec-impact { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }
.rec-empty { color: var(--muted); }

/* ---------- Features / footer ---------- */
.features { margin-top: 3.5rem; }
.features h2 { text-align: center; font-size: 1.6rem; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.features-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; }
.feature-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 1.35rem;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(16, 217, 163, 0.45); }
.feature-card h3 { font-size: 1.02rem; margin-bottom: 0.4rem; color: var(--accent); }
.feature-card p { color: var(--muted); font-size: 0.9rem; }

.site-footer {
  border-top: 1px solid var(--card-border); margin-top: 3rem;
  padding: 1.75rem 1.25rem; text-align: center; color: var(--muted); font-size: 0.88rem;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.7rem; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .score-card { flex-direction: row; text-align: left; padding: 2rem; }
  .checks-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .checks-grid { grid-template-columns: 1fr 1fr 1fr; }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
