/* ── CSS Variables ───────────────────────────────────── */
:root {
  --bg-page: #f4f5f7;
  --bg-card: #ffffff;
  --bg-code: #eef0f3;

  --color-primary: #4f46e5;
  --color-primary-dim: rgba(79, 70, 229, 0.12);

  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;

  --color-border: #e2e8f0;
  --color-success: #10b981;
  --color-success-dim: rgba(16, 185, 129, 0.12);

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(15, 23, 42, 0.1), 0 12px 32px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Menlo, monospace;

  --nav-height: 62px;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  background: transparent;
  will-change: transform;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

/* Frosted glass style when scrolled */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--color-border);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  transition: color 0.25s ease;
}

.navbar.scrolled .navbar-brand {
  color: var(--color-text);
}

.navbar-brand em {
  font-style: normal;
  opacity: 0.55;
}

.navbar.scrolled .navbar-brand em {
  color: var(--color-primary);
  opacity: 1;
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0c0f1e 0%, #1a1060 50%, #0c0f1e 100%);
  padding: calc(var(--nav-height) + 64px) 32px 72px;
  text-align: center;
}

/* Background radial glow */
.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 55vw);
  height: min(700px, 55vw);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

.hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.9);
  margin-bottom: 20px;
}

.hero-eyebrow::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 8px #818cf8;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 20px;
  white-space: pre-line;
}

.hero-desc {
  font-size: 1rem;
  color: rgba(203, 213, 225, 0.85);
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto 40px;
}

/* Hero stats bar */
.hero-stats {
  display: inline-flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.hero-stat {
  padding: 10px 24px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat:last-child {
  border-right: none;
}

.hero-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 3px;
}

.hero-stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(165, 180, 252, 0.75);
}

/* ── Main content ─────────────────────────────────────── */
.page-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 56px;
}

/* ── Filter bar ───────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--bg-card);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  line-height: 1;
}

.filter-tab .count {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-code);
  color: var(--color-text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  transition: all 0.15s;
}

.filter-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-tab:hover .count {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}

.filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.filter-tab.active .count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── Card grid ────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ── DNS card ─────────────────────────────────────────── */
.dns-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.dns-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* Top color accent bar */
.card-accent {
  height: 4px;
  width: 100%;
}

/* Card header */
.card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.provider-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}

.provider-info {
  min-width: 0;
}

.provider-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1px;
  transition: color 0.15s;
}

.provider-link:hover {
  color: var(--color-primary);
}

.provider-link svg {
  width: 10px;
  height: 10px;
}

/* Card badges */
.card-badges {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-doh {
  background: var(--color-success-dim);
  color: #059669;
}

.badge-ipv6 {
  background: var(--color-primary-dim);
  color: var(--color-primary);
}

/* Card body */
.card-body {
  flex: 1;
  padding: 0 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Address group */
.addr-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.addr-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.addr-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.addr-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-code);
  color: var(--color-text);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  line-height: 1.4;
  word-break: break-all;
  flex: 1;
}

.copy-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  opacity: 0;
}

.addr-row:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-dim);
}

.copy-btn.copied {
  color: var(--color-success);
  background: var(--color-success-dim);
  opacity: 1;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}

.copy-btn .check-icon {
  display: none;
}

.copy-btn.copied svg:not(.check-icon) {
  display: none;
}

.copy-btn.copied .check-icon {
  display: block;
}

/* DoH group — full width, URLs can be long */
.addr-group.doh-group .addr-chip {
  font-size: 0.75rem;
  word-break: break-all;
}

/* Section divider */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 2px 0;
}

/* ── Empty state ──────────────────────────────────────── */
.no-results {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* ── Toast ────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: #0f172a;
  color: #fff;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, #0c0f1e 0%, #0a0c1f 60%, #08091a 100%);
  border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-note {
  display: flex;
  gap: 16px;
  padding: 40px 0 32px;
}

.footer-note-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-note-body {
  flex: 1;
  min-width: 0;
}

.footer-note-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(203, 213, 225, 0.9);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.footer-tip {
  font-size: 0.83rem;
  color: rgba(148, 163, 184, 0.7);
  line-height: 1.9;
}

.footer-tip-second {
  margin-top: 12px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom .footer-inner {
  padding-top: 16px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-copyright {
  font-size: 0.78rem;
  color: rgba(100, 116, 139, 0.6);
}

/* ── Responsive ───────────────────────────────────────── */

/* Large screens (1280px+): switch to 3-column grid */
@media (min-width: 1280px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--nav-height) + 40px) 20px 56px;
  }

  .hero-stats {
    flex-direction: row;
  }

  .hero-stat {
    padding: 8px 16px;
  }

  .page-body {
    padding: 28px 16px 60px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .navbar-inner {
    padding: 0 20px;
  }

  .footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .footer-note {
    padding: 28px 0 24px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-stat-number {
    font-size: 1.2rem;
  }

  /* Always show copy button on touch devices */
  .copy-btn {
    opacity: 1;
  }
}
