:root {
  color-scheme: light dark;
  --canvas: #fafafa;
  --ink: #191919;
  --muted: #5c5c5c;
  --line: #dfdfdf;
  --panel: #f2f2f2;
  --window-mat: #eaeaea;
  --surface: #fdfdfd;
  --shine: #ffffff;
  --halo: #ffffff;
  --mist: #e1e1e1;
  --edge-light: #ffffffb0;
  --solid: #202020;
  --solid-hover: #383838;
  --on-solid: #f7f7f7;
  --ring: #575757;
  --shadow: 0 20px 42px #33333318, 0 4px 10px #33333315;
  --card-shadow: 0 12px 28px #2424240b;
  --button-radius: 10px;
  --frame-radius: 18px;
  --wrap: 1160px;
  --gutter: clamp(20px, 5vw, 76px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #171717;
    --ink: #f1f1f1;
    --muted: #b7b7b7;
    --line: #414141;
    --panel: #232323;
    --window-mat: #303030;
    --surface: #212121;
    --shine: #303030;
    --halo: #454545;
    --mist: #262626;
    --edge-light: #ffffff12;
    --solid: #eaeaea;
    --solid-hover: #d5d5d5;
    --on-solid: #171717;
    --ring: #ddd;
    --shadow: 0 20px 42px #11111155;
    --card-shadow: 0 12px 28px #00000032;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:where(a):focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; border-radius: 4px; }
:where(h1, h2, h3, p, figure, ol) { margin: 0; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 2;
  inset: 12px auto auto 12px;
  padding: 10px 15px;
  transform: translateY(-150%);
  background: var(--solid);
  color: var(--on-solid);
}
.skip-link:focus { transform: none; }

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 44px;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -.045em;
  white-space: nowrap;
  text-decoration: none;
}
.page-nav, .repo-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 32px); }
.repo-nav { justify-self: end; gap: 4px; }
.header-inner nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 520;
  text-decoration: none;
  white-space: nowrap;
}
.page-nav a, .repo-nav a span { color: var(--muted); }
.header-inner nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.header-inner .repo-icon {
  justify-content: center;
  width: 40px;
  border-radius: 8px;
}
.repo-icon:hover { background: var(--panel); }
.repo-nav .maintainer-link {
  margin-inline-start: 5px;
  padding-inline-start: 11px;
  position: relative;
}
.maintainer-link::before {
  content: "";
  position: absolute;
  inset: 13px auto 13px 0;
  border-inline-start: 1px solid var(--line);
}

.beta-bar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(95deg, var(--panel), var(--shine) 50%, var(--panel));
}
.beta-bar-inner {
  min-height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding-block: 7px;
  font-size: 13px;
  text-align: center;
}
.beta-pill {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface);
  font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.beta-bar a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.beta-bar a span { display: inline-block; margin-left: 2px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 16px; }
.hero {
  position: relative;
  isolation: isolate;
  padding-top: clamp(48px, 5vw, 68px);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 49% at 50% 21%, var(--halo), transparent 100%),
    radial-gradient(ellipse 64% 50% at 50% 37%, var(--mist), transparent 100%),
    radial-gradient(ellipse 57% 34% at 50% 66%, var(--mist), transparent 100%);
}
.hero-shader {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
}
.hero-shader[data-rendered] { visibility: visible; }
.hero-motion {
  position: absolute;
  inset-block-start: 5px;
  inset-inline-end: max(var(--gutter), (100% - var(--wrap)) / 2);
  min-height: 44px;
  padding-inline: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.hero-motion:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero-motion:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; border-radius: 5px; }
