@font-face {
  font-family: 'Inter Tight';
  src: url('/fonts/inter-tight-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #0e1723;
  --text: #dce6f2;
  --muted: #96a8bf;
  --accent: #8eafd3;
  --mono: 'IBM Plex Mono', monospace;
  font-family: 'Inter Tight', Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: grid; place-items: center; }
::selection { background: var(--accent); color: var(--background); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 4px; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.page { width: min(640px, calc(100% - 48px)); padding: 64px 0; text-align: center; }
h1 { font-size: 44px; letter-spacing: -.045em; line-height: 1.1; font-weight: 500; margin: 0; }
.intro { margin-top: 36px; }
.subtitle { font-size: 18px; letter-spacing: -.015em; margin: 0 0 8px; }
.description { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.release { font: 12px var(--mono); color: var(--accent); margin: 24px 0 0; }

.connection { margin-top: 24px; }
.route-buttons { display: flex; justify-content: center; gap: 24px; margin-top: 8px; }
.route-buttons button { cursor: pointer; min-height: 44px; padding: 12px 0; border: 0; background: transparent; color: var(--muted); font: 11px var(--mono); transition: color 150ms; }
.route-buttons button:hover { color: var(--text); }
.route-buttons button[aria-pressed='true'] { color: var(--text); text-decoration: underline; text-underline-offset: 7px; text-decoration-color: var(--accent); }
.diagram { height: 220px; position: relative; margin-bottom: 20px; }
.wires { width: 100%; height: 100%; position: absolute; inset: 0; }
.wire { fill: none; vector-effect: non-scaling-stroke; stroke-width: 1; }
.wire-active { stroke: var(--accent); }
.packet { fill: none; stroke: var(--text); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 5 1000; animation: travel 5s linear infinite; }
@keyframes travel { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1005; } }
.endpoint { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; flex-direction: column; }
.endpoint-local { left: 16%; }
.endpoint-remote { left: 84%; }
.phone { width: 49px; height: 89px; border: 1px solid var(--muted); border-radius: 9px; background: var(--background); display: grid; place-items: center; position: relative; box-shadow: 0 0 0 8px var(--background); }
.phone-speaker { position: absolute; top: 7px; width: 12px; height: 2px; background: var(--muted); border-radius: 2px; }
.phone-prompt { color: var(--accent); font: 18px var(--mono); padding-bottom: 3px; }
.phone-bar { position: absolute; bottom: 6px; width: 17px; height: 1px; background: var(--muted); }
.node-label { position: absolute; top: calc(100% + 18px); color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.server { width: 56px; background: var(--background); display: grid; gap: 5px; box-shadow: 0 0 0 8px var(--background); }
.server > div { border: 1px solid var(--muted); height: 19px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.server i:first-child { width: 16px; height: 1px; background: var(--muted); }
.server i:last-child { width: 2px; height: 2px; border-radius: 50%; background: var(--accent); }
.relay { opacity: 0; position: absolute; left: 50%; top: 17.3%; transform: translate(-50%, -50%); transition: opacity 180ms; }
.relay-symbol { display: grid; place-items: center; background: var(--background); border: 1px solid var(--accent); width: 25px; height: 25px; color: var(--accent); font: 19px var(--mono); box-shadow: 0 0 0 6px var(--background); }
.relay-label { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: var(--muted); font: 10px var(--mono); }
.tunnel-label { opacity: 0; position: absolute; top: 85%; left: 50%; transform: translateX(-50%); color: var(--muted); font: 10px var(--mono); padding: 4px 8px; background: var(--background); white-space: nowrap; transition: opacity 180ms; }
[data-route='jump'] .relay, [data-route='forward'] .tunnel-label { opacity: 1; }
.command { display: flex; align-items: baseline; justify-content: center; gap: 10px; color: var(--muted); font: 12px/1.6 var(--mono); }
.command code { font: inherit; overflow-wrap: anywhere; min-width: 0; }
.prompt { color: var(--accent); }

.error-page .description { margin: 20px 0; }

@media (max-width: 640px) {
  .page { padding: 48px 0; }
  h1 { font-size: 38px; }
  .description { max-width: 280px; margin-inline: auto; }
  .diagram { height: 190px; }
  .phone { width: 42px; height: 77px; border-radius: 7px; }
  .server { width: 44px; gap: 4px; }
  .server > div { height: 16px; padding: 0 4px; }
  .server i:first-child { width: 12px; }
  .node-label { font-size: 10px; }
  .relay-label, .tunnel-label { font-size: 9px; }
  .command { font-size: 10px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .packet { display: none; }
}
