/* Plug&Proxy — the board. One fixed 1440×900 plan, scaled to fit the window. */

:root {
  --ground: #08080A;
  --accent: #154889;
  --dim: #3A3A42;
  --lit: #FFFFFF;
  --text-soft: #D5D5DA;
  --text-lede: #C9C9D0;
  --label: #B4B4BC;
  --glow: drop-shadow(0 0 3px rgba(255,255,255,0.95)) drop-shadow(0 0 10px rgba(255,255,255,0.55));
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --scale: 1;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--ground);
  color: var(--lit);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body { overflow: hidden; }

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---------- Board and modem state ---------- */

.board {
  position: relative;
  flex: none;
  width: 1440px;
  height: 900px;
  overflow: hidden;
  background: var(--ground);
  transform: scale(var(--scale));
  transform-origin: center center;

  /* 5G modem: unplugged by default */
  --w4: var(--dim);
  --d4: 6 6;
  --f4: none;
  --n4: none;
  --b4: 1px dashed #80808A;
  --t4: var(--label);
  --led4: var(--dim);
}
.board[data-plugged] {
  --w4: var(--lit);
  --d4: none;
  --f4: var(--glow);
  --n4: 0 0 8px 2px rgba(255,255,255,0.8);
  --b4: 1px solid #FFFFFF;
  --t4: #FFFFFF;
  --led4: var(--accent);
}
.board:not([data-plugged]) .if-on,
.board[data-plugged] .if-off { display: none; }

.frame {
  position: absolute;
  left: 56px; top: 37px;
  width: 1384px; height: 844px;
  box-sizing: border-box;
  border: 1px solid var(--dim);
  pointer-events: none;
}

/* ---------- Wires and nodes ---------- */

.wire {
  position: absolute;
  height: 8px;
  overflow: visible;
  fill: none;
  stroke: var(--lit);
  stroke-width: 2;
  stroke-linecap: round;
  filter: var(--glow);
}
.wire-4 {
  stroke: var(--w4);
  stroke-dasharray: var(--d4);
  filter: var(--f4);
}
/* Data in motion: the line stays as a faint rail, a light pulse runs along it (set up in main.js). */
.board.is-flowing .wire > .rail { stroke-opacity: .38; }
.wire > .flow {
  stroke: #FFFFFF;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-opacity: 1;
}
.board:not([data-plugged]) .wire-4 > .flow { display: none; }
.board:not([data-plugged]).is-flowing .wire-4 > .rail { stroke-opacity: 1; }

.node {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lit);
  box-shadow: 0 0 8px 2px rgba(255,255,255,0.8);
}
.node-4 { background: var(--w4); box-shadow: var(--n4); }

/* ---------- Header ---------- */

.kicker {
  position: absolute;
  left: 129px; top: 72px;
  width: 479px;
  margin: 0;
  font: 500 17px/1.2 var(--mono);
  letter-spacing: 0.16em;
  color: var(--lit);
}
.kicker span { display: block; }
.lede {
  position: absolute;
  left: 128px; top: 132px;
  width: 480px;
  margin: 0;
  font-size: 17px;
  line-height: 26px;
  color: var(--text-lede);
}

/* ---------- Devices, proxies, Internet ---------- */

.device {
  position: absolute;
  left: 96px;
  width: 224px; height: 56px;
  box-sizing: border-box;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ground);
  border: 1px solid #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(255,255,255,0.14);
}
.device-name { font-size: 15px; line-height: 19px; font-weight: 500; }
.device-4 { border: var(--b4); box-shadow: none; color: var(--t4); }

.proxy {
  position: absolute;
  left: 980px;
  width: 120px; height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ground);
  border: 1px solid #FFFFFF;
  border-radius: 20px;
  font: 500 12px var(--mono);
  letter-spacing: 0.1em;
}
.proxy-4 { border: var(--b4); color: var(--t4); }

