:root {
  color-scheme: light;
  --paper: #f3f7fc;
  --ink: #152b45;
  --accent: #7153bf;
  --accent-soft: #ebe7f7;
  --muted: #5d708a;
  --line: #d5dfec;
  --white: #ffffff;
  --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; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { color: var(--ink); background: #dbd3f0; }
[hidden] { display: none !important; }
svg { display: block; }
h1, h2, h3, p, figure { 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.5; 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; }
.access-label { color: var(--muted); font-size: 0.88em; font-weight: 400; }

.hero { padding-block: 65px 37px; }
.hero-heading { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 80px; align-items: center; }
h1 { font-size: clamp(50px, 5.2vw, 76px); line-height: 1.06; letter-spacing: -0.06em; }
.hero-intro > p { max-width: 43ch; color: var(--muted); font-size: 17px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 26px; margin-top: 26px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 11px; 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: #5d40a6; }
.button svg, .text-link svg, .companion svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.text-link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; text-decoration: none; }
.hero-note { margin-top: 22px; color: var(--muted); font-size: 12px; }

.route-concept { min-width: 0; margin-top: 48px; padding-block: 22px 28px; border-block: 1px solid var(--line); }
.route-concept figcaption { color: var(--ink); font-size: 13px; font-weight: 500; }
.route-concept figcaption span { margin-left: 16px; color: var(--muted); font-weight: 400; }
.concept-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.44fr); align-items: center; gap: 84px; }
.split-map { width: 100%; height: auto; max-width: 700px; overflow: visible; }
.split-map text { font-family: var(--font); fill: var(--ink); }
.route-base { fill: none; stroke: var(--line); stroke-width: 3; }
.entry-path, .route-branch { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.route-branch { opacity: 0; }
.mac-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.mac-icon { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.rules-halo { fill: none; stroke: var(--line); stroke-width: 1; }
.rules-node { fill: var(--accent); }
.rules-icon { fill: none; stroke: var(--white); stroke-width: 2; stroke-linecap: round; }
.rules-icon circle { fill: var(--accent); }
.map-label { font-size: 18px; font-weight: 500; }
.map-label-strong { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.split-map .map-detail { fill: var(--muted); font-size: 12px; }
.destination { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.destination path { fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; }
.route-concept[data-route="direct"] .direct-branch, .route-concept[data-route="proxy"] .proxy-branch, .route-concept[data-route="tailnet"] .tailnet-branch { opacity: 1; }
.route-concept[data-route="direct"] .direct-destination, .route-concept[data-route="proxy"] .proxy-destination, .route-concept[data-route="tailnet"] .tailnet-destination { fill: var(--accent); stroke: var(--accent); }
.route-concept[data-route="direct"] .direct-destination path, .route-concept[data-route="proxy"] .proxy-destination path, .route-concept[data-route="tailnet"] .tailnet-destination path { stroke: var(--white); }
.concept-interaction { max-width: 300px; padding-top: 19px; }
.concept-controls { display: grid; gap: 5px; }
.concept-controls button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 43px; padding: 8px 12px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; text-align: left; font-size: 13px; font-weight: 500; }
.concept-controls button:hover { color: var(--accent); border-color: #c9bde5; }
.concept-controls button[aria-pressed="true"] { color: var(--accent); border-color: #c9bde5; background: var(--accent-soft); }
.rule-indicator { width: 9px; height: 9px; flex-shrink: 0; border: 1px solid currentColor; border-radius: 50%; }
.concept-controls button[aria-pressed="true"] .rule-indicator { border-color: var(--accent); background: var(--accent); }
.concept-result { min-height: 5.1em; margin-top: 16px; font-size: 13px; line-height: 1.7; }
.concept-disclaimer { margin-top: 11px; color: var(--muted); font-size: 10px; line-height: 1.65; }

.routing-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 110px; padding-block: 52px 77px; }
h2 { font-size: clamp(32px, 3vw, 43px); line-height: 1.16; letter-spacing: -0.045em; }
.routing-intro > p { max-width: 39ch; margin-top: 23px; color: var(--muted); font-size: 15px; }
.routing-intro > p + p { margin-top: 17px; }
.ledger-intro { padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.rule-order { margin: 0; padding-left: 22px; }
.rule-order li { padding: 18px 0 19px 13px; border-bottom: 1px solid var(--line); }
.rule-order li::marker { color: var(--accent); font-size: 13px; font-weight: 600; }
.rule-order h3 { font-size: 16px; letter-spacing: -0.015em; line-height: 1.4; }
.rule-order p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.dns-note { margin-top: 19px; font-size: 12px; line-height: 1.75; }

.install-section { --muted: #54657f; padding-block: 69px 54px; background: #eceaf5; border-block: 1px solid #d7d3e7; }
.install-heading { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 110px; align-items: start; }
.download-intro > p { max-width: 57ch; color: var(--muted); font-size: 14px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 21px; }
.button-secondary { color: var(--accent); border-color: var(--accent); background: transparent; }
.button-secondary:hover { background: var(--accent-soft); }
.download-intro > .access-note { margin-top: 14px; font-size: 11px; }
.download-intro > .download-other { margin-top: 12px; font-size: 12px; }
.install-steps { counter-reset: install; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 54px; margin: 45px 0 0; padding: 28px 0 0; border-top: 1px solid #d0cbe1; list-style: none; }
.install-steps li { counter-increment: install; }
.install-steps li::before { content: counter(install, decimal-leading-zero); display: block; margin-bottom: 15px; color: var(--accent); font-size: 14px; font-weight: 600; }
.install-steps h3 { font-size: 19px; line-height: 1.4; letter-spacing: -0.025em; }
.install-steps p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.mode-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 75px; margin-top: 36px; padding-top: 27px; border-top: 1px solid #d0cbe1; }
.mode-comparison h3 { font-size: 14px; }
.mode-comparison p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.8; }

.details-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 110px; padding-block: 75px 78px; }
.build-note { max-width: 440px; margin-top: 34px; }
.build-note h3 { font-size: 16px; letter-spacing: -0.015em; }
.build-note > p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.command-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; padding: 12px 13px 12px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.command-line > code { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.copy-button { flex-shrink: 0; min-height: 38px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); font-size: 12px; font-weight: 600; }
.copy-button:hover { border-color: var(--accent); color: var(--accent); }
.build-note > .copy-status { min-height: 1.75em; margin-top: 6px; font-size: 11px; }
.build-note > .build-caveat { margin-top: 5px; font-size: 11px; }
.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: 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.questions details > p + p { margin-top: -5px; }
.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; letter-spacing: -0.02em; text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.footer-links a { text-decoration: none; }

@media (min-width: 1600px) { .hero { padding-top: 82px; } }
@media (max-width: 1080px) {
  .wrap { width: calc(100% - 64px); }
  .site-header nav { gap: 24px; }
  .hero-heading { gap: 42px; }
  h1 { font-size: clamp(47px, 5.3vw, 62px); }
  .hero-intro > p { font-size: 15px; }
  .concept-layout { gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 0.4fr); }
  .routing-section, .install-heading, .details-section { gap: 64px; }
  .install-steps { gap: 34px; }
}
@media (max-width: 800px) {
  .site-header { min-height: 94px; }
  .hero { padding-top: 49px; }
  .hero-heading { grid-template-columns: 1fr; gap: 26px; }
  h1 { font-size: clamp(52px, 8.3vw, 68px); }
  .hero-intro > p { max-width: 63ch; font-size: 17px; }
  .hero-actions { margin-top: 23px; }
  .route-concept { margin-top: 39px; }
  .concept-layout { gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 0.45fr); }
  .concept-interaction { padding-top: 15px; }
  .concept-result { min-height: 0; }
  .routing-section { grid-template-columns: 1fr; gap: 34px; padding-block: 29px 54px; }
  .routing-intro > p { max-width: 64ch; }
  .rule-ledger { max-width: none; }
  .install-heading { grid-template-columns: 1fr; gap: 28px; }
  .download-intro > p { max-width: 67ch; }
  .install-steps { gap: 25px; }
  .install-steps h3 { font-size: 17px; }
  .install-steps p { font-size: 12px; }
  .mode-comparison { gap: 35px; }
  .details-section { grid-template-columns: 1fr; gap: 33px; }
  .details-section h2 br { display: none; }
  .build-note { max-width: 550px; margin-top: 26px; }
  .site-footer > p { flex-basis: 100%; order: 3; }
}
@media (max-width: 620px) {
  .concept-layout { grid-template-columns: 1fr; gap: 1px; }
  .split-map { max-width: 540px; margin: 12px auto 0; }
  .concept-interaction { max-width: none; padding-top: 0; }
  .concept-controls { display: flex; gap: 6px; }
  .concept-controls button { width: auto; flex: 1; justify-content: center; gap: 8px; padding-inline: 8px; border-color: var(--line); font-size: 12px; }
  .concept-result { min-height: 3.4em; margin-top: 15px; font-size: 13px; }
  .concept-disclaimer { margin-top: 7px; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 22px; }
  .wrap { width: calc(100% - 40px); }
  .site-header { min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding-block: 22px 16px; }
  .brand { font-size: 24px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 13px; }
  .site-header nav a { padding-block: 5px; font-size: 13px; }
  .hero { padding-block: 41px 30px; }
  .hero-heading { gap: 24px; }
  h1 { font-size: clamp(40px, 9.2vw, 51px); letter-spacing: -0.06em; }
  .hero-intro > p { font-size: 16px; line-height: 1.75; }
  .hero-actions { gap: 23px; }
  .route-concept { margin-top: 31px; padding-block: 18px 21px; }
  .route-concept figcaption { font-size: 12px; }
  .route-concept figcaption span { display: block; margin: 3px 0 0; font-size: 11px; }
  .split-map { margin-top: 12px; }
  .concept-controls button { min-height: 42px; gap: 6px; padding-inline: 6px; font-size: 11px; }
  .rule-indicator { width: 7px; height: 7px; }
  .hero-note { max-width: 42ch; margin-top: 18px; font-size: 11px; }
  .routing-section { gap: 28px; padding-block: 22px 44px; }
  h2 { font-size: 34px; }
  .routing-intro h2 br, .install-heading h2 br { display: none; }
  .routing-intro > p { margin-top: 19px; font-size: 14px; }
  .ledger-intro { font-size: 11px; }
  .rule-order { padding-left: 20px; }
  .rule-order li { padding-left: 10px; }
  .rule-order h3 { font-size: 15px; }
  .rule-order p { font-size: 12px; }
  .install-section { padding-block: 44px 37px; }
  .install-heading { gap: 22px; }
  .download-intro > p { font-size: 13px; }
  .download-intro > .access-note { font-size: 11px; }
  .download-actions .button { width: 100%; }
  .install-steps { grid-template-columns: 1fr; gap: 25px; margin-top: 31px; padding-top: 24px; }
  .install-steps li { position: relative; padding-left: 35px; }
  .install-steps li::before { position: absolute; top: 2px; left: 0; margin: 0; font-size: 12px; }
  .install-steps h3 { font-size: 18px; }
  .install-steps p { margin-top: 7px; font-size: 13px; }
  .mode-comparison { grid-template-columns: 1fr; gap: 22px; margin-top: 28px; padding-top: 24px; }
  .details-section { gap: 28px; padding-block: 45px 46px; }
  .build-note { margin-top: 26px; }
  .command-line { gap: 9px; padding-left: 13px; }
  .command-line > code { font-size: 11px; }
  .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: 13px 20px; padding-block: 27px 30px; }
  .site-footer > p { font-size: 10px; }
  .footer-links { gap: 13px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
