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

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #fff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --link: #0969da;
  --button: #0d1117;
  --button-hover: #323941;
  --button-text: #fff;
  --terminal: #0d1117;
  --terminal-edge: #30363d;
  --terminal-shadow: 0 22px 48px -32px #0d11176b, 0 2px 8px #0d11170d;
  --terminal-text: #79c0ff;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --gutter: clamp(18px, 5vw, 72px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1117;
  --surface: #151b23;
  --text: #f0f6fc;
  --muted: #9198a1;
  --border: #30363d;
  --link: #79c0ff;
  --button: #e6edf3;
  --button-hover: #c9d1d9;
  --button-text: #0d1117;
  --terminal: #010409;
  --terminal-shadow: 0 22px 48px -32px #010409d9, 0 2px 8px #01040940;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #0d1117;
    --surface: #151b23;
    --text: #f0f6fc;
    --muted: #9198a1;
    --border: #30363d;
    --link: #79c0ff;
    --button: #e6edf3;
    --button-hover: #c9d1d9;
    --button-text: #0d1117;
    --terminal: #010409;
    --terminal-shadow: 0 22px 48px -32px #010409d9, 0 2px 8px #01040940;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--page); font: 400 16px/1.6 var(--sans); }
h1, h2, h3, p, figure, pre { margin: 0; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
img { display: block; }
code, pre { font-family: var(--mono); }
[hidden] { display: none !important; }

.icon { display: block; flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clipboard-helper { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; opacity: 0; }
.skip-link { position: fixed; z-index: 2; top: 12px; left: 12px; padding: 8px 12px; background: var(--page); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.container { width: min(1160px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--border); }
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 66px; }
.brand, .github-link, .main-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.brand { justify-self: start; gap: 9px; font-weight: 800; white-space: nowrap; }
.main-nav { display: flex; gap: 30px; color: var(--muted); }
.main-nav a { position: relative; }
.main-nav a::after { content: ""; position: absolute; inset: auto 0 4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; }
.main-nav a:is(:hover, :focus-visible)::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; justify-self: end; gap: clamp(5px, 1.3vw, 16px); }
.github-link { gap: 6px; font-weight: 750; }
.main-nav a:hover, .github-link:hover, .text-link:hover, .checksum-link:hover, .site-footer a:hover { color: var(--link); }
.theme-toggle { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: var(--page); font-size: 17px; }
.language-toggle { min-width: 44px; min-height: 44px; padding: 0 5px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 750; }
.theme-toggle:hover, .language-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle .icon, .copy-icons .icon { grid-area: 1 / 1; }
.theme-icon-dark, [data-theme="dark"] .theme-icon-light { opacity: 0; transform: rotate(-35deg) scale(.7); }
[data-theme="dark"] .theme-icon-dark { opacity: 1; transform: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  gap: clamp(28px, 6vw, 92px);
  padding-block: clamp(72px, 7.2vw, 104px);
}

.hero-subtitle { color: var(--muted); font-weight: 650; }
.hero h1 { margin: 16px 0 0; font-size: 4.75rem; font-weight: 800; line-height: .94; }
.hero h1 span { display: block; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 28px; }

.button, .text-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 9px; font-size: 14px; font-weight: 750; }
.button { padding: 8px 15px; border: 1px solid transparent; border-radius: 6px; color: var(--button-text); background: var(--button); white-space: nowrap; }
.button:hover { background: var(--button-hover); }
.text-link:is(:hover, :focus-visible) > span:first-child { text-decoration: underline; text-underline-offset: 4px; }

.terminal-wrap, .features, .install { scroll-margin-block-start: 20px; }
.terminal-wrap { min-width: 0; }
.terminal-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 100%;
  min-height: 205px;
  aspect-ratio: 1.8;
  padding: clamp(10px, 1.6vw, 20px);
  border: 1px solid var(--terminal-edge);
  border-radius: 8px;
  color: var(--terminal-text);
  background: var(--terminal);
  box-shadow: var(--terminal-shadow);
  font: 400 clamp(9px, 1.05vw, 13px)/1.35 var(--mono);
}

.terminal-display { display: grid; place-items: center; min-width: 0; container-type: inline-size; }
.figlet-art { font-size: min(18px, calc(96cqi / 56 / .62)); line-height: 1.25; white-space: pre; font-variant-ligatures: none; }
.terminal-status { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.terminal-caption { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; color: var(--muted); font-size: 12px; }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 4vw, 56px);
  padding-block: clamp(28px, 4vw, 48px) clamp(40px, 5.2vw, 65px);
  border-top: 1px solid var(--border);
}
.features h2 { font-size: 16px; font-weight: 800; }
.features p { max-width: 34ch; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.7; }
html[lang="zh-CN"] .features p { max-width: 19em; }