.internet {
  position: absolute;
  left: 1200px; top: 344px;
  width: 140px; height: 336px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--ground);
  border: 1px solid #FFFFFF;
  box-shadow: 0 0 32px rgba(255,255,255,0.12);
}
.mono { font: 500 12px var(--mono); letter-spacing: 0.16em; }
/* Internet: the globe turns and lists each proxy's mobile IP. */
.globe { position: relative; width: 56px; height: 56px; }
.globe svg { display: block; }
.ips-title {
  margin-top: 14px;
  font: 500 9px var(--mono);
  letter-spacing: 0.16em;
  color: var(--label);
}
.ips {
  list-style: none;
  margin: -4px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
  font: 500 10px/1 var(--mono);
  white-space: nowrap;
}
.ips li { display: flex; gap: 8px; }
.ips-n { color: var(--label); }
.ips .ip { color: #FFFFFF; }
.ips .ip-wait { color: var(--label); }


/* ---------- Engine ---------- */

.engine {
  position: absolute;
  left: 520px; top: 160px;
  overflow: visible;
}
.engine .fill-ground { fill: var(--ground); }
.engine .fill-accent { fill: var(--accent); }
.engine .stroke-accent { stroke: var(--accent); }
.engine .stroke-led4 { stroke: var(--led4); }
.engine .fill-led4 { fill: var(--led4); }
.engine .layer-4 { stroke: var(--w4); stroke-dasharray: var(--d4); }
/* Crossing: the pulse runs along the front edge of its device layer (set up in main.js). */
.engine .traces .edge {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0 1000;
  filter: drop-shadow(0 0 4px #FFFFFF) drop-shadow(0 0 14px rgba(255,255,255,0.8));
}
.engine .traces .band { fill: #FFFFFF; stroke: none; opacity: 0; }
/* Control plate answers each crossing: the core flashes, a spark runs down the spine to the layer. */
.engine .traces .spark {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0 1000;
  filter: drop-shadow(0 0 4px #FFFFFF) drop-shadow(0 0 10px rgba(255,255,255,0.7));
}
.engine .cores path {
  fill: #FFFFFF;
  opacity: 0;
  filter: drop-shadow(0 0 6px #FFFFFF) drop-shadow(0 0 18px rgba(255,255,255,0.7));
}
.board:not([data-plugged]) .engine .trace-4 { display: none; }
/* Data written onto the layer as the light crosses it (main.js). */
.engine .data text {
  fill: var(--accent);
  font: 500 7px var(--mono);
  letter-spacing: .04em;
}
.board:not([data-plugged]) .engine .data-4 { display: none; }


/* "Computer", centred under the layer stack */
.caption-right {
  position: absolute;
  left: 580px; top: 690px;
  width: 240px;
  text-align: center;
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  color: #9A9AA3;
}
.zone { position: absolute; left: 620px; width: 160px; }

/* ---------- Markers ---------- */

.marker {
  position: absolute;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.marker .dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px var(--ground);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 14px var(--mono);
  transition: box-shadow .15s ease;
}
.marker[aria-pressed="true"] .dot {
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 12px 3px rgba(255,255,255,0.7);
}

/* ---------- Indexes (engine capabilities, on the control plate) ---------- */

.idx {
  position: absolute;
  width: 28px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font: 600 12px var(--mono);
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(255,255,255,0.6);
  cursor: default;
}
.tip-idx { right: calc(100% + 14px); top: -10px; width: 280px; }
.tip-idx strong {
  display: block;
  margin-bottom: 4px;
  font: 600 11px/16px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #FFFFFF;
}

/* ---------- Corner-bracket cards ("Coins") ---------- */

.coins {
  position: relative;
  box-sizing: border-box;
  background: var(--ground);
  background-image:
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF);
  background-repeat: no-repeat;
  background-size: 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
}
.label {
  font: 600 11px var(--mono);
  letter-spacing: 0.16em;
  color: var(--label);
}

.info {
  position: absolute;
  left: 868px; top: 72px;
  width: 432px;
  padding: 22px 24px 24px;
}
.info-title {
  margin: 10px 0 0;
  font: 500 22px/30px var(--mono);
  letter-spacing: 0.02em;
}
.info p {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 23px;
  color: var(--text-soft);
}
.info a { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Bottom buttons ---------- */

.btn {
  width: 140px; height: 48px;
  box-sizing: border-box;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #FFFFFF;
  font: 600 13px var(--mono);
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
}
.contact { position: absolute; left: 1200px; top: 780px; }

.partners { position: absolute; z-index: 30; left: 118px; top: 781px; width: 140px; height: 48px; }
.partners-panel {
  position: absolute;
  left: 100%; bottom: 0;
  padding-left: 14px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .15s ease, visibility .15s;
}
.partners:hover .partners-panel,
.partners:focus-within .partners-panel,
.partners.is-open .partners-panel { visibility: visible; opacity: 1; }
.partners-card { width: 200px; padding: 16px 18px 18px; }
.partners-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}
.partners-list:empty { display: none; }
.partners-list a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #FFFFFF;
  text-decoration: none;
}
.banner {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18), 0 8px 22px rgba(0,0,0,0.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
.banner img { display: block; width: 164px; height: 57px; }
.banner-name {
  display: flex;
  justify-content: space-between;
  font: 500 9px var(--mono);
  letter-spacing: 0.12em;
  color: #D5D5DA;
}
.partners-list a:hover .banner,
.partners-list a:focus-visible .banner {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px #FFFFFF, 0 0 22px rgba(255,255,255,0.22), 0 8px 22px rgba(0,0,0,0.6);
}
.partners-list a:hover .banner-name,
.partners-list a:focus-visible .banner-name { color: #FFFFFF; }
.partners-list a:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 4px; border-radius: 4px; }
.partners-list:not(:empty) + .partners-empty { display: none; }
.partners-empty { margin: 10px 0 0; font-size: 15px; line-height: 22px; color: var(--text-soft); }

/* ---------- Hover descriptions ---------- */

.tip {
  position: absolute;
  z-index: 20;
  display: block;
  box-sizing: border-box;
  padding: 9px 12px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s;
  font: 400 14px/20px var(--sans);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  color: var(--text-soft);
  background-color: var(--ground);
  background-image:
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF),
    linear-gradient(#FFF,#FFF), linear-gradient(#FFF,#FFF);
  background-repeat: no-repeat;
  background-size: 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
}
.tip-device { left: calc(100% + 14px); top: 38px; width: 216px; }
.tip-proxy { left: 50%; top: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; padding: 7px 12px; }
.tip-short { white-space: nowrap; padding: 7px 12px; }

.hot:hover .tip,
.hot:focus-visible .tip,
.board.tips-on .tip { visibility: visible; opacity: 1; }

/* ---------- Focus ---------- */

.hot:focus-visible,
.btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.hot:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .partners-panel, .tip, .marker .dot, .banner { transition: none; }
  .wire > .flow, .engine .traces, .engine .data, .engine .cores { display: none; }
  .board.is-flowing .wire > .rail { stroke-opacity: 1; }
}

/* ---------- Portrait (phones): one 390×842 plan, read top to bottom ---------- */

.engine-m { display: none; }
.board.m { width: 390px; height: 842px; }
.board.m .frame { left: 8px; top: 8px; width: 374px; height: 826px; }
.board.m .wire,
.board.m .node { display: none; }
.board.m .engine-m { display: block; position: absolute; left: 0; top: 0; overflow: visible; }

/* The same layered engine as the wide plan, scaled down and centred */
.board.m .engine {
  left: 119.4px; top: 204.8px;
  transform: scale(0.42);
  transform-origin: 0 0;
}

/* Wires: fan into the control plate, fan out of the stack */
.engine-m .m-rail { stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; filter: var(--glow); }
.board.is-flowing .engine-m .m-rail { stroke-opacity: .38; }
.engine-m .m-row4 .m-rail { stroke: var(--w4); stroke-dasharray: var(--d4); filter: var(--f4); }
.board:not([data-plugged]).is-flowing .engine-m .m-row4 .m-rail { stroke-opacity: 1; }
.engine-m .m-flow {
  stroke: #FFFFFF; stroke-width: 3; stroke-linecap: round; stroke-opacity: 1;
  stroke-dasharray: 0 1000;
}
.board:not([data-plugged]) .engine-m .m-row4 .m-flow { display: none; }

/* Header */
.board.m .kicker { left: 24px; top: 22px; width: 342px; font-size: 13px; letter-spacing: .14em; }
.board.m .lede { left: 24px; top: 62px; width: 342px; font-size: 13px; line-height: 19px; }

/* Devices: a row of four tiles */
.board.m .device {
  top: 144px !important;
  width: 80px; height: 54px;
  padding: 6px 4px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-radius: 8px;
}
.board.m .device > svg { width: 22px; height: 22px; flex: none; }
.board.m .device-name { font-size: 11px; line-height: 13px; text-align: center; white-space: nowrap; }
.board.m [aria-describedby="tip-dongle"] { left: 20px; }
.board.m [aria-describedby="tip-phone"] { left: 110px; }
.board.m [aria-describedby="tip-module"] { left: 200px; }
.board.m [aria-describedby="tip-modem"] { left: 290px; }

/* Proxies: a row of four pills */
.board.m .proxy {
  top: 448px !important;
  width: 80px; height: 24px;
  gap: 6px;
  border-radius: 12px;
  font-size: 9.5px;
  letter-spacing: .06em;
}
.board.m .proxy > svg { width: 7px; height: 7px; }
.board.m [aria-describedby="tip-proxy1"] { left: 20px; }
.board.m [aria-describedby="tip-proxy2"] { left: 110px; }
.board.m [aria-describedby="tip-proxy3"] { left: 200px; }
.board.m [aria-describedby="tip-proxy4"] { left: 290px; }

/* Internet: a wide box at the bottom. Each IP stands upright on its own white wire;
   a small globe sits between the two middle wires. */
.board.m .internet {
  left: 20px; top: 496px;
  width: 350px; height: 124px;
  padding: 0;
  display: block;
}
.board.m .globe,
.board.m .internet .mono,
.board.m .ips-title {
  position: absolute;
  left: 175px;
  transform: translateX(-50%);
  margin: 0;
}
.board.m .globe { top: 31px; width: 28px; height: 28px; }
.board.m .globe svg { width: 28px; height: 28px; }
.board.m .internet .mono { top: 67px; font-size: 9px; }
.board.m .ips-title { top: 83px; font-size: 7.5px; white-space: nowrap; }
.board.m .ips { display: block; margin: 0; font-size: 9px; }
.board.m .ips li {
  position: absolute;
  top: 10px;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  gap: 6px;
}
.board.m .ips li[data-row="1"] { left: 40px; }
.board.m .ips li[data-row="2"] { left: 130px; }
.board.m .ips li[data-row="3"] { left: 220px; }
.board.m .ips li[data-row="4"] { left: 310px; }

/* Engine caption, hover zones, indexes on the plate */
.board.m .caption-right { left: 24px; top: 330px; width: 96px; font-size: 9px; }
.board.m .zone[aria-describedby="tip-control"] { left: 132px !important; top: 230px !important; width: 126px; height: 52px !important; }
.board.m .zone[aria-describedby="tip-layers"] { left: 132px !important; top: 284px !important; width: 126px; height: 140px !important; }
.board.m .idx { width: 24px; height: 20px; font-size: 10px; }
.board.m [aria-describedby="tip-idx1"] { left: 183px !important; top: 226.5px !important; }
.board.m [aria-describedby="tip-idx2"] { left: 135.75px !important; top: 246px !important; }
.board.m [aria-describedby="tip-idx3"] { left: 230.25px !important; top: 246px !important; }
.board.m [aria-describedby="tip-idx4"] { left: 183px !important; top: 265.5px !important; }

/* Markers */
.board.m .marker .dot { width: 26px; height: 26px; font-size: 12px; }
.board.m [data-marker="1"] { left: -2px !important; top: 122px !important; }
.board.m [data-marker="2"] { left: 268px !important; top: 122px !important; }
.board.m [data-marker="3"] { left: 248px !important; top: 234px !important; }
.board.m [data-marker="4"] { left: -6px !important; top: 412px !important; }
.board.m [data-marker="5"] { left: 348px !important; top: 474px !important; }

/* Information card */
.board.m .info { left: 20px; top: 638px; width: 350px; padding: 14px 16px 16px; }
.board.m .info .label { font-size: 9.5px; }
.board.m .info-title { margin-top: 6px; font-size: 15px; line-height: 21px; }
.board.m .info p { margin-top: 6px; font-size: 12.5px; line-height: 18px; }

/* Bottom buttons */
.board.m .btn { width: 120px; height: 40px; font-size: 12px; }
.board.m .contact { left: 250px; top: 788px; }
.board.m .partners { left: 20px; top: 788px; width: 120px; height: 40px; }
.board.m .partners-panel { left: 0; bottom: calc(100% + 10px); padding-left: 0; }

/* Tips: under their element, kept inside the plan */
.board.m .hot:focus .tip { visibility: visible; opacity: 1; }
.board.m .tip { font-size: 12.5px; line-height: 18px; }
.board.m .tip-device,
.board.m .tip-proxy,
.board.m .tip-idx,
.board.m .marker .tip {
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  left: 0 !important;
  right: auto !important;
  transform: none !important;
  width: 210px !important;
  white-space: normal;
}
.board.m [aria-describedby="tip-module"] .tip,
.board.m [aria-describedby="tip-modem"] .tip,
.board.m [aria-describedby="tip-proxy3"] .tip,
.board.m [aria-describedby="tip-proxy4"] .tip,
.board.m [aria-describedby="tip-idx3"] .tip,
.board.m [data-marker="2"] .tip,
.board.m [data-marker="3"] .tip,
.board.m [data-marker="5"] .tip { left: auto !important; right: 0 !important; }
.board.m [aria-describedby="tip-idx1"] .tip,
.board.m [aria-describedby="tip-idx4"] .tip { left: 50% !important; transform: translateX(-50%) !important; }
.board.m .zone .tip { left: 50% !important; right: auto !important; top: calc(100% + 8px) !important; transform: translateX(-50%) !important; }
.board.m #tip-internet { right: 0 !important; top: calc(100% + 8px) !important; width: 240px !important; }
.board.m #tip-contact { right: 0 !important; left: auto !important; top: auto !important; bottom: calc(100% + 8px) !important; width: 220px; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  .engine-m .m-flow { display: none; }
  .board.is-flowing .engine-m .m-rail { stroke-opacity: 1; }
}
