:root {
  color-scheme: light;
  --paper: #f3f7fc;
  --ink: #152b45;
  --accent: #2357d8;
  --accent-soft: #e6edfc;
  --muted: #5d708a;
  --line: #d5dfec;
  --white: #ffffff;
  --stop: #a34139;
  --font: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { color: var(--ink); background: #cfddfc; }
[hidden] { display: none !important; }
svg { display: block; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 600; }
p { max-width: 68ch; }
code { font: 0.86em/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.wrap { width: min(1232px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 16px; padding: 10px 18px; border-radius: 6px; color: var(--white); background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); color: var(--white); }

.site-header { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 32px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--ink); font-size: 25px; font-weight: 650; letter-spacing: -0.045em; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark circle { fill: var(--paper); }
.site-header nav { display: flex; align-items: center; gap: 32px; }
.site-header nav a { padding-block: 10px; font-size: 14px; font-weight: 500; text-decoration: none; }
.site-header nav .github-star { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.site-header nav .github-star:hover { border-color: var(--accent); }
.github-star svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 42px; padding-block: 77px 89px; }
h1 { font-size: clamp(48px, 4.6vw, 68px); line-height: 1.075; letter-spacing: -0.055em; }
.hero-description { max-width: 47ch; margin-top: 29px; font-size: 18px; line-height: 1.7; color: var(--muted); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 27px; margin-top: 33px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: 11px 23px; border: 1px solid transparent; border-radius: 7px; font-size: 15px; font-weight: 600; text-decoration: none; }
.button-primary { color: var(--white); background: var(--accent); }
.button-primary:hover { color: var(--white); background: #1b46b5; }
.text-link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; text-decoration: none; }
.text-link svg, .companion svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-note { max-width: 44ch; margin-top: 26px; color: var(--muted); font-size: 13px; line-height: 1.65; }

.route-concept { min-width: 0; padding-top: 6px; }
.route-concept figcaption { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.concept-dot { width: 13px; height: 6px; border: 1.5px solid var(--accent); border-radius: 4px; }
.relay-map { width: 100%; height: auto; margin: 7px 0 18px; overflow: visible; }
.relay-map text { font-family: var(--font); fill: var(--ink); }
.route-base { fill: none; stroke: var(--line); stroke-width: 4; }
.client-path, .upstream-path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.dns-path { display: none; fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 2 10; stroke-linecap: round; }
.map-node, .internet-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.client-icon, .globe-icon { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.relay-halo { fill: none; stroke: var(--line); stroke-width: 1; }
.relay-node { fill: var(--accent); }
.relay-icon { fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; }
.relay-icon circle { fill: var(--accent); }
.proxy-node { fill: var(--paper); stroke: var(--accent); stroke-width: 3; }
.proxy-glyph { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.map-label { font-size: 17px; font-weight: 500; }
.map-label-strong { font-size: 21px; font-weight: 600; letter-spacing: -0.4px; }
.relay-map .map-detail { fill: var(--muted); font-size: 13px; }
.relay-map .map-annotation { fill: var(--muted); font-size: 13px; }
.stop-marker { display: none; }
.stop-marker circle { fill: var(--paper); stroke: var(--stop); stroke-width: 2; }
.stop-marker path { fill: none; stroke: var(--stop); stroke-width: 2; stroke-linecap: round; }
.route-concept[data-mode="dns"] .upstream-path { opacity: 0; }
.route-concept[data-mode="dns"] .dns-path { display: block; }
.route-concept[data-mode="blocked"] .upstream-path { stroke: var(--line); stroke-dasharray: 5 7; }
.route-concept[data-mode="blocked"] .proxy-node, .route-concept[data-mode="blocked"] .proxy-glyph { stroke: var(--muted); }
.route-concept[data-mode="blocked"] .stop-marker { display: block; }
.concept-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.concept-controls button { min-height: 42px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 500; }
.concept-controls button:hover { border-color: var(--accent); color: var(--accent); }
.concept-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.concept-result { min-height: 3.5em; margin-top: 17px; font-size: 14px; line-height: 1.7; }
.concept-disclaimer { margin-top: 9px; color: var(--muted); font-size: 11px; }

.routing-section { padding-block: 60px 78px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: end; margin-bottom: 46px; }
h2 { font-size: clamp(32px, 3vw, 43px); line-height: 1.16; letter-spacing: -0.045em; }
.section-heading > p { max-width: 44ch; color: var(--muted); font-size: 17px; }
.routing-content { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 82px; }
.behavior-list > div { padding-block: 22px; border-top: 1px solid var(--line); }
.behavior-list > div:first-child { padding-top: 0; border: 0; }
.behavior-list > div:last-child { padding-bottom: 0; }
.behavior-list dt { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.behavior-list dd { max-width: 58ch; margin-top: 8px; color: var(--muted); font-size: 15px; }
.scope-note { align-self: start; padding: 29px 31px 32px; border-radius: 3px 26px 3px 3px; color: var(--white); background: var(--ink); }
.scope-note > svg { width: 32px; height: 32px; margin-bottom: 22px; stroke: #acc4fa; stroke-width: 1.5; }
.scope-note h3 { font-size: 22px; line-height: 1.3; letter-spacing: -0.025em; }
.scope-note p { margin-top: 13px; color: #d6e0ee; font-size: 14px; line-height: 1.75; }
.scope-note .scope-conclusion { margin-top: 22px; padding-top: 20px; border-top: 1px solid #42566f; color: var(--white); }
.boundary-note { max-width: 96ch; margin-top: 40px; padding-left: 18px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; }
.boundary-note strong { color: var(--ink); font-weight: 600; }

.setup-section { padding-block: 77px 72px; background: var(--white); border-block: 1px solid var(--line); }
.setup-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 111px; }
.setup-intro > p { max-width: 33ch; margin-top: 23px; color: var(--muted); font-size: 16px; }
.setup-intro > .text-link { margin-top: 24px; color: var(--accent); }
.setup-intro > .access-note { max-width: 35ch; margin-top: 32px; padding-top: 21px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.setup-steps { display: grid; gap: 27px; margin: 0; padding-left: 28px; }
.setup-steps li { padding-left: 12px; }
.setup-steps li::marker { color: var(--accent); font-size: 16px; font-weight: 600; }
.setup-steps h3, .build-note h3 { font-size: 18px; line-height: 1.4; letter-spacing: -0.02em; }
.setup-steps p { margin-top: 7px; color: var(--muted); font-size: 14px; }
.setup-steps p a { color: var(--ink); }
.setup-steps p a:hover { color: var(--accent); }
.build-note { margin-top: 35px; padding-top: 28px; border-top: 1px solid var(--line); }
.build-note > p { max-width: 57ch; margin-top: 9px; color: var(--muted); font-size: 13px; }
.command-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 17px; padding: 13px 14px 13px 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.command-line > code { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.copy-button { flex-shrink: 0; min-height: 38px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--white); font-size: 12px; font-weight: 600; }
.copy-button:hover { color: var(--accent); border-color: var(--accent); }
.build-note > .copy-status { min-height: 1.65em; margin-top: 7px; font-size: 12px; }

.questions-section { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 111px; padding-block: 77px 80px; }
.questions-section > h2 { max-width: 11ch; }
.questions details { border-bottom: 1px solid var(--line); }
.questions details:first-child { border-top: 1px solid var(--line); }
.questions summary { position: relative; padding: 20px 28px 20px 0; list-style: none; font-size: 15px; font-weight: 500; cursor: pointer; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; position: absolute; right: 1px; top: 16px; color: var(--accent); font-size: 24px; font-weight: 400; line-height: 1.4; }
.questions details[open] summary::after { content: "−"; }
.questions details > p { padding-bottom: 22px; color: var(--muted); font-size: 14px; }
.companion { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding-block: 26px; border-block: 1px solid var(--line); }
.companion p { color: var(--muted); font-size: 16px; }
.companion a { display: inline-flex; align-items: center; gap: 13px; font-weight: 600; text-decoration: none; }
.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 21px; padding-block: 35px 39px; color: var(--muted); font-size: 11px; }
.site-footer .footer-brand { color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.footer-links { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: 12px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

@media (min-width: 1600px) { .hero { padding-block: 96px 104px; } }
@media (max-width: 1080px) {
  .wrap { width: calc(100% - 64px); }
  .site-header nav { gap: 24px; }
  .hero { gap: 26px; }
  h1 { font-size: clamp(43px, 5.1vw, 56px); }
  .hero-description { font-size: 16px; }
  .routing-content { gap: 44px; }
  .setup-layout, .questions-section { gap: 64px; }
}
@media (max-width: 800px) {
  .site-header { min-height: 94px; }
  .hero { grid-template-columns: 1fr; gap: 49px; padding-block: 55px 58px; }
  .hero-copy { max-width: 650px; }
  h1 { font-size: clamp(47px, 7.8vw, 65px); }
  .hero-description { max-width: 51ch; font-size: 18px; }
  .hero-note { max-width: none; }
  .route-concept { width: min(100%, 580px); margin-inline: auto; }
  .relay-map { margin-block: 14px 18px; }
  .concept-result { min-height: 0; }
  .section-heading { gap: 32px; }
  .section-heading > p { font-size: 15px; }
  .routing-content { grid-template-columns: 1fr 0.9fr; gap: 32px; }
  .scope-note { padding: 25px; }
  .setup-layout, .questions-section { grid-template-columns: 1fr; gap: 36px; }
  .setup-intro > p { max-width: 58ch; }
  .setup-intro > .access-note { max-width: 64ch; margin-top: 24px; padding-top: 16px; }
  .questions-section > h2 { max-width: none; }
}
@media (max-width: 640px) {
  .site-header { min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding-block: 22px 16px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 12px; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 22px; }
  .wrap { width: calc(100% - 40px); }
  .brand { font-size: 24px; }
  .site-header nav a { font-size: 13px; padding-block: 5px; }
  .hero { padding-top: 43px; gap: 42px; }
  h1 { font-size: clamp(39px, 9vw, 50px); letter-spacing: -0.055em; }
  .hero-description { margin-top: 24px; font-size: 16px; line-height: 1.75; }
  .hero-actions { gap: 23px; margin-top: 27px; }
  .hero-note { margin-top: 21px; font-size: 12px; }
  .route-concept figcaption { font-size: 12px; }
  .relay-map { margin-block: 16px 15px; }
  .concept-controls { gap: 6px; }
  .concept-controls button { flex: 1; padding-inline: 8px; font-size: 12px; }
  .concept-result { margin-top: 14px; font-size: 13px; }
  .concept-disclaimer { margin-top: 10px; font-size: 10px; }
  .routing-section { padding-block: 43px 48px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; margin-bottom: 30px; }
  h2 { font-size: 34px; }
  .section-heading h2 br, .setup-intro h2 br { display: none; }
  .section-heading > p { max-width: 38ch; }
  .routing-content { grid-template-columns: 1fr; gap: 28px; }
  .behavior-list dd { font-size: 14px; }
  .scope-note { padding: 26px; }
  .scope-note > svg { margin-bottom: 17px; }
  .boundary-note { margin-top: 28px; font-size: 12px; }
  .setup-section { padding-block: 46px 37px; }
  .setup-layout { gap: 31px; }
  .setup-intro > p { margin-top: 18px; font-size: 15px; }
  .setup-intro > .text-link { margin-top: 19px; }
  .setup-steps { gap: 25px; padding-left: 23px; }
  .setup-steps li { padding-left: 7px; }
  .setup-steps h3, .build-note h3 { font-size: 17px; }
  .command-line { gap: 9px; padding-left: 13px; }
  .command-line > code { font-size: 11px; }
  .questions-section { gap: 28px; padding-block: 46px; }
  .questions summary { font-size: 14px; }
  .companion { align-items: flex-start; flex-direction: column; gap: 10px; padding-block: 23px; }
  .companion p { font-size: 14px; }
  .site-footer { gap: 12px 20px; padding-block: 27px 30px; }
  .site-footer > p { flex-basis: 100%; order: 3; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
