:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0b1728;
  --panel-2: #0e1c30;
  --line: rgba(146, 170, 199, 0.18);
  --muted: #8292a8;
  --text: #eef5ff;
  --cyan: #40e8d2;
  --blue: #4ea2ff;
  --amber: #ffbf5e;
  --danger: #ff6f76;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(83, 117, 154, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(83, 117, 154, .045) 1px, transparent 1px), radial-gradient(circle at 18% 2%, rgba(38, 193, 187, .12), transparent 35%);
  background-size: 38px 38px, 38px 38px, auto;
  mask-image: linear-gradient(to bottom, black 20%, transparent 85%);
}

button, input { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 76px);
  background: rgba(7, 17, 31, .78);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark { width: 37px; height: 37px; position: relative; display: block; }
.brand-mark i { width: 7px; border-radius: 5px; background: var(--cyan); position: absolute; bottom: 5px; transform: rotate(35deg); box-shadow: 0 0 14px rgba(64, 232, 210, .3); }
.brand-mark i:nth-child(1) { height: 15px; left: 6px; }
.brand-mark i:nth-child(2) { height: 27px; left: 15px; }
.brand-mark i:nth-child(3) { height: 20px; left: 24px; }
.brand b { display:block; font-size: 14px; letter-spacing: .16em; }
.brand small { display:block; color: var(--muted); font: 500 9px var(--mono); letter-spacing: .09em; margin-top: 3px; }
.live { color: #9facc0; font: 500 11px var(--mono); letter-spacing: .08em; }
.live span { display:inline-block; width:7px; height:7px; margin-right:8px; border-radius:50%; background:var(--cyan); box-shadow:0 0 12px var(--cyan); animation:pulse 2s infinite; }
@keyframes pulse { 50% { opacity:.4; box-shadow:0 0 2px var(--cyan); } }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro { display:grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 8vw, 112px); align-items:end; padding: 78px 0 62px; }
.eyebrow { margin:0 0 14px; color:var(--cyan); font:600 11px var(--mono); letter-spacing:.18em; }
h1 { margin:0; font-size:clamp(42px, 5.6vw, 76px); line-height:1.02; letter-spacing:-.055em; }
h1 em { color:#91a1b6; font-style:normal; font-weight:500; }
.lead { max-width:510px; color:#94a3b7; line-height:1.7; margin:25px 0 0; font-size:15px; }
.search-panel { background:linear-gradient(145deg, rgba(18,37,61,.95), rgba(10,23,40,.95)); border:1px solid rgba(128,158,193,.26); padding:26px; border-radius:10px; box-shadow:0 24px 70px rgba(0,0,0,.25); }
.search-panel label { color:#c2cedd; font-size:12px; font-weight:600; display:block; margin-bottom:10px; }
.search-row { height:60px; display:flex; align-items:center; background:#07111d; border:1px solid #2a4059; border-radius:7px; padding:6px; transition:.2s; }
.search-row:focus-within { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(64,232,210,.08); }
.prompt { color:var(--cyan); font:600 24px var(--mono); margin-left:12px; }
.search-row input { min-width:0; flex:1; height:100%; color:white; background:transparent; border:0; outline:0; padding:0 13px; font:500 14px var(--mono); }
.search-row input::placeholder { color:#617187; }
.search-row button { height:46px; border:0; border-radius:5px; background:var(--cyan); color:#05201f; font-size:12px; font-weight:700; padding:0 18px; display:flex; gap:22px; align-items:center; }
.search-row button:hover { background:#73f5e4; }
.search-foot { display:flex; align-items:center; gap:8px; margin-top:14px; color:#687a91; font-size:10px; }
.search-foot button { color:#92a8c1; padding:4px 7px; background:transparent; border:1px solid #283a50; border-radius:3px; font:500 9px var(--mono); }
.search-foot button:hover { color:var(--cyan); border-color:var(--cyan); }

.workspace { min-height:500px; border-top:1px solid var(--line); padding:52px 0 80px; }
.status { min-height:380px; display:flex; justify-content:center; align-items:center; gap:17px; }
.status[hidden] { display:none; }
.status b,.status small { display:block; }
.status b { font-size:15px; }
.status small { color:var(--muted); margin-top:6px; font-size:12px; }
.spinner { width:33px; height:33px; border:2px solid #22354b; border-top-color:var(--cyan); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.result-head { display:flex; align-items:end; justify-content:space-between; margin-bottom:28px; }
.result-head h2 { margin:0; font:500 clamp(23px,3vw,34px) var(--mono); letter-spacing:-.04em; }
.timestamp { text-align:right; }
.timestamp span,.timestamp b { display:block; }
.timestamp span { color:#6e8097; font-size:10px; text-transform:uppercase; letter-spacing:.1em; }
.timestamp b { margin-top:5px; color:#a8b5c5; font:500 11px var(--mono); }
.stats { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid var(--line); border-radius:8px 8px 0 0; overflow:hidden; }
.stat { padding:19px 22px; background:rgba(10,23,40,.78); border-right:1px solid var(--line); min-width:0; }
.stat:last-child { border-right:0; }
.stat span { color:#6f8299; font-size:9px; text-transform:uppercase; letter-spacing:.1em; }
.stat b { display:block; margin-top:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:500 13px var(--mono); }
.map-shell { border:1px solid var(--line); border-top:0; border-radius:0 0 8px 8px; background:rgba(8,18,32,.82); overflow:hidden; }
.map-toolbar { height:54px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 20px; }
.legend { display:flex; gap:18px; color:#8192a7; font-size:10px; }
.legend span { display:flex; align-items:center; gap:6px; }
.dot { width:7px; height:7px; border-radius:50%; display:block; }
.dot.source { background:var(--cyan); }
.dot.transit { background:var(--blue); }
.dot.destination { background:var(--amber); }
#copy-link { color:#93a5ba; font:500 10px var(--mono); background:transparent; border:1px solid #263a51; border-radius:4px; padding:7px 10px; }
#copy-link:hover { color:white; border-color:#506984; }
.route-map { min-height:410px; overflow:auto; display:flex; justify-content:center; background-image:radial-gradient(rgba(89,122,158,.12) 1px,transparent 1px); background-size:21px 21px; }
.route-map svg { display:block; max-width:100%; height:auto; }
.route-edge { stroke:#31516e; stroke-width:2; fill:none; }
.route-edge.inferred { stroke-dasharray:7 7; }
.edge-dot { fill:var(--cyan); filter:drop-shadow(0 0 5px var(--cyan)); }
.node-card { fill:#0c1c30; stroke:#35516e; stroke-width:1; }
.node-card.source { stroke:var(--cyan); fill:#0b292d; }
.node-card.destination { stroke:var(--amber); fill:#2a2116; }
.node-asn { fill:#eaf3ff; font:600 13px var(--mono); text-anchor:middle; }
.node-name { fill:#8396ae; font:500 10px var(--sans); text-anchor:middle; }
.node-index { fill:#57718c; font:500 9px var(--mono); }
.map-note { display:flex; gap:10px; align-items:flex-start; border-top:1px solid var(--line); color:#708399; padding:13px 18px; font-size:10px; line-height:1.5; }
.map-note span { flex:0 0 auto; display:grid; place-items:center; width:16px; height:16px; border:1px solid #40556d; border-radius:50%; font:600 9px var(--mono); }
.map-note p { margin:0; }
.alternatives,.trace-details { margin-top:42px; }
.section-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.section-title h3 { margin:0; font-size:16px; }
.section-title span { color:#657991; font:500 10px var(--mono); }
.route-list { display:grid; gap:8px; }
.route-option { display:grid; grid-template-columns:80px 1fr 50px; align-items:center; gap:16px; width:100%; text-align:left; padding:15px 17px; border-radius:6px; border:1px solid var(--line); background:#0a1728; color:inherit; }
.route-option:hover,.route-option.active { border-color:#365a78; background:#0e1e32; }
.route-option.active { box-shadow:inset 3px 0 var(--cyan); }
.route-option > b { color:var(--cyan); font:500 10px var(--mono); }
.route-option code { color:#9cafc4; font:500 11px var(--mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.route-option small { color:#667c95; text-align:right; font:500 9px var(--mono); }
.trace-table-wrap { border:1px solid var(--line); border-radius:8px; overflow:auto; background:#0a1728; }
.trace-table { width:100%; border-collapse:collapse; min-width:700px; }
.trace-table th { color:#667b93; font:500 9px var(--mono); text-align:left; text-transform:uppercase; letter-spacing:.11em; padding:13px 16px; border-bottom:1px solid var(--line); }
.trace-table td { color:#9db0c6; font:500 11px var(--mono); padding:13px 16px; border-bottom:1px solid rgba(146,170,199,.1); }
.trace-table tr:last-child td { border-bottom:0; }
.trace-table td:first-child { color:#56718d; width:50px; }
.trace-table td:nth-child(3) { color:var(--blue); }
.trace-table td:last-child { color:var(--cyan); text-align:right; }
.trace-table th:last-child { text-align:right; }
.trace-timeout { color:#566b82 !important; }
.empty { min-height:380px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.empty-icon { width:48px; height:48px; border:1px solid rgba(255,111,118,.45); color:var(--danger); display:grid; place-items:center; border-radius:50%; font:300 25px var(--mono); }
.empty h2 { margin:18px 0 7px; font-size:22px; }
.empty p { color:var(--muted); margin:0; font-size:13px; }
.empty button { color:var(--cyan); background:transparent; border:0; margin-top:22px; font-size:12px; }
footer { max-width:1180px; width:calc(100% - 40px); margin:0 auto; border-top:1px solid var(--line); min-height:86px; display:flex; align-items:center; justify-content:space-between; color:#65778d; font:500 10px var(--mono); }
footer a { color:#8196ae; text-decoration:none; }
footer a:hover { color:var(--cyan); }

@media (max-width: 800px) {
  .topbar { padding:0 20px; }
  .live { font-size:0; }
  .live span { margin:0; }
  main { width:min(100% - 28px, 640px); }
  .intro { grid-template-columns:1fr; padding:52px 0 42px; gap:36px; }
  h1 { font-size:48px; }
  .search-panel { padding:18px; }
  .search-row button { padding:0 13px; }
  .search-row button span { display:none; }
  .search-foot { flex-wrap:wrap; }
  .stats { grid-template-columns:1fr 1fr; }
  .stat:nth-child(2) { border-right:0; }
  .stat:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .result-head { align-items:flex-start; }
  .timestamp { display:none; }
  .legend { gap:10px; }
  .legend span { font-size:0; }
  .legend span::after { font-size:9px; }
  .legend span:nth-child(1)::after { content:"Skynet"; }
  .legend span:nth-child(2)::after { content:"Транзит"; }
  .legend span:nth-child(3)::after { content:"Цель"; }
  .route-option { grid-template-columns:64px 1fr; }
  .route-option small { display:none; }
  footer { flex-direction:column; justify-content:center; gap:8px; }
}
