/* malthe.cc */

:root {
  --bg: #0f0f0e;
  --bg-raised: #171715;
  --line: #262522;
  --line-strong: #3a3934;
  --text: #ece9e2;
  --text-soft: #cdc9bf;
  --muted: #99958b;
  --faint: #6b6860;
  --accent: #e5793b;
  --accent-hover: #f08b50;
  --accent-ink: #1b0f07;
  --up: #7cc57f;
  --hosting: #8fb5d6;
  --down: #e8664f;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 12px; letter-spacing: -.005em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spaced { margin-top: 40px; }
.fine { font-size: 12.5px; color: var(--faint); margin: 10px 0 0; }

.kicker {
  margin: 0 0 22px;
  color: var(--accent);
  font: 500 12.5px/1 var(--mono);
  letter-spacing: .04em;
}

.label { font-size: 14px; color: var(--muted); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 14px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: transparent; border-color: var(--text); color: var(--text); }
.btn-small { padding: 8px 12px; font-size: 13px; }

.quiet-link { font-size: 14px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 36px; height: 62px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.02em; text-decoration: none; }
.brand span { color: var(--accent); }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 26px; margin-right: auto; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font: 13px var(--sans);
  padding: 7px 12px;
  cursor: pointer;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 72px;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 88px;
}
.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(46px, 7.4vw, 88px);
  line-height: .94;
  letter-spacing: -.04em;
  font-weight: 700;
}
.lede {
  margin: 0 0 34px;
  max-width: 33em;
  font-size: 18.5px;
  line-height: 1.6;
  color: var(--text-soft);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 56px 0 0;
  border-top: 1px solid var(--line);
}
.facts div { padding: 16px 36px 0 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-size: 17px; font-weight: 600; }

.globe { position: relative; margin: 0; }
.globe-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.globe-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; user-select: none; }
.globe.is-dragging canvas { cursor: grabbing; }

.globe-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: 260px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.globe-tip p { margin: 0; }
.globe-tip-item + .globe-tip-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.globe-tip-kind { font-size: 12px; color: var(--muted); }
.globe-tip-kind.kind-pop { color: var(--accent); }
.globe-tip-kind.kind-hosting { color: var(--hosting); }
.globe-tip-title { margin-bottom: 4px !important; font-weight: 600; color: var(--text); }
.globe-tip-prefixes { margin-top: 6px !important; font: 12px/1.55 var(--mono); white-space: pre; color: var(--muted); }

.globe-zoom { position: absolute; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; }
.globe-zoom button {
  width: 30px;
  height: 30px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  font: 16px/1 var(--mono);
  cursor: pointer;
}
.globe-zoom button:hover { color: var(--text); border-color: var(--text); }

.globe-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  font: 12px var(--mono);
  color: var(--muted);
}
.globe-legend .hint { margin-left: auto; color: var(--faint); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: -1px; }
.dot-pop { background: var(--accent); }
.dot-hosting { border: 1.5px solid var(--hosting); }
.dot-prefix { width: 6px; height: 6px; background: var(--text); vertical-align: 0; }

/* ---------- sections ---------- */

.section {
  padding-top: 72px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}
