@font-face {
  font-family: "Warden Sans";
  src: url("/fonts/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

/*
 * Tokens. The NAT troubleshooting page reads --night, --night-soft, --accent-bright,
 * --ink, --muted, --paper and --line, so keep those names.
 */
:root {
  --night: #141624;
  --night-soft: #202337;
  --night-line: #313243;
  --accent-bright: #999bf7;
  --accent-strong: #575ad1;
  --accent-text: #575ad1;
  --ink: #292b54;
  --muted: #555b7e;
  --paper: #f0f2fb;
  --surface: #ffffff;
  --line: #d0d4e9;
  --on-dark: #f0f1ff;
  --on-dark-muted: #b1b5cf;

  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --radius: 10px;
  --space-section: 104px;

  font-family: "Warden Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--night);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
h1, h2, h3 { color: inherit; font-weight: 650; text-wrap: balance; }
p { line-height: 1.65; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 4px; border-radius: 4px; }
.hero a:focus-visible, .site-header a:focus-visible, .section-dark a:focus-visible, .site-footer a:focus-visible, .nat-hero a:focus-visible { outline-color: var(--accent-bright); }
::selection { background: var(--accent-bright); color: var(--night); }

.container { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 10; transform: translateY(-160%); padding: 12px 18px; color: var(--night); background: var(--accent-bright); border-radius: 6px; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
/* Used by the NAT page. */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* Header and footer */
/* Sticky on every page; the same links everywhere, with the current page marked. */
.site-header { position: sticky; top: 0; z-index: 20; color: var(--on-dark); background: var(--night); border-bottom: 1px solid var(--night-line); }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -1px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: none; padding-right: 2px; border-radius: 7px; font-size: 22px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--night); background: var(--accent-bright); }
.brand-period { margin-left: -8px; color: var(--accent-bright); }
.header-inner nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.header-inner nav a, .footer-inner nav a { font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.header-inner nav a:hover, .footer-inner nav a:hover { color: var(--accent-bright); }
.header-inner nav a[aria-current="page"] { color: var(--accent-bright); }
.header-cta { min-height: 36px; }
.site-footer { color: var(--on-dark-muted); background: var(--night); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 32px; }
.footer-inner .brand { color: var(--on-dark); font-size: 20px; }
.footer-inner .brand-mark { width: 26px; height: 26px; font-size: 18px; }
.footer-inner p { font-size: var(--text-sm); }
.footer-inner nav { display: flex; gap: 24px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 8px; font-size: 15px; font-weight: 700; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.button-primary { color: var(--night); background: var(--accent-bright); }
.button-primary:hover { background: #afb0ff; }
.button-outline { min-height: 40px; padding: 0 14px; color: var(--on-dark); border-color: var(--night-line); font-size: var(--text-sm); }
.button-outline:hover { background: var(--night-soft); }
.button-ghost { color: var(--on-dark); border-color: var(--night-line); }
.button-ghost:hover { background: var(--night-soft); }
.button-dark { color: var(--on-dark); background: var(--night); }
.button-dark:hover { background: var(--night-soft); }

/* Hero */
.hero { color: var(--on-dark); background: var(--night); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); gap: 56px; align-items: center; padding-block: 88px 96px; }
h1 { font-size: clamp(40px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -.035em; font-weight: 650; }
h1 > span { display: block; color: var(--accent-bright); }
.hero-lead { max-width: 34em; margin-top: 24px; color: var(--on-dark-muted); font-size: var(--text-lg); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-meta { max-width: 36em; margin-top: 28px; color: var(--on-dark-muted); font-size: var(--text-sm); }
.hero-meta a { color: var(--on-dark); }
.connection-map { min-width: 0; }
.map-svg { display: block; width: 100%; height: auto; }
.map-node-label { fill: var(--on-dark); font-size: 14px; font-weight: 600; }
.map-warden-mark { fill: var(--night); font-size: 43px; font-weight: 800; letter-spacing: -4px; }
.map-warden-label { fill: var(--night); font-size: 17px; font-weight: 800; letter-spacing: -.5px; }
.map-small { fill: var(--on-dark-muted); font-size: 13px; }
.map-direct { fill: var(--accent-bright); font-size: 13px; font-weight: 600; }
.connection-map figcaption { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--on-dark-muted); font-size: var(--text-sm); }
.legend { width: 22px; height: 2px; flex: none; background: var(--accent-bright); }
.legend:not(:first-child) { margin-left: 14px; }
.legend-dashed { background: repeating-linear-gradient(90deg, #939bc6 0 5px, transparent 5px 9px); }

/* Sections */
.section { padding-block: var(--space-section); }
.section-light { background: var(--paper); }
.section-white { background: var(--surface); }
.section-dark { color: var(--on-dark); background: var(--night); }
h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.03em; }
h3 { font-size: var(--text-lg); line-height: 1.35; letter-spacing: -.01em; }
.section-heading { max-width: 720px; }
.section-heading > p { margin-top: 16px; color: var(--muted); font-size: var(--text-lg); }
.section-dark .section-heading > p { color: var(--on-dark-muted); }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.prose { display: grid; gap: 16px; justify-items: start; color: var(--muted); }
.prose a:not(.button) { color: var(--ink); font-weight: 650; }
.prose strong { color: var(--ink); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 48px; padding: 0; list-style: none; }
.steps li { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step-number { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 18px; border-radius: 50%; color: var(--night); background: var(--accent-bright); font-size: 15px; font-weight: 800; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); }
.callout { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; padding: 18px 20px; color: var(--ink); background: #e6e6f3; border: 1px solid #c0c5de; border-radius: var(--radius); }
.callout .icon { margin-top: 3px; color: var(--accent-text); }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.notes h3 { margin-bottom: 10px; }
.notes p { color: var(--muted); }
.notes a { color: var(--ink); font-weight: 650; }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.feature { display: flex; flex-direction: column; gap: 10px; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.feature p { color: var(--muted); }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 9px; color: var(--accent-text); background: #e1e4f7; }
.feature-icon .icon { width: 20px; height: 20px; }
.sample-domain { margin-top: auto; padding-top: 6px; color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.feature .sample-domain { color: var(--ink); }
.sample-domain span { color: var(--muted); font-weight: 600; }
.feature-link { margin-top: auto; color: var(--accent-text); font-weight: 700; }

/* Networks */
.network-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; margin-top: 56px; }
.network-features { display: grid; gap: 32px; }
.network-features article { padding-left: 20px; border-left: 2px solid var(--night-line); }
.network-features h3 { margin-bottom: 8px; }
.network-features p { color: var(--on-dark-muted); }
.routing-demo { padding: 28px; background: var(--night-soft); border: 1px solid var(--night-line); border-radius: 14px; }
.demo-player { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--on-dark); font-size: var(--text-sm); }
.demo-dot { width: 8px; height: 8px; border: 2px solid var(--accent-bright); border-radius: 50%; }
.routing-choice { display: flex; align-items: center; justify-content: center; gap: 14px; width: 80%; margin: 20px auto 0; padding: 16px; background: #2e324e; border: 1px solid #555b7e; border-radius: 10px; }
.routing-choice > div { display: grid; gap: 2px; }
.routing-choice strong { font-size: var(--text-base); }
.routing-choice > div > span { color: var(--on-dark-muted); font-size: 13px; }
.routing-branches { display: flex; width: 68%; height: 40px; margin-inline: auto; }
.routing-branches span { flex: 1; margin-top: 20px; border-top: 1px solid #555b7e; }
.routing-branches span:first-child { border-left: 1px solid var(--accent-bright); border-top-color: var(--accent-bright); }
.routing-branches span:nth-child(2) { position: relative; }
.routing-branches span:nth-child(2)::before { content: ""; position: absolute; top: -20px; left: 50%; width: 1px; height: 40px; background: #555b7e; }
.routing-branches span:last-child { border-right: 1px solid #555b7e; }
.regional-pools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.server-pool { min-width: 0; padding: 12px; border: 1px solid var(--night-line); border-radius: 10px; }
.server-pool h3 { margin-bottom: 10px; font-size: var(--text-sm); }
.server-pool h3 span { display: block; margin-top: 2px; color: var(--on-dark-muted); font-size: 13px; font-weight: 500; }
.pool-servers { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pool-server { display: grid; gap: 2px; padding: 9px 10px; background: #2e324e; border: 1px solid #555b7e; border-radius: 7px; }
.server-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.server-state { color: var(--on-dark-muted); font-size: 13px; }
.pool-server.selected { color: var(--night); background: var(--accent-bright); border-color: var(--accent-bright); }
.pool-server.selected .server-state { color: #191b45; font-weight: 700; }
.pool-server.excluded { background: transparent; border-style: dashed; }
.pool-server.excluded .server-state { color: #d9be8c; }
.demo-caption { margin-top: 20px; color: var(--on-dark-muted); font-size: var(--text-sm); text-align: center; }

/* Development status */
.status-card { margin-top: 72px; padding: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.status-card .button { margin-top: 8px; }

/* Responsive */
@media (max-width: 1080px) {
  .container { width: calc(100% - 56px); }
  .hero-grid, .network-grid, .split { gap: 40px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --space-section: 72px; }
  .container { width: calc(100% - 40px); }
  html { scroll-padding-top: 112px; }
  .header-inner { flex-wrap: wrap; gap: 4px 16px; min-height: 0; padding-block: 10px 6px; }
  .header-cta { margin-left: auto; }
  .header-inner nav { order: 3; width: 100%; margin-left: 0; gap: 20px; overflow-x: auto; padding-block: 6px 2px; scrollbar-width: none; }
  .header-inner nav a { white-space: nowrap; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); padding-block: 48px 56px; }
  .connection-map { max-width: 520px; width: 100%; justify-self: center; }
  .steps, .notes, .split, .network-grid { grid-template-columns: minmax(0, 1fr); }
  .notes { gap: 32px; }
  .status-card { margin-top: 56px; padding: 28px 24px; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .button { width: 100%; }
  .routing-demo { padding: 20px; }
  .routing-branches { width: 1px; height: 24px; border-left: 1px solid #555b7e; }
  .routing-branches span { display: none; }
  .routing-choice { width: 100%; }
  .regional-pools { grid-template-columns: minmax(0, 1fr); }
  .pool-servers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .footer-inner { flex-wrap: wrap; }
  .footer-inner p { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .signal-path { animation: signaling 20s linear infinite; }
  .map-pulse { animation: pulse 3s ease-in-out infinite; }
  @keyframes signaling { to { stroke-dashoffset: -120; } }
  @keyframes pulse { 50% { opacity: .35; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
