:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --line: #e6e6e6;
  --code: #f6f6f6;
  --accent: #1f7a4d;
  --accent-dark: #17603c;
  --accent-wash: #e8f3ed;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
p, h1, h2, h3, figure, ol, pre { margin: 0; }
ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
code, pre { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#hero-title:focus { outline: none; }
.container { width: 100%; max-width: 1040px; margin-inline: auto; padding-inline: 32px; }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 100; padding: 8px 16px; background: var(--bg); border: 1px solid var(--accent); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* Full-screen terminal intro */
html[data-intro-active], html[data-intro-active] body { overflow: hidden; }
.intro-screen { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; padding: clamp(0px, 1vw, 14px); background: var(--code); color: var(--ink); opacity: 1; transition: opacity .82s ease; }
.intro-screen:not([hidden]) { display: grid; }
.intro-screen.is-leaving { opacity: 0; pointer-events: none; }
.intro-terminal { position: relative; isolation: isolate; display: grid; grid-template-rows: 52px minmax(0, 1fr) 38px; width: min(100%, 1560px); min-height: 0; margin-inline: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 16px 56px rgba(17, 17, 17, .1); transform: translateY(0) scale(1); transition: transform .82s cubic-bezier(.2, .8, .2, 1); }
.intro-terminal::after { position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(17, 17, 17, .016) 4px); content: ""; pointer-events: none; }
.intro-screen.is-leaving .intro-terminal { transform: translateY(-14px) scale(.985); }
.intro-topbar, .intro-bottomline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-inline: clamp(16px, 3vw, 42px); background: var(--code); color: var(--muted); font: 12px/1 var(--mono); letter-spacing: .04em; }
.intro-topbar { border-bottom: 1px solid var(--line); }
.intro-brand { display: inline-flex; align-items: center; color: var(--ink); }
.intro-brand-logo { display: block; width: auto; height: 18px; }
.intro-light { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(31, 122, 77, .18); }
.intro-window-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intro-window-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.intro-window-control { position: relative; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid rgba(17, 17, 17, .2); border-radius: 2px; background: #f3f3f3; color: var(--ink); }
.intro-window-control:hover { background: #e7e7e7; }
.intro-window-control-minimize::before { width: 8px; height: 1px; background: currentColor; content: ""; }
.intro-window-control-maximize::before { width: 7px; height: 7px; border: 1px solid currentColor; content: ""; }
.intro-window-control-close:hover { border-color: #c62828; background: #c62828; color: #fff; }
.intro-window-control-close::before, .intro-window-control-close::after { position: absolute; width: 8px; height: 1px; background: currentColor; content: ""; }
.intro-window-control-close::before { transform: rotate(45deg); }
.intro-window-control-close::after { transform: rotate(-45deg); }
.intro-stage { position: relative; display: grid; align-content: start; justify-items: start; min-height: 0; overflow: auto; padding: clamp(22px, 3.5vw, 54px); }
.intro-output { width: 100%; max-width: 1200px; overflow-x: auto; font: 500 clamp(14px, 1.25vw, 18px)/1.85 var(--mono); }
.intro-row { display: block; min-height: 1.85em; white-space: pre; }
.intro-prompt { color: var(--accent); }
.intro-muted { color: var(--muted); }
.intro-address-row { margin-top: 0; }
.intro-public-ip { color: var(--accent); font-size: inherit; font-weight: 700; letter-spacing: 0; line-height: inherit; text-shadow: none; white-space: pre; background: var(--accent-wash); border-radius: 2px; padding-inline: 2px; }
.intro-public-ip.is-revealed { animation: intro-ip-arrive .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes intro-ip-arrive { from { opacity: .2; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.intro-typing-target.is-typing::after { display: inline-block; width: .55ch; height: 1em; margin-left: .12em; background: var(--accent); vertical-align: -.15em; animation: intro-cursor .8s steps(2, start) infinite; content: ""; }
@keyframes intro-cursor { to { visibility: hidden; } }
.intro-connected { display: inline-flex; align-items: center; gap: 10px; margin-top: .65em; color: var(--accent-dark); font: inherit; }
.intro-connected .intro-light { width: 7px; height: 7px; }
.intro-ready-prompt { margin-top: .35em; }
.intro-ready-cursor { display: inline-block; width: .6ch; height: 1em; background: var(--accent); vertical-align: -.15em; animation: intro-cursor .8s steps(2, start) infinite; }
.intro-bottomline { border-top: 1px solid var(--line); }
.intro-bottomline span:last-child { text-align: right; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 60px; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 1; }
.brand-logo { display: block; width: 110px; height: auto; }
.site-nav { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.language-switch { display: flex; align-items: center; color: #bbb; font-size: 13px; }
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 44px; color: var(--muted); }
.language-switch a[aria-current=page] { color: var(--ink); font-weight: 600; }
.menu-toggle { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: none; border: 0; }
.menu-toggle span { width: 18px; height: 1.5px; background: var(--ink); transition: transform .15s; }
.menu-toggle[aria-expanded=true] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle[aria-expanded=true] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 20px; border: 1px solid transparent; border-radius: 6px; font-size: 15px; font-weight: 600; transition: background-color .15s; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-outline { border-color: var(--accent); color: var(--accent); }
.button-outline:hover { background: var(--accent-wash); }
.download-link[aria-disabled=true] { opacity: .45; pointer-events: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px; padding-block: 72px 40px; }
h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; letter-spacing: -.03em; font-weight: 700; white-space: pre-line; text-wrap: balance; }
.hero h1 { margin-bottom: 24px; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.6; letter-spacing: 0; font-weight: 600; text-wrap: pretty; }
.ip-demo { min-width: 0; }
.terminal { padding: 24px 26px; background: var(--code); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 1.8; overflow-x: auto; }
.terminal b { font-weight: 700; }
.terminal mark { padding: 1px 4px; background: var(--accent-wash); color: var(--accent); font-weight: 700; border-radius: 3px; }
.t-muted { color: #999; }
.ip-demo figcaption { margin-top: 10px; color: #999; font-size: 12px; }

/* Feature cards */
.feature-section { padding-bottom: 72px; }
.feature-header { margin-bottom: 18px; }
.feature-header h2 { color: var(--accent); font-size: 14px; line-height: 1.4; font-weight: 700; letter-spacing: .08em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.feature-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; align-items: center; align-content: start; min-width: 0; min-height: 220px; padding: 28px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px rgba(17, 17, 17, .035); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-2px); border-color: rgba(31, 122, 77, .48); box-shadow: 0 10px 24px rgba(17, 17, 17, .08); }
.feature-icon { grid-column: 1; grid-row: 1; display: inline-grid; place-items: center; width: 48px; height: 48px; margin: 0; background: var(--accent-wash); color: var(--accent); border-radius: 12px; }
.feature-icon .icon { width: 24px; height: 24px; }
.feature-card h3 { grid-column: 2; grid-row: 1; min-width: 0; font-size: 18px; line-height: 1.4; font-weight: 700; }
.feature-card p { grid-column: 1 / -1; margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.7; text-wrap: pretty; }

/* Sections */
.section { padding-block: 72px; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 40px; }
h2 { font-size: 28px; line-height: 1.3; letter-spacing: -.02em; font-weight: 700; }
.section-head p { margin-top: 6px; color: var(--muted); }
.section-head .node-bandwidth-note { margin-top: 14px; }

/* Steps */
.steps { counter-reset: step; }
.step { counter-increment: step; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding-block: 28px; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step h3 { align-self: start; margin-top: 6px; display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; line-height: 32px; }
.step h3::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.step-body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: start; }
.step-text { padding-top: 2px; }
.step-text code, .hint code { padding: 1px 5px; background: var(--code); border-radius: 3px; font-size: .92em; }
.hint { color: var(--muted); font-size: 14px; }

.arch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.segmented-control { display: inline-flex; padding: 3px; background: var(--code); border: 1px solid var(--line); border-radius: 8px; }
.segmented-control button { min-height: 38px; padding: 6px 16px; background: none; border: 0; border-radius: 6px; color: var(--muted); font-size: 14px; font-weight: 600; }
.segmented-control button[aria-pressed=true] { background: var(--bg); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.assignment-tabs { width: 100%; display: grid; gap: 18px; }
.assignment-tabs > .segmented-control { justify-self: start; }
.assignment-tabs [role=tab] { min-width: 112px; }
.assignment-tabs [role=tab][aria-selected=true] { background: var(--bg); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.assignment-panel { display: grid; gap: 14px; min-width: 0; }
.assignment-steps { margin: 0; padding-left: 24px; list-style: decimal; line-height: 1.7; }
.assignment-steps li + li { margin-top: 8px; }
.assignment-steps li::marker { color: var(--accent); font-weight: 700; }
.assignment-panel[data-assignment-panel="try"] .hint { color: var(--ink); font-size: 16px; }
/* Without JavaScript, keep both documented allocation paths readable. */
html:not([data-enhanced]) .assignment-panel[hidden] { display: grid !important; }

.file-meta { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; max-width: 100%; color: var(--muted); font: 12px/1.6 var(--mono); }
.checksum { flex: 0 0 100%; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.checksum-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #999; }
.icon-button { display: inline-grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; background: none; border: 0; border-radius: 4px; color: var(--muted); }
.icon-button:hover:not(:disabled) { background: var(--code); color: var(--ink); }
.icon-button:disabled { opacity: .4; }

.code-block { position: relative; width: 100%; background: var(--code); border: 1px solid var(--line); border-radius: 8px; }
.code-block pre { padding: 18px 110px 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.75; }
.copy-code { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.copy-code:hover { color: var(--accent); border-color: var(--accent); }

/* FAQ */
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { max-width: 720px; padding-bottom: 20px; color: var(--muted); }
.faq-distro-answer { padding-bottom: 20px; }
.faq-distro-table { width: 100%; max-width: 800px; border-collapse: collapse; table-layout: fixed; text-align: left; }
.faq-distro-table th, .faq-distro-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.faq-distro-table thead th { background: var(--code); color: var(--muted); font-size: 13px; font-weight: 600; }
.faq-distro-table tbody th { width: 28%; font-size: 14px; font-weight: 600; }
.faq-distro-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.faq-distro-tags li { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: 13px; line-height: 1.5; }

/* Feedback */
.feedback-form { display: grid; gap: 16px; max-width: 720px; }
.feedback-field { display: grid; gap: 6px; font-size: 14px; }
.feedback-field label { font-weight: 600; }
.feedback-field input, .feedback-field select, .feedback-field textarea { width: 100%; padding: 10px 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.feedback-field textarea { resize: vertical; }
.feedback-field input:focus-visible, .feedback-field select:focus-visible, .feedback-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.feedback-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.feedback-status { font-weight: 600; }
.feedback-status.is-ok { color: var(--accent); }
.feedback-status.is-error { color: #b91c1c; }
.faq-list details .feedback-details-body { padding: 4px 0 20px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 72px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 16px; }
.footer-center { justify-content: center; }
.site-footer a { color: var(--accent); }
.site-footer a:hover { text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; padding: 10px 18px; background: var(--ink); color: #fff; border-radius: 6px; font-size: 14px; transform: translateX(-50%); }

/* Timed theme picker (revealed by easter egg, driven by theme.js) */
.theme-switcher { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 12px; width: min(440px, calc(100vw - 48px)); padding: 16px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(17, 17, 17, .22); font-size: 13px; }
.theme-switcher-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -16px -16px 0; padding: 10px 14px; border-radius: 11px 11px 0 0; background: var(--accent); color: #fff; font-weight: 700; }
.theme-switcher-timer { flex: 0 0 auto; font-size: 12px; font-weight: 400; }
.theme-switcher-hint { color: var(--muted); }
.theme-options { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-option { min-height: 36px; padding: 5px 12px; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.theme-option:hover { color: var(--ink); border-color: var(--accent); }
.theme-option[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 56px 28px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}

@media (max-width: 680px) {
  .container { padding-inline: 20px; }
  .header-inner { gap: 0 12px; flex-wrap: wrap; }
  .brand-logo { width: 96px; }
  .site-nav { order: 3; width: 100%; gap: 16px; font-size: 13px; }
  .header-actions { margin-left: auto; }
  [data-enhanced] .menu-toggle { display: flex; }
  [data-enhanced] .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 20px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  [data-enhanced] .site-nav.is-open { display: flex; }
  [data-enhanced] .site-nav a { min-height: 48px; color: var(--ink); font-size: 16px; }
  .theme-switcher { right: 12px; bottom: 12px; left: 12px; width: auto; }
  .section { padding-block: 56px; }
  .feature-section { padding-bottom: 56px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .feature-card { min-height: 0; padding: 24px; }
  h2 { font-size: 24px; }
  .terminal { padding: 18px; font-size: 13px; }
  .intro-screen { gap: 0; padding: 0; }
  .intro-terminal { grid-template-rows: 48px minmax(0, 1fr) 36px; border-radius: 0; }
  .intro-topbar, .intro-bottomline { padding-inline: 14px; font-size: 10px; }
  .intro-window-controls, .intro-bottomline span:last-child { display: none; }
  .intro-stage { padding: 24px 16px; }
  .intro-output { font-size: clamp(9px, 2.7vw, 13px); }
  .intro-connected { gap: 7px; }
  .code-block pre { padding: 52px 16px 16px; font-size: 13px; }
  .step-body > .download-link { width: 100%; }
  .feedback-form > .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .intro-public-ip.is-revealed { animation: none !important; }
  .intro-typing-target.is-typing::after { animation: none !important; }
  .intro-ready-cursor { animation: none !important; }
}
