/* BuiltWith design system tokens */
:root {
  --bw-font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bw-nav-gradient: linear-gradient(102deg, rgba(9,67,3,1) 0%, rgb(18 58 13) 51%, rgba(9,67,3,1) 100%);
  --bw-primary: #004fff;
  --bw-primary-hover: #0062cc;
  --bw-success: #28a745;
  --bw-success-bg: #d4edda;
  --bw-success-text: #155724;
  --bw-warning: #ffc107;
  --bw-warning-bg: #fff3cd;
  --bw-warning-text: #856404;
  --bw-danger: #dc3545;
  --bw-danger-bg: #f8d7da;
  --bw-danger-text: #721c24;
  --bw-fg: #212529;
  --bw-fg-muted: #545d67;
  --bw-bg: #ffffff;
  --bw-bg-alt: #f8f9fa;
  --bw-border: #dee2e6;
  --bw-border-subtle: #e9ecef;
  --bw-gray-400: #ced4da;
  --bw-gray-700: #495057;
  --bw-radius: 0.25rem;
  --bw-transition: 0.15s ease-in-out;
}

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

html { font-size: 16px; }

body {
  font-family: var(--bw-font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--bw-fg);
  background: var(--bw-bg);
}

/* ---- Nav ---- */
.bw-nav {
  background: var(--bw-nav-gradient);
  height: 56px;
  display: flex;
  align-items: center;
}

.bw-nav-inner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ---- Language switcher ---- */
.bw-lang-switcher {
  display: flex;
  gap: 2px;
}

.bw-lang-link {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5);
  padding: 3px 7px;
  border-radius: var(--bw-radius);
  text-decoration: none;
  transition: color var(--bw-transition), background var(--bw-transition);
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.bw-lang-link:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
}

.bw-lang-link.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.bw-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}


/* ---- Hero ---- */
.bw-hero {
  background: var(--bw-nav-gradient);
  border-bottom: 3px solid rgba(255,255,255,0.08);
  padding: 20px 0 36px;
}

.bw-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.bw-hero-inner {
  display: flex;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.bw-hero-text {
  flex: 1;
  min-width: 200px;
}

.bw-hero-title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.2px;
}

.bw-hero-sub {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  margin-top: 6px;
}

.bw-search-wrap {
  flex: 0 0 380px;
}

.bw-input-row {
  display: flex;
  gap: 6px;
}

.bw-input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--bw-radius);
  padding: 0.375rem 0.75rem;
  font-family: var(--bw-font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--bw-fg);
  background: #fff;
  outline: none;
  transition: border-color var(--bw-transition), box-shadow var(--bw-transition);
}

.bw-input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bw-input::placeholder { color: var(--bw-fg-muted); }

.bw-btn-primary {
  background: var(--bw-primary);
  color: #fff;
  border: 1px solid var(--bw-primary);
  border-radius: var(--bw-radius);
  padding: 0.375rem 1rem;
  font-family: var(--bw-font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--bw-transition), border-color var(--bw-transition);
}

.bw-btn-primary:hover { background: var(--bw-primary-hover); border-color: var(--bw-primary-hover); }
.bw-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.bw-field-error {
  color: #ffcdd2;
  font-size: 0.8125rem;
  margin-top: 5px;
  min-height: 1.2em;
}

/* ---- Domain row + cached badge ---- */
.bw-domain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bw-cached-badge {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bw-fg-muted);
  background: var(--bw-border-subtle);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  padding: 1px 7px;
  line-height: 1.6;
}

/* ---- Examples ---- */
.bw-examples {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.bw-examples-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.bw-example-link {
  font-size: 0.7rem;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: opacity var(--bw-transition);
}

.bw-example-link:hover {
  opacity: 0.75;
  color: #fff;
}

/* ---- History ---- */
.bw-history {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.bw-history-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.bw-history-link {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--bw-radius);
  padding: 2px 9px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--bw-transition), color var(--bw-transition);
  white-space: nowrap;
}

.bw-history-link:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ---- Body ---- */
.bw-body-section {
  padding: 32px 0 60px;
  min-height: 160px;
}

/* Loading */
.bw-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bw-fg-muted);
  font-size: 0.875rem;
  padding: 8px 0;
}

.bw-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bw-border);
  border-top-color: var(--bw-primary);
  border-radius: 50%;
  animation: bw-spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

