/* Router Lab — 1970s tandem telephone exchange. Olive racks, amber wink lamps, bakelite jacks. */
/* data-redesign="tandem-exchange-20260824" */

:root {
  --lino: #efe6d4;
  --ticket: #f7f1e4;
  --ink: #1c1a14;
  --mute: #6b6456;
  --olive: #3d4a32;
  --olive-2: #2c3524;
  --olive-3: #1e2418;
  --amber: #e39b12;
  --amber-hot: #ffc04a;
  --bakelite: #5c3d2e;
  --brass: #b8923a;
  --rule: #d4c8b0;
  --hair: #c9bda4;
  --max: 1120px;
  --sans: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(227, 155, 18, 0.35); color: var(--ink); }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(227, 155, 18, 0.08), transparent 50%),
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(92, 61, 46, 0.03) 48px),
    var(--lino);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}

h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.12; }
h1 { margin: 0 0 1rem; font-size: clamp(2.35rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); margin: 0 0 0.7rem; }
h3 { font-size: 1.12rem; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
code { font-family: var(--mono); font-size: 0.9em; }
button, input, select, textarea { font-family: inherit; }

a { color: var(--ink); }
a:hover { color: var(--bakelite); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.wrap { width: min(var(--max), calc(100% - 4.5rem)); margin: 0 auto; }

.rack-rails {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(30, 36, 24, 0.07) 0, rgba(30, 36, 24, 0.07) 14px, transparent 14px),
    linear-gradient(-90deg, rgba(30, 36, 24, 0.07) 0, rgba(30, 36, 24, 0.07) 14px, transparent 14px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  background: rgba(239, 230, 212, 0.92);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-size: 1.12rem;
}
.wordmark svg { width: 28px; height: 28px; display: block; }

.nav-toggle {
  display: none;
  background: var(--ticket);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}
.nav-list a { text-decoration: none; }
.nav-list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--amber); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--ticket) !important;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease);
}
.btn:hover { background: var(--olive-2); }
.btn-ghost {
  background: transparent;
  color: var(--ink) !important;
}
.btn-ghost:hover { background: rgba(61, 74, 50, 0.08); }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bakelite);
  margin-bottom: 0.85rem;
}
.wink {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 2px rgba(227, 155, 18, 0.25), 0 0 10px var(--amber);
  animation: wink 1.6s ease-in-out infinite;
}
.lamp { animation: wink 1.8s ease-in-out infinite; }
@keyframes wink {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.25; }
  55% { opacity: 1; }
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 2.4rem;
  align-items: start;
  padding: 3.4rem 0 2.6rem;
}
.lede { font-size: 1.12rem; color: var(--mute); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.3rem 0 1rem; }
.endpoint {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--olive);
}
.endpoint b { color: var(--ink); }

.bay {
  background: var(--olive-2);
  border-radius: 8px;
  padding: 12px 12px 14px;
  box-shadow: 0 18px 40px rgba(28, 26, 20, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.bay-plate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--brass);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem 0.7rem;
}
.bay-plate span { color: var(--amber); }
.bay svg { display: block; width: 100%; height: auto; }
.cord { stroke-dasharray: 8 6; animation: crawl 4.5s linear infinite; }
@keyframes crawl { to { stroke-dashoffset: -56; } }

.panel {
  margin-top: 10px;
  background: var(--ticket);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--hair);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: var(--olive);
  color: var(--ticket);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.live { color: var(--amber-hot); }
