/* Route Radar — tech dark dashboard */
:root {
  --bg: #05060a;
  --bg-2: #0b1020;
  --panel: rgba(255,255,255,.045);
  --panel-2: rgba(255,255,255,.065);
  --line: rgba(255,255,255,.09);
  --ink: #eef2ff;
  --muted: #8492a6;
  --muted-2: #5a6578;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --ok: #10b981;
  --err: #f43f5e;
  --warn: #f59e0b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--sans);
  background:
    radial-gradient(circle at 16% -6%, rgba(99,102,241,.28), transparent 30rem),
    radial-gradient(circle at 84% 10%, rgba(34,211,238,.20), transparent 28rem),
    linear-gradient(160deg, #05060a, #090f1e 45%, #0a0b18);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }

/* ===== topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(5,6,10,.62);
  backdrop-filter: blur(18px) saturate(140%);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
}
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  color: var(--accent-2);
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.10));
  box-shadow: 0 0 26px rgba(34,211,238,.16);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand-sub { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.ghost-btn {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  padding: 9px 13px; border-radius: 999px;
  font-weight: 700; font-size: 13px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.ghost-btn:hover { background: rgba(255,255,255,.11); border-color: rgba(255,255,255,.20); }
.ghost-btn:active { transform: scale(.98); }
.ghost-primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(99,102,241,.92), rgba(34,211,238,.58));
  border-color: rgba(255,255,255,.18);
}

/* ===== layout ===== */
.page { max-width: 1200px; margin: 0 auto; padding: 34px 16px 80px; }
.hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,540px); gap: 26px; align-items: stretch; }
.hero h1 {
  margin: 18px 0 0; font-size: clamp(44px, 7.2vw, 84px); line-height: .92; letter-spacing: -.08em; font-weight: 820;
}
.hero p { margin: 24px 0 0; max-width: 680px; color: var(--muted); font-size: clamp(16px, 1.9vw, 18px); line-height: 1.7; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--accent-2); font-family: var(--mono); font-size: 12px; font-weight: 800; letter-spacing: .09em;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--ok);
  box-shadow: 0 0 0 6px rgba(16,185,129,.12), 0 0 22px rgba(16,185,129,.9);
}

/* ===== hero panel ===== */
.hero-panel {
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.18); border-radius: 34px; padding: 24px;
  background:
    radial-gradient(circle at 60% 26%, rgba(34,211,238,.18), transparent 18rem),
    linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.022));
  box-shadow: 0 22px 80px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.09);
}
.hero-panel::after {
  content: "ROUTE\A RADAR"; white-space: pre;
  position: absolute; right: 22px; bottom: 18px;
  color: rgba(255,255,255,.055); font-size: 60px; line-height: .82; font-weight: 820; letter-spacing: -.08em; text-align: right;
}
.radar {
  position: absolute; right: -72px; top: -78px; width: 300px; height: 300px; border-radius: 50%;
  border: 1px solid rgba(34,211,238,.18);
  background: radial-gradient(circle, rgba(34,211,238,.18) 0 3px, transparent 4px 44px, rgba(255,255,255,.04) 45px 46px, transparent 47px 92px, rgba(255,255,255,.04) 93px 94px, transparent 95px);
  box-shadow: inset 0 0 66px rgba(34,211,238,.08);
}
.radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(34,211,238,.32), transparent 26%, transparent); animation: sweep 5.5s linear infinite; }
.radar-core { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; translate: -50% -50%; background: var(--accent-2); box-shadow: 0 0 22px var(--accent-2); }
@keyframes sweep { to { transform: rotate(360deg); } }
.hero-stat { position: relative; z-index: 1; display: grid; gap: 14px; max-width: 100%; }
.label {
  display: inline-flex; width: fit-content; align-items: center; gap: 7px; padding: 5px 10px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.045);
  color: #d6e4ff; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.label.cyan { color: #bff4ff; border-color: rgba(34,211,238,.28); background: rgba(34,211,238,.09); }
.hero-stat strong {
  font-family: var(--mono); max-width: 100%; word-break: break-all;
  font-size: clamp(28px, 4vw, 44px); line-height: 1.04; letter-spacing: -.065em;
  color: #fff; text-shadow: 0 0 30px rgba(34,211,238,.22);
}
.hero-location, .hero-meta { color: var(--muted); line-height: 1.5; }
.hero-meta { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 28px; font-size: 13px; }

