/* Colours and fonts match the Mping app (dark theme). */
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito-Variable.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/NunitoSans-Variable.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --canvas: #0E0E0F;
  --base: #121214;
  --panel: #131316;
  --ink: rgba(255, 255, 255, 0.93);
  --ink-dim: rgba(255, 255, 255, 0.58);
  --line: rgba(255, 255, 255, 0.08);
  --go: #4DD973;
  --healthy-fill: #33B857;
  --healthy-text: #57DB70;
  --tile-healthy: #1D4A2A;
  --tile-unknown: #1F2022;
  --display: "Nunito", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--healthy-text); }
p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0; text-wrap: balance; }

/* ---------- first screen: the workspace ----------
   Tile sizes, paddings, type sizes, opacities and colours are the app's own
   (its tile settings and theme). Each tile is drawn at the app's 1:1 size and
   enlarged with zoom, as the app's map does when zoomed in. */
.workspace {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: 70px; /* room for the bottom pill */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}
.appbar { display: flex; align-items: center; gap: 12px; padding: 20px 24px; position: relative; z-index: 3; }
.appbar img { width: 44px; height: 44px; border-radius: 10px; }
.appname { font: 800 24px/1 var(--display); }
.tag { font: 600 12px var(--body); color: var(--ink-dim); vertical-align: 2px; }
.appsub { font: 700 13px var(--display); color: var(--ink-dim); margin-top: 3px; }

.canvas {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "sr sl" "h h" "foh foh" "s s";
  align-content: start;
  row-gap: 26px;
  padding: 0 40px 24px;
  max-width: 1500px; width: 100%; margin: 0 auto;
}
.canvas h1 { grid-area: h; text-align: center; font-size: clamp(28px, 4vw, 46px); margin-top: 10px; position: relative; z-index: 3; }
.canvas .small { grid-area: s; text-align: center; position: relative; z-index: 3; }
.area.sr { grid-area: sr; justify-self: start; }
.area.sl { grid-area: sl; justify-self: end; }
.area.foh { grid-area: foh; justify-self: center; }

