:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --surface: #ffffff;
  --surface-muted: #eef2ec;
  --text: #171815;
  --muted: #66695f;
  --line: #dedfd7;
  --accent: #175f46;
  --accent-soft: #e7f0eb;
  --code: #26352f;
  --code-line: #41524b;
  --code-text: #e8efe9;
  --header-bg: rgba(247, 247, 243, 0.94);
  --focus: #1b7557;
  --danger: #a13d34;
  --danger-soft: #f5e8e5;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121612;
  --surface: #1a201b;
  --surface-muted: #212a23;
  --text: #edf2ec;
  --muted: #abb6ac;
  --line: #364039;
  --accent: #79cba4;
  --accent-soft: #1c352a;
  --code: #0b110d;
  --code-line: #34473b;
  --code-text: #dce9df;
  --header-bg: rgba(18, 22, 18, 0.94);
  --focus: #8bddb5;
  --danger: #f09b91;
  --danger-soft: #3b211f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  transition: color 180ms ease, background-color 180ms ease;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--text);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  outline: 5px solid var(--accent-soft);
}

.nav-actions,
.nav-links {
  display: flex;
  align-items: center;
}

.nav-actions {
  gap: 18px;
}

.nav-links {
  gap: 22px;
}

.nav-links a {
  position: relative;
  padding: 22px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: color 150ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 14px;
  left: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--accent);
}

.nav-links a.is-active::after {
  transform: scaleX(1);
}

.theme-toggle {
  position: relative;
  width: 42px;
  height: 34px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  overflow: hidden;
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  transition: transform 180ms ease, opacity 180ms ease;
}

.theme-icon-dark {
  opacity: 0;
  transform: translateY(100%);
}

html[data-theme="dark"] .theme-icon-light {
  opacity: 0;
  transform: translateY(-100%);
}

html[data-theme="dark"] .theme-icon-dark {
  opacity: 1;
  transform: translateY(0);
}

main {
  overflow: hidden;
}

.hero {
  min-height: 650px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 72px;
  padding: 96px 0 80px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--accent);
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--text);
  text-decoration: none;
  font-weight: 750;
  font-size: 14px;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.button.primary {
  color: var(--bg);
  background: var(--text);
}

.button.primary:hover {
  color: var(--bg);
  background: var(--accent);
}

.button.secondary {
  background: transparent;
}

.terminal {
  align-self: center;
  background: var(--code);
  color: var(--code-text);
  border: 1px solid var(--code-line);
}

.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--code-line);
}

.terminal-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #829188;
}

.terminal-body {
  padding: 24px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.9;
}

.prompt {
  color: #8cd8b4;
}

.comment {
  color: #9fafaa;
}

.ok {
  color: #bce58f;
}

section {
  padding: 88px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 48px;
  margin-bottom: 44px;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card {
  min-height: 260px;
  padding: 32px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 180ms ease, transform 180ms ease;
}

.card:hover {
  background: var(--surface-muted);
  transform: translateY(-3px);
}

.card-index {
  color: var(--accent);
  font: 700 12px/1.2 "SFMono-Regular", Consolas, monospace;
}

.card h3 {
  margin: 48px 0 10px;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.card p,
.note p {
  margin: 0;
  color: var(--muted);
}

.now {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.note {
  padding: 32px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}

.note-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.note h3 {
  margin: 18px 0 10px;
  font-size: 25px;
}

.section-head code,
.runtime-action code {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.runtime-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.runtime-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
}

.runtime-indicator {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
  outline: 5px solid var(--surface-muted);
}

.runtime-panel[data-state="loading"] .runtime-indicator {
  animation: runtime-pulse 1.1s ease-in-out infinite;
}

.runtime-panel[data-state="ok"] {
  border-color: var(--accent);
}

.runtime-panel[data-state="ok"] .runtime-indicator {
  background: var(--accent);
  outline-color: var(--accent-soft);
}

.runtime-panel[data-state="error"] {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.runtime-panel[data-state="error"] .runtime-indicator {
  background: var(--danger);
  outline-color: var(--danger-soft);
}

.runtime-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 0;
}

.runtime-details div {
  min-width: 0;
}

.runtime-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runtime-details dd {
  margin: 7px 0 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.runtime-action {
  display: flex;
  min-width: 190px;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.runtime-action code {
  text-align: center;
  font-size: 13px;
}

.runtime-action button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

@keyframes runtime-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms ease, transform 600ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  max-width: 420px;
  padding: 12px 16px;
  color: var(--bg);
  background: var(--text);
  font-size: 13px;
}

@media (max-width: 800px) {
  .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 76px 0 68px;
  }

  .terminal {
    max-width: 520px;
  }

  .section-head,
  .now,
  .runtime-panel {
    grid-template-columns: 1fr;
  }

  .runtime-details {
    grid-template-columns: 1fr 1fr;
  }

  .runtime-action {
    min-width: 0;
    align-items: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 68px 0;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 28px, 1120px);
  }

  h1 {
    font-size: clamp(44px, 15vw, 66px);
  }

  .hero {
    padding-top: 58px;
  }

  .runtime-panel {
    padding: 24px;
  }

  .runtime-details {
    grid-template-columns: 1fr;
  }

  .footer-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