.spend {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}
.spend th, .spend td {
  padding: 0.45rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.spend th {
  color: var(--mute);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.spend tr:last-child td { border-bottom: 0; }
.spend tbody tr { transition: background 0.2s var(--ease); }
.spend tbody tr:hover { background: rgba(227, 155, 18, 0.1); }
.spend .num { text-align: right; }
.panel-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
}
.panel-foot div { padding: 0.55rem 0.75rem; }
.panel-foot div + div { border-left: 1px solid var(--rule); }
.panel-foot b { display: block; font-size: 0.95rem; }

.band { position: relative; z-index: 1; padding: 3.2rem 0; }
.band-olive {
  background: var(--olive-3);
  color: var(--ticket);
}
.band-olive h2, .band-olive h3 { color: var(--ticket); }
.band-olive p, .band-olive .lede { color: #c9c2b0; }
.band-olive a { color: var(--amber-hot); }

main { position: relative; z-index: 1; }
.feat-grid,
.feat-grid,
.sec-grid,
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.card, .sec-card {
  background: var(--ticket);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 1.1rem 1.15rem;
}
.card h3, .sec-card h3 { margin-top: 0; }

.invoice {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.4rem;
  align-items: center;
}
.invoice-card {
  background: var(--ticket);
  color: var(--ink);
  border-radius: 8px;
  padding: 1.2rem 1.3rem 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.invoice-card header {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.8rem;
  border-bottom: 1px dashed var(--hair);
  padding-bottom: 0.55rem;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.86rem;
  padding: 0.28rem 0;
}
.inv-row.zero { color: var(--olive); }
.inv-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 2px solid var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.providers { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.32rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--ticket);
}

.dial-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.4rem;
}
.dial { width: 260px; height: 260px; margin: 0 auto; }
.dial svg { width: 100%; height: 100%; }
code { background: rgba(61, 74, 50, 0.08); padding: 0.1em 0.35em; border-radius: 4px; }
.pre code { background: none; padding: 0; }
.keys, .spend { display: block; overflow-x: auto; }
code { background: rgba(61, 74, 50, 0.08); padding: 0.1em 0.35em; border-radius: 4px; }
.pre code { background: none; padding: 0; }
.keys, .spend { display: block; overflow-x: auto; }
.needle { transform-box: view-box; transform-origin: 130px 130px; transition: transform 0.4s var(--ease); }
.dial-btns { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.8rem; }
.dial-btns button {
  background: var(--ticket);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.dial-btns button.is-on { background: var(--ink); color: var(--ticket); }

.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.route-list li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  background: var(--ticket);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
}
.route-list .tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.route-list li.is-picked {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(227, 155, 18, 0.25);
}
.route-list li.is-picked .tag { color: var(--bakelite); }
.meta { font-family: var(--mono); font-size: 0.74rem; color: var(--mute); }

.waterfall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 1.4rem;
}
.rungs { list-style: none; margin: 0; padding: 0; }
.rungs li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hair);
  border-bottom: 0;
  background: var(--ticket);
  font-size: 0.9rem;
}
.rungs li:first-child { border-radius: 8px 8px 0 0; }
.rungs li:last-child { border-bottom: 1px solid var(--hair); border-radius: 0 0 8px 8px; }
.rungs .ok { color: var(--olive); font-family: var(--mono); font-size: 0.75rem; }
.rungs .fail { color: var(--bakelite); font-family: var(--mono); font-size: 0.75rem; }
.rungs .wait { color: var(--mute); font-family: var(--mono); font-size: 0.75rem; }
.points { display: grid; gap: 0.8rem; }
.points article {
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--amber);
  background: rgba(247, 241, 228, 0.6);
}

.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  background: var(--ticket);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hair);
  margin: 1.2rem 0;
}
.keys th, .keys td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.keys th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  font-weight: 500;
  background: rgba(61, 74, 50, 0.06);
}
.keys td:last-child, .keys th:last-child { font-family: var(--mono); }
.keys tr:last-child td { border-bottom: 0; }
.bar {
  display: block;
  height: 6px;
  background: var(--rule);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.bar i { display: block; height: 100%; background: var(--olive); border-radius: 99px; }
.bar.cap i { background: var(--bakelite); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.4rem;
}
.step {
  background: var(--ticket);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 1.1rem 1.15rem 1.2rem;
}
.step .n {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--bakelite);
  margin-bottom: 0.55rem;
}
.step svg { width: 100%; height: 72px; margin: 0.4rem 0 0.7rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 1rem 0 0.7rem; }
.tabs button {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.82rem;
}
.tabs button.is-on { background: var(--ink); color: var(--ticket); border-color: var(--ink); }
pre[hidden] { display: none; }
.page h2 { margin-top: 2.2rem; }
.pre {
  margin: 0;
  background: var(--olive-3);
  color: #e8dfc8;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
}
.note { font-size: 0.88rem; color: var(--mute); }
.endpoint-line, .endpoint {
  font-family: var(--mono);
}

.page { position: relative; z-index: 1; padding: 3rem 0 4rem; }
.page h1 { max-width: 22ch; }

form {
  display: grid;
  gap: 0.65rem;
  max-width: 28rem;
  margin-top: 1.2rem;
}
label { font-size: 0.82rem; color: var(--mute); }
input, textarea, select {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ticket);
  color: var(--ink);
}

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--olive-3);
  color: #c9c2b0;
  padding: 2.4rem 0 1.6rem;
  margin-top: 2rem;
}
.site-footer a { color: var(--amber-hot); }
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
}
.site-footer h3 { color: var(--ticket); font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.legal {
  border-top: 1px solid rgba(201, 194, 176, 0.2);
  padding-top: 1rem;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
}

@media (max-width: 800px) {
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
  .nav-toggle { display: inline-block; }
  .site-header nav { width: 100%; }
  .header-inner { flex-wrap: wrap; }
  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.6rem;
  }
  .nav-list.is-open { display: flex; }
  .hero, .invoice, .dial-grid, .waterfall, .steps, .sec-grid, .doc-grid, .feat-grid, .feat-grid, .foot-grid, .panel-foot {
    grid-template-columns: 1fr;
  }
  .panel-foot div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .route-list li { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