.links { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.labels { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

/* location boxes, as the map draws them */
.area { background: rgba(70, 40, 40, 0.16); border: 1px solid rgba(255, 255, 255, 0.10); border-radius: 12px; padding: 12px 22px 24px; }
.area-name { font: 800 15px var(--display); margin-bottom: 16px; position: relative; z-index: 3; }
.area-row { display: flex; align-items: center; gap: 70px; }
.area-grid { display: flex; flex-direction: column; gap: 30px; }
.area.sr .area-grid { align-items: flex-start; }
.area.sl .area-grid { align-items: flex-end; }
.area-sub { display: flex; align-items: flex-start; gap: 36px; }

/* port box, as the app floats it beside a switch: 150 x 15 rows, one per amplifier */
.portbox { --z: 0.95; zoom: var(--z); position: relative; z-index: 2; padding: 7px 8px; border-radius: 8px; background: rgba(128, 128, 128, 0.32); border: 1px solid rgba(255, 255, 255, 0.16); }
.pb-head { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; font: 600 8px/1 var(--display); color: rgba(255, 255, 255, 0.62); }
.pb-head .ic { width: 9px; height: 8px; color: rgba(255, 255, 255, 0.5); }
.pb-head b { margin-left: auto; padding-left: 4px; font-weight: 700; color: rgba(87, 219, 112, 0.85); }
.pb-col { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.20); }
.pb-row { display: flex; align-items: center; gap: 3px; width: 150px; height: 15px; padding: 0 4px; background: #24562F; }
.pb-row + .pb-row { background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.22) 50%, transparent 50%); background-size: 4px 1px; background-repeat: repeat-x; background-position: top left; }
.pb-id { width: 14px; text-align: right; font: 700 11px/1 var(--mono); color: rgba(255, 255, 255, 0.92); flex: none; }
.pb-div { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.16); flex: none; }
.pb-data { font: 600 11px/1 var(--mono); color: rgba(255, 255, 255, 0.72); white-space: nowrap; overflow: hidden; display: flex; align-items: center; gap: 3px; transition: opacity 0.25s; }
.pb-data.fade { opacity: 0; }
.pb-data .lock { width: 8px; height: 10px; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M4 8V6a4 4 0 0 1 8 0v2h1.5A1.5 1.5 0 0 1 15 9.5v8a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 17.5v-8A1.5 1.5 0 0 1 2.5 8zm2 0h4V6a2 2 0 0 0-4 0z'/%3E%3C/svg%3E"); }
.ic.plug { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12h5m10 0h5M7 8h10v8H7z' fill='none' stroke='black' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.area-row.dl { gap: 240px; }

/* the device tile: 154 x 84, corner 10, padding 7 / 8 / 5 */
.tile {
  --z: 0.95;
  zoom: var(--z);
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  width: 154px; height: 84px;
  padding: 7px 8px 5px;
  border-radius: 10px;
  background: #1D4A2A;
  border: 1.05px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3), 0 0 7px rgba(51, 184, 87, 0.22);
  color: inherit; text-decoration: none;
  text-align: left;
}
/* the download tiles are the same 154 x 84 tile, just zoomed in further */
.tile.big { --z: 2.1; }
.big .t-ip { padding-right: 0; }
.big .t-name { font-size: 9.4px; padding-right: 22px; }
.big .t-ip { display: flex; align-items: center; gap: 4px; } /* the app shrinks a long name to fit, down to 62%; both names match */
/* platform logo, beside the platform name */
.os { display: inline-block; flex: none; width: 10px; height: 10px; background: rgba(255, 255, 255, 0.8); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.os.apple { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/%3E%3C/svg%3E"); }
.os.win { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 1h10.5v10.5H1zM12.5 1H23v10.5H12.5zM1 12.5h10.5V23H1zM12.5 12.5H23V23H12.5z'/%3E%3C/svg%3E"); width: 9px; height: 9px; }
.unknown .os { background: rgba(255, 255, 255, 0.7); }
.tile.unknown { background: #1F2022; box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3), 0 0 2px rgba(255, 255, 255, 0.10); }
.t-name { font: 600 12px/1.25 var(--display); color: rgba(255, 255, 255, 0.98); padding-right: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-ip { font: 400 10px/1.25 var(--mono); color: rgba(255, 255, 255, 0.482); margin-top: 2px; padding-right: 32px; white-space: nowrap; }
.t-type { display: flex; align-items: center; gap: 3px; font: 400 10px/1.25 var(--display); color: rgba(255, 255, 255, 0.446); margin-top: 1px; white-space: nowrap; }
.t-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 7px; }
.ping { font: 400 11px/1 var(--display); color: rgba(255, 255, 255, 0.96); padding: 5px 7px; border-radius: 7px; background: rgba(0, 0, 0, 0.24); border: 1px solid rgba(255, 255, 255, 0.16); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ping small { font-size: 8px; color: rgba(255, 255, 255, 0.5); margin-left: 3px; }
.temp { font: 400 11px/1 var(--display); color: #57DB70; padding: 4px 7px; border-radius: 7px; background: rgba(0, 0, 0, 0.21); border: 1px solid rgba(255, 255, 255, 0.14); font-variant-numeric: tabular-nums; white-space: nowrap; }
.unknown .ping { color: rgba(255, 255, 255, 0.6); }

/* type icons */
.ic { display: inline-block; width: 12px; height: 11px; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic.sw { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 7h14l-3-3M21 17H7l3 3' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic.dn { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v13m-5-5 5 5 5-5M4 21h16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* status dot: 20 px disc, 8 px dot, centred 14 px in from the right and 15 px down; ripple to 32 px */
.status { position: absolute; right: 4px; top: 5px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.26); }
.status::after { content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #33B857; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.0), 0 0 6px rgba(51, 184, 87, 0.7); }
.unknown .status::after { background: #66696F; box-shadow: none; }
/* the ping heartbeat, as the app fires it on every reply: a 32 px ring, 3 px line, growing from 0.45x to 1.55x
   while it fades from 84% to nothing over 0.82 s; one reply every 2 s (the app's ping interval) */
.ring { position: absolute; left: -6px; top: -6px; width: 32px; height: 32px; border-radius: 50%; border: 3px solid #33B857; opacity: 0; animation: ping 2s infinite; }
@keyframes ping { 0% { transform: scale(0.45); opacity: 0.84; animation-timing-function: ease-out; } 41% { transform: scale(1.55); opacity: 0; } 100% { transform: scale(1.55); opacity: 0; } }

/* every tile and port box except the two downloads is shown at 70%, so the downloads stand out.
   A canvas-coloured veil is used instead of opacity so the link lines behind a tile don't show through it. */
.portbox::before, .tile:not(.big)::before { content: ""; position: absolute; inset: -1.05px; border-radius: inherit; background: var(--canvas); opacity: 0.3; pointer-events: none; z-index: 3; }
.tile:not(.big) { box-shadow: 0 4px 7px rgba(0, 0, 0, 0.3), 0 0 7px rgba(51, 184, 87, 0.15); }

/* ping-only tile: 44 px tall, badge and address on one row */
.tile.pingonly { height: 44px; padding: 7px 8px; justify-content: space-between; }
.t-row { display: flex; align-items: center; gap: 6px; }
.t-row .t-ip { font-size: 8.7px; margin: 0; padding: 0; }
.badge { font: 400 9px/1 var(--display); color: rgba(255, 255, 255, 0.96); padding: 2px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); }

/* download tiles react like a selected tile */
a.tile { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
a.tile:hover, a.tile:focus-visible { outline: none; border: 1.8px solid rgba(0, 159, 252, 0.98); box-shadow: 0 7px 12px rgba(0, 0, 0, 0.48), 0 0 0 5px rgba(0, 159, 252, 0.3); }

/* links: green line 4.9 wide, round ends; dashes 4 on 10, black under light grey, marching 14 every 0.6 s */
.links .fibre { stroke: #30D158; stroke-width: 4.9; stroke-linecap: round; }
.links .dash-outer, .links .dash-inner { stroke-dasharray: 4 10; animation: march 0.6s steps(18) infinite; }
.links .dash-outer { stroke: rgba(0, 0, 0, 0.85); stroke-width: 5.95; }
.links .dash-inner { stroke: rgba(166, 166, 166, 0.95); stroke-width: 3.5; }
.links .thin { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.2; stroke-dasharray: 1.5 3; }
@keyframes march { to { stroke-dashoffset: -14; } }

.plabel { position: absolute; transform: translate(-50%, -50%); font: 700 11px var(--mono); color: rgba(255, 255, 255, 0.95); background: rgba(0, 0, 0, 0.72); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.plabel b { font-weight: 500; color: rgba(255, 255, 255, 0.75); margin-left: 3px; }

.small { font-size: 14px; color: var(--ink-dim); }

/* the bottom pill, like the app's view switcher */
.switcher { position: absolute; z-index: 3; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); font: 800 15px var(--display); text-decoration: none; white-space: nowrap; }
.switcher .arrow { color: var(--healthy-text); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

@media (max-width: 1100px) {
  .tile { --z: 0.85; }
  .tile.big { --z: 1.75; }
  .area-row { gap: 40px; }
  .area-row.dl { gap: 180px; }
  .canvas { padding: 0 20px 24px; }
}
@media (max-width: 820px) {
  .tile.pingonly { display: none; }
  .portbox { --z: 0.8; }
  .area.sr, .area.sl { padding: 10px 14px 16px; }
}
@media (max-width: 640px) {
  .canvas { grid-template-areas: "h h" "foh foh" "s s" "sr sl"; row-gap: 22px; padding-bottom: 90px; }
  .canvas h1 { margin-top: 0; }
  .tile { --z: 0.74; }
  .portbox { display: none; }
  .canvas { padding-left: 12px; padding-right: 12px; column-gap: 10px; }
  .tile.big { --z: 1.75; }
  .area.sr, .area.sl { padding: 8px 10px 12px; }
  .area-row.dl { flex-direction: column; gap: 110px; }
  .area.foh { padding: 10px 18px 20px; }
  .appbar { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .links .dash-outer, .links .dash-inner, .ring, .switcher .arrow { animation: none; }
}

/* ---------- below: the website ---------- */
main { background: linear-gradient(var(--canvas), var(--base) 240px); padding-top: 96px; }
.wrap { max-width: 1040px; margin-left: auto; margin-right: auto; padding: 0 20px; }
section { margin-bottom: 88px; }
h2 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 24px; }
.intro h2 { font-size: clamp(30px, 4vw, 44px); max-width: 16em; }
.lead { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.55; max-width: 38em; color: var(--ink-dim); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid article { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.grid h3 { font-size: 19px; margin-bottom: 8px; }
.grid h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--healthy-text); margin-right: 10px; vertical-align: 3px; }
.grid p, .two p { color: var(--ink-dim); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.two h3 { font-size: 21px; margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.button { display: inline-block; padding: 12px 20px; border-radius: 10px; font: 800 16px var(--display); text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); }
.button:hover { border-color: rgba(255, 255, 255, 0.2); }
.button.go { background: var(--go); color: #0E0E0F; border-color: transparent; }
.button.go:hover { background: var(--healthy-text); }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--ink-dim); background: var(--base); }
footer p { margin-bottom: 6px; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .button { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