/* ===== route grid ===== */
.route-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 22px; }
.route-grid > article {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 22px; padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.024));
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  display: flex; flex-direction: column; gap: 11px; min-height: 220px;
}
.route-domestic { border-color: rgba(244,114,182,.18); }
.route-oversea { border-color: rgba(99,102,241,.22); }
.route-ipv6 { border-color: rgba(244,114,182,.18); }
.route-cf { border-color: rgba(34,211,238,.20); }
.route-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; position: relative; z-index: 1; }
.route-icon { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--ink); padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
.route-grid > article h2 { position: relative; z-index: 1; margin: 6px 0 0; font-size: 18px; font-weight: 780; letter-spacing: -.04em; }
.route-ip { position: relative; z-index: 1; font-family: var(--mono); min-height: 56px; color: #fff; font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -.045em; word-break: break-all; }
.route-meta { position: relative; z-index: 1; margin: auto 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* pills */
.status-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 770; border: 1px solid var(--line); white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 14px currentColor; }
.status-loading { color: var(--warn); background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.22); }
.status-ok { color: var(--ok); background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.22); }
.status-error, .status-timeout { color: var(--err); background: rgba(244,63,94,.08); border-color: rgba(244,63,94,.22); }
.status-mixed { color: var(--accent-2); background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.22); }

/* sections */
.section { margin-top: 32px; }
.section-title { margin: 0; font-size: 22px; font-weight: 780; letter-spacing: -.04em; }
.section-subtitle { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
.split-section { display: grid; grid-template-columns: minmax(0,.85fr) minmax(280px,1.15fr); gap: 18px; align-items: stretch; }
.diagnostic-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); }
.diagnostic-title { font-size: 17px; font-weight: 780; letter-spacing: -.03em; }
.diagnostic-body { margin-top: 8px; color: var(--muted); line-height: 1.55; }

.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 14px; margin-top: 14px; }
.providers > div { padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)); }
.provider-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.provider-body { color: #cdd5e0; font-size: 14px; line-height: 1.55; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); color: #fff; word-break: break-all; letter-spacing: -.035em; }

.lookup { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)); }
.lookup input { width: 100%; border: 0; outline: 0; color: var(--ink); background: rgba(0,0,0,.28); border-radius: 16px; padding: 14px 14px; min-width: 0; }
.lookup input::placeholder { color: var(--muted-2); }
.lookup button { border: 0; border-radius: 16px; padding: 0 18px; color: #fff; cursor: pointer; font-weight: 780; background: linear-gradient(135deg, var(--accent), #3bbef4); }
.lookup-error { grid-column: 1 / -1; margin: 0 4px 2px; color: var(--err); font-size: 13px; }
.lookup-result { margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)); }
.block-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.block-row-key { color: var(--muted); }
.block-row-value { color: #d6e4ff; word-break: break-all; }

.connectivity-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.conn-card { padding: 18px; min-height: 110px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.026)); }
.conn-head { font-weight: 780; margin-bottom: 18px; }
.conn-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); }
.conn-ms { font-family: var(--mono); font-size: 12px; }

.footer { margin-top: 50px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; color: var(--ink); background: rgba(14,16,24,.88); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 10px 14px; backdrop-filter: blur(16px); box-shadow: 0 16px 60px rgba(0,0,0,.48); }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-panel { min-height: 340px; }
  .route-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split-section { grid-template-columns: 1fr; }
  .connectivity-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .topbar-inner, .page { padding-left: 14px; padding-right: 14px; }
  .topbar-inner { height: auto; align-items: flex-start; gap: 10px; }
  .brand-sub { display: none; }
  .ghost-btn { padding: 8px 10px; font-size: 12px; }
  .page { padding-top: 26px; }
  .hero h1 { font-size: 52px; }
  .hero-panel { min-height: 290px; border-radius: 26px; padding: 18px; }
  .route-grid { grid-template-columns: 1fr; }
  .route-grid > article { min-height: 178px; }
  .lookup { grid-template-columns: 1fr; }
  .lookup button { min-height: 46px; }
  .connectivity-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .radar-sweep { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