.hero-copy { margin-inline: auto; text-align: center; }
.hero-label {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 580;
}
.hero h1 {
  font-size: clamp(45px, 5.7vw, 80px);
  font-weight: 690;
  line-height: 1.1;
  letter-spacing: -.065em;
}
.hero h1 span { display: block; }
.hero h1 span + span { color: var(--muted); }
.hero-description {
  margin: clamp(15px, 1.6vw, 21px) auto 0;
  max-width: 36em;
  color: var(--muted);
  font-size: clamp(16px, 1.55vw, 19px);
  line-height: 1.65;
}
.hero-actions, .download-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button {
  min-height: 48px;
  display: inline-flex;
  gap: 11px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  font-weight: 610;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .18s, border-color .18s, transform .14s;
}
.button:focus-visible { border-radius: var(--button-radius); }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--solid); color: var(--on-solid); box-shadow: var(--card-shadow); }
.button-primary:hover { background: var(--solid-hover); }
.button-outline { background: var(--canvas); border-color: var(--line); color: var(--ink); }
.button-outline:hover { background: var(--panel); border-color: var(--muted); }

.hero-figure { margin-top: clamp(32px, 4vw, 43px); }
.hero-stage {
  overflow: hidden;
  padding: clamp(14px, 2.5vw, 34px) clamp(14px, 4.2vw, 60px) 0;
  border: 1px solid var(--line);
  border-radius: var(--frame-radius);
  background:
    radial-gradient(ellipse at 50% 0, var(--halo), transparent 75%),
    linear-gradient(155deg, var(--panel), var(--window-mat));
  box-shadow: inset 0 1px 0 var(--edge-light), var(--card-shadow);
}
.app-window {
  overflow: hidden;
  aspect-ratio: 1440 / 640;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow);
}
.app-window img { width: 100%; }
.hero-figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 12px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.hero-figure figcaption a, .text-link, .download-meta a, .footer-inner a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.section { padding-top: clamp(70px, 9vw, 128px); scroll-margin-top: 24px; }
.section h2 {
  font-weight: 680;
  font-size: clamp(29px, 4.1vw, 54px);
  letter-spacing: -.045em;
  line-height: 1.2;
  text-wrap: balance;
  text-align: center;
}
.keep-phrase { display: inline-block; }
.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(24px, 4.5vw, 54px);
}
.feature {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-width: 0;
  padding: clamp(22px, 2.8vw, 35px);
  border: 1px solid var(--line);
  border-radius: var(--frame-radius);
  background: linear-gradient(148deg, var(--surface), var(--panel));
  box-shadow: inset 0 1px 0 var(--edge-light), var(--card-shadow);
  text-align: center;
}
.feature-copy { max-width: 40ch; }
.feature-workspace { grid-row: span 2; justify-content: space-between; gap: 30px; }
.workspace-figure {
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.feature-agent {
  --muted: #cecece;
  color: #f7f7f7;
  border-color: #363636;
  background: radial-gradient(ellipse at 50% -40%, #555, transparent 75%), linear-gradient(152deg, #292929, #1c1c1c);
  box-shadow: inset 0 1px 0 #ffffff18, var(--card-shadow);
}
.feature-agent code {
  padding: 5px 12px;
  border: 1px solid #ffffff31;
  border-radius: 8px;
  background: #ffffff12;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.feature-takeover { background: radial-gradient(ellipse at 55% 0, var(--shine), var(--panel) 85%); }
.takeover-figure {
  width: min(100%, 248px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.takeover-figure img { width: 100%; }
.feature h3, .workflow h3 {
  font-size: clamp(18px, 1.9vw, 22px);
  letter-spacing: -.025em;
  line-height: 1.35;
  font-weight: 650;
}
.feature p, .workflow p, .download p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 8px;
}
.workflow-steps {
  padding: 0;
  margin-top: clamp(24px, 4vw, 43px);
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--frame-radius);
  background: linear-gradient(145deg, var(--surface), var(--panel));
  box-shadow: inset 0 1px 0 var(--edge-light), var(--card-shadow);
  text-align: center;
}
.workflow-steps li { padding: 25px clamp(16px, 2.6vw, 36px); }
.workflow-steps li + li { border-inline-start: 1px solid var(--line); }
.skill-setup {
  max-width: 540px;
  margin: 16px auto 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: var(--surface);
  scroll-margin-top: 24px;
}
.skill-setup summary { padding-block: 10px; cursor: pointer; font-weight: 570; }
.skill-setup dl { display: grid; gap: 5px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.skill-setup dl div { display: flex; gap: 4px 14px; align-items: baseline; flex-wrap: wrap; }
.skill-setup dt { min-width: 96px; color: var(--muted); font-size: 14px; }
.skill-setup dd { margin: 0; }
.skill-setup code { font-size: 13px; overflow-wrap: anywhere; }
.skill-setup p { margin: 10px 0 12px; font-size: 14px; }
.workflow .text-link { display: flex; width: fit-content; margin: 10px auto 0; font-weight: 570; }

.download { padding-bottom: clamp(68px, 9vw, 115px); }
.download-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--frame-radius);
  background: radial-gradient(ellipse at 50% 0, var(--shine), transparent 72%), linear-gradient(145deg, var(--surface), var(--panel));
  box-shadow: inset 0 1px 0 var(--edge-light), var(--card-shadow);
}
.download-copy { padding: clamp(32px, 6vw, 78px) 18px; text-align: center; }
.download-art {
  position: absolute;
  z-index: -1;
  inset: auto 0 0 auto;
  width: min(37%, 385px);
  opacity: .64;
  mask-image: radial-gradient(ellipse at 70% 54%, #000 16%, transparent 62%);
}
@media (prefers-color-scheme: dark) { .download-art { filter: brightness(.58); } }
.download-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 17px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer-inner > span { color: var(--ink); font-weight: 650; }

@media (max-width: 780px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 12px; min-height: 64px; }
  .page-nav { display: none; }
  .feature-layout { grid-template-columns: minmax(0, 1fr); }
  .feature-workspace { grid-row: auto; }
  .workflow-steps { grid-template-columns: 1fr; gap: 0; }
  .workflow-steps li { padding-block: 19px; }
  .workflow-steps li + li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .download-art { width: min(43%, 260px); opacity: .3; }
}

@media (max-width: 440px) {
  .wrap { --gutter: 18px; }
  .wordmark { gap: 4px; font-size: 18px; }
  .wordmark img { width: 30px; height: 30px; }
  .repo-nav { gap: 2px; }
  .header-inner nav a { font-size: 13px; }
  .hero { padding-top: 47px; }
  .hero-label { margin-bottom: 12px; }
  .hero h1 { font-size: clamp(35px, 11.4vw, 49px); }
  .hero-description { max-width: 21em; text-wrap: pretty; }
  .app-window { aspect-ratio: auto; }
  .download-actions .button { flex: 1 0 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-copy > *, .hero-figure {
    animation: enter .5s cubic-bezier(.22, 1, .36, 1) backwards;
  }
  .hero-copy h1 { animation-delay: .04s; }
  .hero-description { animation-delay: .08s; }
  .hero-actions { animation-delay: .12s; }
  .hero-figure { animation-delay: .16s; }
  .button span { transition: transform .18s cubic-bezier(.22, 1, .36, 1); }
  .button:hover span, .button:focus-visible span { transform: translateY(2px); }
  .beta-bar-inner { animation: enter .36s cubic-bezier(.22, 1, .36, 1) backwards; }
  .beta-bar a span { transition: transform .18s cubic-bezier(.22, 1, .36, 1); }
  .beta-bar a:is(:hover, :focus-visible) span { transform: translateX(3px); }
  @media (hover: hover) {
    .feature { transition: box-shadow .24s ease, transform .24s cubic-bezier(.22, 1, .36, 1); }
    .feature:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 var(--edge-light), var(--shadow); }
  }
  @keyframes enter {
    from { opacity: .62; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  @supports (animation-timeline: view()) {
    .hero-stage {
      animation: window-recede linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 70%;
    }
    @keyframes window-recede { from { transform: scale(1); } to { transform: scale(.975); } }
    .reveal-group {
      animation: section-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }
    @keyframes section-rise {
      from { opacity: .78; transform: translateY(16px); }
      to { opacity: 1; transform: none; }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-shader, .hero-motion { display: none; }
  .button { transition: none; }
  .button:active { transform: none; }
}