.install { border-block: 1px solid var(--border); background: var(--surface); }
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(26px, 5vw, 68px); padding-block: clamp(45px, 5.4vw, 72px); }
.install h2 { font-size: clamp(27px, 2.5vw, 36px); line-height: 1.3; }
.section-intro .text-link { color: var(--muted); }
.section-intro .text-link:hover { color: var(--link); }
.install-panel { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--page); }
.os-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.os-tab { position: relative; min-height: 48px; padding: 6px; border: 0; color: var(--muted); background: transparent; font-size: 13px; font-weight: 650; line-height: 1.4; }
.os-tab::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--link); transform: scaleX(0); opacity: 0; }
.os-tab:focus-visible { outline-offset: -4px; }
.os-tab:hover, .os-tab[aria-selected="true"] { color: var(--link); }
.os-tab:first-child { border-start-start-radius: 7px; }
.os-tab:last-child { border-start-end-radius: 7px; }
.os-tab:hover { background: var(--surface); }
.os-tab[aria-selected="true"]::after { transform: scaleX(1); opacity: 1; }
.download-panel { padding: clamp(14px, 2.5vw, 28px); }
.download-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.download-main h3 { font-size: clamp(17px, 2.1vw, 23px); }
.download-main p { color: var(--muted); font-size: 13px; }
.command-install { margin-top: 18px; padding-inline: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.command-install-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.copy-button { display: inline-flex; flex: none; align-items: center; justify-content: flex-end; gap: 6px; min-width: 107px; min-height: 44px; padding: 0 3px; border: 0; color: var(--link); background: transparent; }
.copy-button:hover #copy-label { text-decoration: underline; text-underline-offset: 3px; }
.copy-icons { display: grid; place-items: center; font-size: 13px; }
.icon-check, [data-copy-state="copied"] .icon-copy { opacity: 0; transform: scale(.65); }
[data-copy-state="copied"] .icon-check { opacity: 1; transform: none; }
.command-install pre { padding-bottom: 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.download-links { display: flex; flex-wrap: wrap; column-gap: 16px; margin-top: 3px; }
.checksum-link { display: inline-flex; align-items: center; min-height: 44px; gap: 5px; color: var(--muted); font-size: 12px; }

#download-primary { max-width: 100%; white-space: normal; }
#download-label { min-width: 0; overflow-wrap: anywhere; }

.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px; min-height: 64px; color: var(--muted); font-size: 12px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

.not-found { display: grid; align-items: center; min-height: 100vh; padding: 20px var(--gutter); }
.not-found-panel { position: relative; width: min(100%, 520px); margin: auto; }
.not-found-panel .header-actions { position: absolute; top: 0; right: 0; }
.not-found-brand { margin-bottom: 28px; }
.not-found-kicker { color: var(--muted); font: 400 14px var(--mono); }
.not-found h1 { margin-top: 7px; font-size: clamp(34px, 7vw, 60px); line-height: 1.25; }
.not-found-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; }

@media (min-width: 1000px) {
  .hero h1 { font-size: 5.75rem; }
}

@media (min-width: 1280px) {
  .hero h1 { font-size: 7rem; }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 33px; padding-block: 50px; }
  .hero h1 { font-size: 4.5rem; }
  .hero h1 span { display: inline; }
  .hero-actions { margin-top: 20px; }
}

@media (max-width: 560px) {
  .header-inner { grid-template-columns: 1fr auto; min-height: 0; padding-top: 6px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; gap: 24px; }
  .hero { padding-block: 39px 34px; }
  .hero h1 { font-size: 3.5rem; }
  .features { grid-template-columns: 1fr; }
  .features p { max-width: 44ch; }
  .install-grid { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 420px) {
  .header-actions .github-link .icon { display: none; }
  .hero h1 { font-size: 2.75rem; }
  .os-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-tab { min-height: 44px; }
  .os-tab:nth-child(2) { border-start-end-radius: 7px; }
  .os-tab:last-child { border-start-end-radius: 0; }
  .os-tab:nth-child(-n + 2) { box-shadow: inset 0 -1px var(--border); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  body, .site-header, .install, .install-panel, .command-install, .terminal-card {
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
  }

  .button, .theme-toggle, .language-toggle, .os-tab { transition: background-color 160ms ease, color 160ms ease, transform 180ms var(--ease-out); }
  .button:active, .theme-toggle:active { transform: scale(.97); }
  .icon { transition: transform 200ms var(--ease-out), opacity 160ms ease; }
  a:is(:hover, :focus-visible) .icon-down { transform: translateY(3px); }
  a:is(:hover, :focus-visible) .icon-external { transform: translate(2px, -2px); }
  a:is(:hover, :focus-visible) .icon-back { transform: translateX(-3px); }
  .main-nav a::after, .os-tab::after { transition: transform 240ms var(--ease-out), opacity 180ms ease; }

  .hero-subtitle { animation: arrive 400ms var(--ease-out) 30ms backwards; }
  .hero h1 { animation: arrive 560ms var(--ease-out) 80ms backwards; }
  .hero-actions { animation: arrive 440ms var(--ease-out) 170ms backwards; }
  .terminal-wrap { animation: arrive 590ms var(--ease-out) 125ms backwards; }
  .figlet-art { animation: terminal-reveal 490ms var(--ease-out) 275ms backwards; }
  .not-found-panel { animation: arrive 440ms var(--ease-out); }

  .hero-copy:focus-within > *, .not-found-panel:focus-within,
  body:has(:target) :is(.hero-copy > *, .terminal-wrap) {
    opacity: 1 !important;
    transform: none !important;
  }

  body:has(:target) .figlet-art { clip-path: none !important; }
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes terminal-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