/* Alert */
.bw-alert-danger {
  border: 1px solid #f5c6cb;
  border-radius: var(--bw-radius);
  background: #fff5f5;
  color: #721c24;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

/* ---- Celery Man ---- */
.bw-celery {
  text-align: center;
  padding: 2rem 0;
}

.bw-celery-gif {
  max-width: 720px;
  width: 100%;
  border-radius: var(--bw-radius);
  display: block;
  margin: 0 auto;
}

.bw-celery-msg {
  margin-top: 0.75rem;
  color: var(--bw-fg-muted);
  font-size: 0.9rem;
}

/* ---- Card ---- */
.bw-card {
  background: var(--bw-bg);
  border: 1px solid var(--bw-border);
  border-radius: var(--bw-radius);
  overflow: hidden;
}

.bw-summary-card {
  margin-top: 1rem;
  padding: 1.25rem 1.5rem;
}

.bw-summary-text {
  margin-top: 0.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--bw-fg);
}

.bw-summary-cta-row {
  margin-top: 1rem;
  text-align: right;
}

.bw-btn-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--bw-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--bw-radius);
  text-decoration: none;
  transition: background var(--bw-transition);
}

.bw-btn-cta:hover {
  background: var(--bw-primary-hover);
  color: #fff;
}

.bw-card-header {
  background: var(--bw-bg-alt);
  border-bottom: 1px solid var(--bw-border);
  padding: 14px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bw-card-header-right {
  text-align: right;
}

.bw-label-sm {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bw-fg-muted);
  margin-bottom: 2px;
}

.bw-result-domain {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bw-fg);
  line-height: 1.2;
}

.bw-avg-score {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.bw-avg-score.high   { color: var(--bw-success-text); }
.bw-avg-score.medium { color: var(--bw-warning-text); }
.bw-avg-score.low    { color: var(--bw-danger); }

/* ---- Stat grid (2x2) ---- */
.bw-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.bw-stat {
  padding: 20px 20px 18px;
  border-right: 1px solid var(--bw-border-subtle);
  border-bottom: 1px solid var(--bw-border-subtle);
  position: relative;
}

.bw-stat:nth-child(2n) { border-right: none; }
.bw-stat:nth-child(3), .bw-stat:nth-child(4) { border-bottom: none; }

.bw-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bw-fg-muted);
  margin-bottom: 6px;
}

.bw-stat-number {
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1;
  color: var(--bw-fg);
  margin-bottom: 8px;
}

.bw-stat-number.high   { color: var(--bw-success-text); }
.bw-stat-number.medium { color: var(--bw-warning-text); }
.bw-stat-number.low    { color: var(--bw-danger); }

/* Thin progress bar */
.bw-bar-track {
  height: 4px;
  background: var(--bw-border-subtle);
  border-radius: 2px;
  margin-bottom: 8px;
  overflow: hidden;
}

.bw-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.bw-bar-fill.high   { background: var(--bw-success); }
.bw-bar-fill.medium { background: var(--bw-warning); }
.bw-bar-fill.low    { background: var(--bw-danger); }

.bw-stat-desc {
  font-size: 0.8125rem;
  color: var(--bw-fg-muted);
  line-height: 1.4;
}

/* ---- Card footer (summary row) ---- */
.bw-card-footer {
  background: var(--bw-bg-alt);
  border-top: 1px solid var(--bw-border);
  padding: 12px 20px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.bw-summary-item {}

.bw-summary-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bw-fg-muted);
}

.bw-summary-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1px;
}

.bw-summary-value.high   { color: var(--bw-success-text); }
.bw-summary-value.medium { color: var(--bw-warning-text); }
.bw-summary-value.low    { color: var(--bw-danger); }

/* ---- Footer ---- */
.bw-footer {
  background: var(--bw-bg-alt);
  border-top: 1px solid var(--bw-border);
  padding: 16px 0 12px;
  font-size: 0.8125rem;
  color: var(--bw-fg-muted);
}

.bw-footer-top {
  margin-bottom: 10px;
}

.bw-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  border-top: 1px solid var(--bw-border-subtle);
  padding-top: 10px;
}

.bw-footer-dev-link {
  font-size: 0.72rem;
  color: var(--bw-fg-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 0;
}

.bw-footer-dev-link:hover {
  color: var(--bw-primary);
  text-decoration: underline;
}

.bw-footer-link {
  color: var(--bw-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.bw-footer-link:hover { opacity: 0.75; }

.bw-footer-logo {
  display: block;
  height: 14px;
  width: auto;
  vertical-align: middle;
}

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .bw-hero-inner { flex-direction: column; align-items: stretch; gap: 20px; }
  .bw-search-wrap { flex: none; width: 100%; }
  .bw-container { padding: 0 16px; }
  .bw-input-row { flex-direction: column; gap: 8px; }
  .bw-btn-primary { width: 100%; }
  .bw-stat-grid { grid-template-columns: 1fr; }
  .bw-stat:nth-child(2n) { border-right: none; }
  .bw-stat:nth-child(3) { border-bottom: 1px solid var(--bw-border-subtle); }
  .bw-stat:last-child { border-bottom: none; }
}
