:root {
  color-scheme: light dark;
  --accent: light-dark(#4f46e5, #818cf8);
  --accent-text: light-dark(#fff, #0f172a);
  --bg: light-dark(#f8fafc, #0f172a);
  --card: light-dark(#fff, #1e293b);
  --border: light-dark(#e2e8f0, #334155);
  --text: light-dark(#0f172a, #f1f5f9);
  --muted: light-dark(#64748b, #94a3b8);
  --ok: light-dark(#16a34a, #4ade80);
  --bad: light-dark(#dc2626, #f87171);
  --warn: light-dark(#d97706, #fbbf24);
  --bad-bg: light-dark(#fef2f2, #3b1d22);
  --info: light-dark(#2563eb, #60a5fa);
  --warn-bg: light-dark(#fff3cd, #3a3118);
  --warn-text: light-dark(#856404, #fcd34d);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); }
code, pre { font-family: ui-monospace, Menlo, monospace; }

.site-header, main, .site-footer {
  width: 100%;
  max-width: 48rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.site-header { padding-block: 1.5rem; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1.625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.logo b { color: var(--accent); font-weight: 500; }
.logo-tile { fill: var(--accent); }
.logo-mark { stroke: var(--accent-text); }
.logo-dot { fill: var(--accent-text); opacity: 0.75; }
main { flex: 1; }

.alert {
  background: var(--bad-bg);
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.site-footer {
  padding-block: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer nav { margin-bottom: 0.5rem; }

/* Home */
.hero { text-align: center; padding: 3rem 0 1rem; }
.hero h1 { font-size: 2rem; font-weight: 500; margin: 0 0 0.5rem; }
.hero p { color: var(--muted); margin: 0 auto 2rem; max-width: 30rem; }

.lint-form {
  display: flex;
  gap: 0.5rem;
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.375rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lint-form:focus-within { border-color: var(--accent); }
.lint-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  text-transform: lowercase;
}
.button {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
}
.button:hover { opacity: 0.9; }

.checks { max-width: 44rem; margin: 3rem auto; }
.checks h2, .checks h3 { font-size: 1.1rem; font-weight: 500; margin: 0 0 1rem; }
.checks dl { margin: 0; }
.checks dt { font-weight: 500; }
.checks dd { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }

/* Results */
.score-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.score-ring { width: 5.5rem; height: 5.5rem; flex: none; }
.score-ring .track { stroke: var(--border); }
.score-ring.good .value { stroke: var(--ok); }
.score-ring.warn .value { stroke: var(--warn); }
.score-ring.bad .value { stroke: var(--bad); }
.score-ring text { fill: var(--text); font-size: 20px; font-weight: 500; }
.score-card h1 { font-size: 1.25rem; font-weight: 500; margin: 0 0 0.125rem; overflow-wrap: anywhere; }
.score-card p { margin: 0; color: var(--muted); }
.score-card .failed { color: var(--bad); }

dns-summary { display: block; margin-bottom: 1rem; }
.summary-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.summary-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.summary-header h3 { font-size: 0.8125rem; font-weight: 500; margin: 0; }
.ai-badge {
  font-size: 0.625rem;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-weight: 600;
}
.skeleton { animation: pulse 1.5s ease-in-out infinite; }
.skeleton-line { height: 0.875rem; background: var(--border); border-radius: 3px; margin-bottom: 0.5rem; }
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.summary-content { font-size: 0.875rem; line-height: 1.6; }
.summary-content h2 { font-size: 1rem; font-weight: 500; margin: 1rem 0 0.5rem; }
.summary-content h2:first-child { margin-top: 0; }
.summary-content p { margin: 0 0 0.5rem; }
.summary-content ul { margin: 0.5rem 0; padding-left: 1.25rem; }
.summary-content li { margin-bottom: 0.25rem; }
.summary-error {
  color: var(--warn-text);
  background: var(--warn-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
}

.failures {
  background: var(--bad-bg);
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  padding: 0.25rem 1rem;
  margin-bottom: 1rem;
}

.result-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 1rem;
  margin-bottom: 0.5rem;
}
.result-section summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  cursor: pointer;
  list-style: none;
}
.result-section summary::-webkit-details-marker { display: none; }
.result-section summary::after { content: "\25BE"; color: var(--muted); }
.result-section[open] summary::after { content: "\25B4"; }
.category-status { width: 1rem; font-weight: 600; text-align: center; }
.category-status.success { color: var(--ok); }
.category-status.failure { color: var(--bad); }
.category-name { flex: 1; font-weight: 500; }
.category-bar { display: flex; width: 5.5rem; height: 0.375rem; border-radius: 3px; overflow: hidden; background: var(--border); }
.category-bar .pass { background: var(--ok); }
.category-bar .fail { background: var(--bad); }
.category-count { width: 4.5rem; text-align: right; font-size: 0.8125rem; color: var(--muted); }

.result-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; }
.result-item + .result-item, .result-section summary + .result-item { border-top: 1px solid var(--border); }
.result-status .icon {
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}
.icon.success { background: var(--ok); }
.icon.failure { background: var(--bad); }
.icon.info { background: var(--info); font-style: italic; }
.result-content { flex: 1; min-width: 0; }
.result-name { font-weight: 500; }
.result-category { margin-left: auto; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.result-message { color: var(--muted); font-size: 0.875rem; }
.result-message p { margin: 0; }
.result-message p + p { margin-top: 0.5rem; }
.result-message code, .result-message pre {
  background: var(--bg);
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}
.result-message pre { padding: 0.75rem; overflow-x: auto; margin: 0.5rem 0 0; }

.check-another-container { margin: 2rem 0; text-align: center; }
.check-another-container a { font-weight: 500; text-decoration: none; }
.check-another-container a:hover { text-decoration: underline; }

/* Error pages */
.error-page { text-align: center; padding: 2rem 1rem; }
.error-icon {
  display: inline-grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.error-page h1 { font-weight: 500; margin: 0 0 0.5rem; }
.error-domain { margin: 0 0 1rem; }
.error-domain code { background: var(--card); border: 1px solid var(--border); padding: 0.25rem 0.75rem; border-radius: 8px; color: var(--bad); }
.error-message { color: var(--muted); max-width: 28rem; margin: 0 auto 1.5rem; }
.error-hints { text-align: left; display: inline-block; margin: 0 auto 1.5rem; padding-left: 1.5rem; color: var(--muted); font-size: 0.875rem; }
.error-hints li { margin-bottom: 0.25rem; }

/* Content */
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { margin-bottom: 1.5rem; }
.guide-list a { font-weight: 500; font-size: 1.1rem; }
.guide-list p { margin: 0.25rem 0 0; color: var(--muted); }
.prose { line-height: 1.7; }
.prose h1 { font-size: 2rem; font-weight: 500; margin: 2rem 0 1rem; }
.prose h2 { font-size: 1.25rem; font-weight: 500; margin: 2rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose code { background: var(--card); border: 1px solid var(--border); padding: 0.1rem 0.35rem; border-radius: 6px; font-size: 0.875em; }
.prose pre { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose-cta { margin-top: 2rem; text-align: center; }
