:root {
  --bg: #0c0b0a;
  --bg-elev: #161311;
  --ink: #f3ebe3;
  --muted: #a89788;
  --line: rgba(243, 235, 227, 0.12);
  --ember: #e85d04;
  --ember-deep: #9a3412;
  --copper: #d4a373;
  --font-display: "Syne", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --max: 70rem;
  --header-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }

a { color: var(--copper); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.site-header .wrap { position: relative; }
.site-header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink);
}
.logo-dot { color: var(--ember); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.35rem;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ember);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}
.header-actions .btn { padding: 0.45rem 0.85rem; font-size: 0.86rem; }
.btn-map {
  background: transparent;
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  color: var(--ember);
}
.btn-map:hover {
  border-color: var(--ember);
  background: rgba(232, 93, 4, 0.12);
  color: #ff8a3d;
}

.site-nav-extra { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.4rem 0.65rem;
  font: inherit;
  cursor: pointer;
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}
.nav-scrim.is-open { display: block; }
body.nav-open { overflow: hidden; }

.status-online { color: #7cb518; font-size: 0.85rem; }
.status-offline { color: var(--muted); font-size: 0.85rem; }

.map-details {
  margin-top: 0.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}
.map-details summary {
  cursor: pointer;
  color: var(--copper);
  font-size: 0.88rem;
  list-style: none;
}
.map-details summary::-webkit-details-marker { display: none; }
.map-details summary::before {
  content: "+ ";
  color: var(--muted);
}
.map-details[open] summary::before { content: "− "; }
.map-details .map-meta { margin-top: 0.55rem; }

.join-open-table-wrap { overflow-x: auto; margin-top: 0.75rem; }
.join-open-table code { margin-right: 0.35rem; }
.join-open-table .btn-copy { vertical-align: middle; }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 0.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ember);
  color: #140c08;
}
.btn-primary:hover { background: #ff6d1a; color: #140c08; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--copper); color: var(--ink); }

/* —— Hero —— */
.hero {
  position: relative;
  min-height: min(88vh, 48rem);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 72% 18%, rgba(232, 93, 4, 0.26), transparent 55%),
    radial-gradient(ellipse 55% 45% at 8% 85%, rgba(154, 52, 18, 0.32), transparent 50%),
    linear-gradient(165deg, #1a1410 0%, #0c0b0a 48%, #050403 100%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
.hero-copy {
  padding: clamp(3.5rem, 11vh, 6.5rem) 0 clamp(2.75rem, 7vh, 4.5rem);
  max-width: 38rem;
  animation: rise 0.85s ease-out both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(1.1rem); }
  to { opacity: 1; transform: none; }
}
.eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}
.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.25rem, 15vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
}
.hero-brand .logo-dot { font-style: normal; }
.hero-lead {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  max-width: 28rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* —— Sections —— */
.section {
  padding: clamp(2.75rem, 6vh, 4.25rem) 0;
  border-top: 1px solid var(--line);
}
.section h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  letter-spacing: 0.02em;
}
.section .lede {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 36rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.hub-grid a {
  display: block;
  padding: 1.4rem 1.3rem;
  background: var(--bg-elev);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.hub-grid a:hover { background: #1e1915; }
.hub-grid strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}
.hub-grid span { color: var(--muted); font-size: 0.92rem; }

.map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.map-card {
  padding: 0.75rem 0.9rem;
  background: var(--bg-elev);
  border-left: 3px solid var(--ember-deep);
  display: grid;
  gap: 0.4rem;
}
.map-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  align-items: baseline;
}
.map-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.map-card .port {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.map-meta {
  display: grid;
  gap: 0.4rem;
}
.map-meta-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.9rem;
}
.map-meta-row .k { color: var(--muted); }
.map-meta-row code,
code.cmd {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: 0.84rem;
  color: var(--ink);
  background: #0a0908;
  border: 1px solid var(--line);
  padding: 0.25rem 0.45rem;
  border-radius: 0.15rem;
  word-break: break-all;
}
.btn-copy {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--copper);
  cursor: pointer;
  border-radius: 0.15rem;
  font-family: var(--font-body);
}
.btn-copy:hover { border-color: var(--copper); color: var(--ink); }
.btn-copy.ok { color: var(--ok, #7cb518); border-color: #7cb51855; }

@media (max-width: 640px) {
  .map-meta-row { grid-template-columns: 1fr; }
  .map-meta-row .btn-copy { justify-self: start; }
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.rate-table th,
.rate-table td {
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.rate-table th { color: var(--muted); font-weight: 500; width: 38%; }
.rate-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.note {
  margin-top: 1.35rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.note strong { color: var(--ink); }

.page-head {
  padding: clamp(2.5rem, 7vh, 4rem) 0 1.25rem;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5.5vw, 3.35rem);
  letter-spacing: 0.03em;
}
.page-head p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

/* —— Footer —— */
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: #090807;
  padding: 3rem 0 1.75rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem 1.5rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--line);
}
.footer-brand .logo { font-size: 1.5rem; }
.footer-brand p {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 16rem;
}
.footer-col h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.footer-col a:hover { color: var(--ink); }

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.footer-bar a {
  color: var(--muted);
  text-decoration: none;
}
.footer-bar a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-header-inner { gap: 0.65rem; }
  .logo { font-size: 1.2rem; letter-spacing: 0.06em; }
  .header-desktop-only { display: none !important; }
  .header-actions .btn-primary {
    padding: 0.4rem 0.75rem;
    font-size: 0.84rem;
  }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 35;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--header-h));
    overflow: auto;
    padding: 0.35rem 1.25rem 1.1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav-extra {
    display: grid;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
  }
  .site-nav-extra a { font-weight: 600; }
  .nav-toggle { display: inline-flex; order: 2; }
  .header-actions { gap: 0.4rem; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .map-list li { flex-direction: column; gap: 0.2rem; }
  .join-open-table th:nth-child(2),
  .join-open-table td:nth-child(2) { display: none; }
}