.section-title {
  margin: 0 0 32px;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.intro { margin: 0 0 28px; max-width: 40em; font-size: 17px; color: var(--text-soft); }
.testfiles { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.testfiles a { color: var(--text); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }

.big {
  margin: 0 0 32px;
  max-width: 30em;
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -.012em;
  color: var(--text);
}
.prose p { margin: 0 0 16px; max-width: 36em; color: var(--text-soft); }
.prose p.big { color: var(--text); margin-bottom: 20px; }

.plain-list { margin: 0; padding-left: 18px; color: var(--text-soft); }
.plain-list li { padding: 3px 0; }

/* key/value list */
.kv { margin: 0; border-top: 1px solid var(--line); }
.kv div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* simple lists */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.links li { justify-content: space-between; }
.links .mono { font-size: 12.5px; color: var(--faint); }

.tag {
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font: 11px/1.5 var(--mono);
  color: var(--muted);
}

.copy {
  all: unset;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
  transition: color .15s;
}
.copy:hover { color: var(--accent); }
.copy:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.copy.copied::after { content: " copied"; color: var(--up); font-size: 11px; }

/* rows: offers / projects */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 60px;
  gap: 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.rows strong { font-weight: 600; }
.rows p { margin: 0; color: var(--muted); font-size: 15px; }
.rows > li > :last-child { justify-self: end; }

/* ---------- PoPs ---------- */

.pop + .pop { margin-top: 64px; }
.pop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}
.pop-head h3 { margin: 0; font-size: 28px; letter-spacing: -.025em; }
.pop-head .cc { margin-left: 12px; font: 400 13px var(--mono); color: var(--faint); letter-spacing: 0; }
.pop-other .pop-head h3 { font-size: 18px; }

.state { display: inline-flex; align-items: center; gap: 9px; font: 13px var(--mono); color: var(--muted); }
.state i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.state.is-up i { background: var(--up); box-shadow: 0 0 0 3px rgba(124, 197, 127, .16); }
.state.is-up { color: var(--text-soft); }
.state.is-down i { background: var(--down); }
.state.is-down { color: var(--down); }

.upstreams {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 26px;
  padding: 14px 0;
  font-size: 14.5px;
  border-bottom: 1px solid var(--line);
}
.upstreams .label { min-width: 90px; }
.upstreams a { text-decoration: none; }
.upstreams .mono { font-size: 12.5px; margin-left: 4px; }

.ix { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ix th {
  padding: 16px 14px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.ix td {
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
.ix th:last-child, .ix td:last-child { padding-right: 0; text-align: right; }
.ix td a { text-decoration: none; }
.ix .ix-meta { display: block; font-size: 12.5px; color: var(--faint); }
.ix .none { color: var(--faint); }
.ix tr.sub td { font-size: 14px; }
.ix tr.sub td:first-child { padding-left: 20px; color: var(--text-soft); }
.ix tr.is-inactive td,
.ix tr.is-inactive .copy,
.ix tr.is-inactive td:first-child { color: var(--faint); }

.badge { font: 12.5px var(--mono); white-space: nowrap; }
.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
.badge-active { color: var(--up); }
.badge-inactive { color: var(--faint); }

.peer-link { font-size: 13.5px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.peer-link:hover { color: var(--accent-hover); }

.group-toggle {
  all: unset;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}
.group-toggle .count { font: 12.5px var(--mono); color: var(--faint); }
.group-toggle[aria-expanded]::after {
  content: "show all";
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
}
.group-toggle[aria-expanded="true"]::after { content: "hide"; }
.group-toggle:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
tbody.group[data-collapsed] tr.sub { display: none; }

/* ---------- peering callout ---------- */

.callout {
  align-self: start;
  padding: 30px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.callout h3 { font-size: 19px; letter-spacing: -.01em; margin-bottom: 10px; }
.callout p { margin: 0 0 24px; color: var(--text-soft); }

/* ---------- about ---------- */

.tools { font-size: 14px; color: var(--muted) !important; line-height: 1.8; }
.timeline li { flex-wrap: nowrap; gap: 18px; }
.timeline .years { flex: 0 0 82px; font: 12.5px var(--mono); color: var(--faint); }

/* ---------- contact form ---------- */

.contact-split { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }

.form { display: grid; gap: 20px; }
.types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.types legend { margin-bottom: 10px; padding: 0; font-size: 13px; color: var(--muted); }
.type { position: relative; }
.type input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.type span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.type span:hover { color: var(--text); }
.type input:checked + span { border-color: var(--accent); color: var(--text); background: rgba(229, 121, 59, .09); }
.type input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-note { margin: -4px 0 0; font-size: 13.5px; color: var(--muted); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--muted); }
.field .opt { color: var(--faint); }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font: 15px/1.4 var(--sans);
  transition: border-color .15s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }
.field select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2399958b' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field select option, .field select optgroup { background: var(--bg-raised); color: var(--text); }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field.has-error input,
.field.has-error textarea { border-color: var(--down); }
.err { margin: 6px 0 0; font-size: 13px; color: var(--down); }
.err:empty { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-status { margin: 0; font-size: 14px; color: var(--muted); }
.form-status.ok { color: var(--up); }
.form-status.bad { color: var(--down); }

/* ---------- footer ---------- */

.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 32px;
  padding-top: 32px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}
.footer p { margin: 0; }
.footer p:nth-child(even) { text-align: right; }

/* ---------- 404 ---------- */

.notfound { padding-top: 120px; padding-bottom: 160px; }
.notfound h1 { margin: 0 0 20px; font-size: clamp(40px, 6vw, 72px); letter-spacing: -.04em; line-height: 1; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 56px; }
  .globe { max-width: 460px; width: 100%; justify-self: center; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .split, .contact-split { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 820px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .topbar-inner { gap: 16px; }
  .nav-toggle { display: inline-block; margin-left: auto; }
  .topbar-cta { display: none; }
  .nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; font-size: 16px; color: var(--text); border-bottom: 1px solid var(--line); }

  .facts div { padding-right: 24px; }
  .rows li { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .rows li p { grid-column: 1 / -1; grid-row: 2; }
  .rows > li > :last-child { grid-row: 1; grid-column: 2; }
  .row-2 { grid-template-columns: 1fr; }

  .ix thead { display: none; }
  .ix, .ix tbody, .ix tr, .ix td { display: block; width: 100%; }
  .ix tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .ix td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  .ix td::before {
    content: attr(data-label);
    flex: none;
    font-size: 13px;
    color: var(--muted);
  }
  .ix td:first-child { display: block; text-align: left; font-weight: 600; }
  .ix td:first-child::before, .ix td.action::before, .ix td:empty { display: none; }
  .ix td.action { justify-content: flex-end; padding-top: 6px; }
  .ix tr.sub td:first-child { padding-left: 0; }
  .ix tr.group-head td[data-label="Status"] { display: none; }

  .footer { grid-template-columns: 1fr; }
  .footer p:nth-child(even) { text-align: left; }
}

/* ---------- prefixes ---------- */

.prefix-table td:first-child { white-space: nowrap; }
.prefix-table td:nth-child(2) { min-width: 140px; }
.prefix-table .ix-meta.mono { font-size: 11.5px; }

/* ---------- hosting ---------- */

.hosting-list li { gap: 4px 16px; }
.hosting-list .hosting-text { margin-left: auto; color: var(--text-soft); }

/* ---------- looking glass ---------- */

.lg-form { display: grid; gap: 14px; margin-bottom: 18px; }
.lg-row { display: flex; gap: 10px; }
.lg-target {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  font: 14px/1.4 var(--mono);
}
.lg-target:focus { outline: none; border-color: var(--accent); }
.lg-target::placeholder { color: var(--faint); font-family: var(--sans); }

.link-button {
  justify-self: start;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font: 13px var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { color: var(--accent); }
.link-button .mono { font-size: 12px; }

.lg-output {
  min-height: 160px;
  max-height: 480px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  background: #0a0a09;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 12.5px/1.6 var(--mono);
  color: var(--text-soft);
  white-space: pre;
}
.lg-cmd { color: var(--accent); }
.lg-dim { color: var(--faint); }
.lg-err { color: var(--down); white-space: pre-wrap; }

/* ---------- form extras ---------- */

.types-small .type span { padding: 6px 11px; font-size: 13.5px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 20px; }
.field textarea[name="prefixes"] { min-height: 76px; font: 13.5px/1.55 var(--mono); }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq summary h3 { margin: 0; font-size: 16.5px; font-weight: 550; }
.faq summary:hover h3 { color: var(--accent); }
.faq details p { margin: 0 0 18px; max-width: 44em; color: var(--text-soft); }

@media (max-width: 820px) {
  .row-3 { grid-template-columns: 1fr; }
  .lg-row { flex-direction: column; }
  .hosting-list .hosting-text { margin-left: 0; flex-basis: 100%; }
  .globe-legend .hint { margin-left: 0; }
}

.cf-turnstile { min-height: 65px; }
