:root {
  --bg: #070b12;
  --surface: rgba(15, 22, 36, 0.72);
  --surface-2: rgba(22, 32, 52, 0.9);
  --border: rgba(148, 163, 184, 0.12);
  --text: #e8edf5;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --pass: #34d399;
  --fail: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}
.bg-glow--a { top: -120px; left: -80px; background: #0ea5e9; }
.bg-glow--b { top: 40%; right: -160px; background: #6366f1; }

.site-header {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.brand:hover {
  opacity: 0.92;
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(200px, 42vw);
  object-fit: contain;
  object-position: left center;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.brand__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand__tag {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.shell {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* Premium tab bar */
.tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.tab-bar__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 20px 22px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-lg) - 6px);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.tab-bar__btn:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.06);
}

.tab-bar__btn.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.14));
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.12);
}

.tab-bar__icon {
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.9;
}

.tab-bar__label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tab-bar__hint {
  font-size: 0.78rem;
  opacity: 0.85;
}

.panel { display: none; animation: fadeIn 0.35s ease; }
.panel.is-active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-card {
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}

.hero-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 62ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.btn--primary {
  color: #041018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.35);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(56, 189, 248, 0.45);
}

.btn:disabled { opacity: 0.65; cursor: wait; }

.btn__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(4, 16, 24, 0.2);
  border-top-color: #041018;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.url-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.url-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.url-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.url-form input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Score card */
.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 26px 28px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.score-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.score-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }

.score-ring__track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.15);
  stroke-width: 8;
}

.score-ring__fill {
  fill: none;
  stroke: url(#scoreGrad);
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.8s ease;
}

.score-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.75rem;
}

.score-ring__value small { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

.score-card__body h2 { margin: 0 0 6px; font-size: 1.25rem; }
.score-card__body p { margin: 0; color: var(--muted); }

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 14px 0 0;
  font-size: 0.88rem;
}

.meta-list dt { color: var(--muted); margin: 0; }
.meta-list dd { margin: 0; font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }

/* Results */
.results-grid {
  display: grid;
  gap: 12px;
}

.result-card {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result-card__status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
}

.result-card__status--pass { background: rgba(52, 211, 153, 0.15); color: var(--pass); }
.result-card__status--fail { background: rgba(248, 113, 113, 0.15); color: var(--fail); }
.result-card__status--warn { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.result-card__status--pending { background: rgba(148, 163, 184, 0.12); color: var(--muted); }

.result-card h3 { margin: 0 0 4px; font-size: 0.98rem; }
.result-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }

.result-card__ms {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Site summary */
.site-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 26px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.site-summary__badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
}

.site-summary__badge--ready {
  background: rgba(52, 211, 153, 0.2);
  color: var(--pass);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.25);
}

.site-summary__badge--not-ready {
  background: rgba(248, 113, 113, 0.2);
  color: var(--fail);
}

.site-summary h2 { margin: 0 0 4px; font-size: 1.2rem; word-break: break-all; }
.site-summary p { margin: 0; color: var(--muted); }

.site-summary__stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stat-pill--pass { color: var(--pass); }
.stat-pill--fail { color: var(--fail); }
.stat-pill--warn { color: var(--warn); }

/* Table */
.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-table th,
.results-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
}

.results-table tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--pass { background: rgba(52, 211, 153, 0.18); color: var(--pass); }
.badge--fail { background: rgba(248, 113, 113, 0.18); color: var(--fail); }
.badge--warn { background: rgba(251, 191, 36, 0.18); color: var(--warn); }

.footnote, .site-footer {
  margin-top: 28px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding-bottom: 32px;
}

.site-footer strong { color: var(--text); }

.site-footer__legal {
  margin-top: 10px;
  font-size: 0.78rem;
  opacity: 0.9;
}

.site-footer__legal a {
  color: var(--muted);
}

.ad-slot {
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 12px 24px;
  text-align: center;
  min-height: 90px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(15, 22, 36, 0.5);
}

.ad-slot:empty {
  display: none;
}

.ad-slot__label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.legal-page .hero-card ul {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  color: var(--muted);
}

.legal-page .hero-card li {
  margin-bottom: 8px;
}

.legal-page .hero-card h2 {
  margin: 24px 0 10px;
  font-size: 1.1rem;
}

.url-form__hint {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

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

/* SEO content */
.seo-content {
  margin-top: 40px;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.seo-content h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.seo-content h3 {
  margin: 24px 0 10px;
  font-size: 1.05rem;
}

.seo-content > p {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 72ch;
}

.seo-content__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}

.seo-content__grid article {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.seo-content__grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.seo-content__grid p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.seo-faq {
  margin: 0;
}

.seo-faq dt {
  margin-top: 16px;
  font-weight: 600;
  color: var(--text);
}

.seo-faq dt:first-of-type {
  margin-top: 0;
}

.seo-faq dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 72ch;
}

.error-banner {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .tab-bar { grid-template-columns: 1fr; }
  .tab-bar__btn { padding: 16px 18px; }
  .score-card, .site-summary { grid-template-columns: 1fr; text-align: center; }
  .score-ring { margin: 0 auto; }
  .meta-list { justify-items: center; }
  .result-card { grid-template-columns: 1fr; }
  .site-summary__stats { justify-content: center; }
}
