/* Hallmark · shape: single-screen product tour · genre: atmospheric · theme: brand · redesign: full · job: try
 * paper: #0a0a0a · accent: #e6e6e6 · display: Bricolage Grotesque and Noto Sans SC · body: same
 * hero: Poster (/, /zh/) · nav: centered text links · footer: colophon · signature: four connected Three.js data diagrams
 * axes: dark/geometric/monochrome · posture: restrained · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E5 S5 R4 V5 · weakest: R, the wide field retains a dark area next to the live diagram for the installers. */
/* Hallmark · waive 59 · one visible chapter · the installer links and feature navigation share a viewport with the diagram. */
/* Hallmark · dismissed 77 · four chapters share one canvas with a distinct diagram in each. */
/* Hallmark · reworded "Any Agent. All Downloads." to "AI-native download manager" and "AI 原生高性能下载器" · the headline uses the requested product category. */
/* Hallmark · reworded "Inside OnesDM", "Parallel transfers", "OnesDM 的下载能力" to "Parallel downloads" and "并行分段下载" · the chapter describes a single split file. */
/* Hallmark · reworded "Capture streaming media", "From player to download queue", "抓取页面媒体", "从播放器到下载队列" to "Browser media capture" and "浏览器媒体抓取" · the capture chapter keeps the demo steps. */
/* Hallmark · reworded "Extend your agent", "Get started", "扩展 AI 的下载能力", "开始使用" to "MCP for AI agents" and "MCP 接入 AI 助手" · the MCP chapter links to setup and plugins. */
/* Hallmark · reworded "https://github.com/AreChen/NDM-Next/releases/download/desktop-v0.6.9/" to "https://github.com/AreChen/NDM-Next/releases/latest" in the fallback view · platform links use the existing release resolver. */
/* Hallmark · dropped #download, Download for desktop, 下载桌面版 · installer links now sit in the overview at the same download anchor. */
/* Hallmark · dropped 68.4% · the Three.js path replaces the sample progress card. */
@import url("./tokens.css");
@import url("./base.css");
@import url("./transfer.css");

@media (prefers-reduced-motion: no-preference) {
  :root {
    view-transition-name: none;
  }

  .story {
    view-transition-name: product-tour;
  }

  .privacy-layout {
    view-transition-name: privacy-policy;
  }

  ::view-transition {
    pointer-events: none;
  }

  ::view-transition-group(product-tour),
  ::view-transition-group(privacy-policy) {
    animation-duration: 300ms;
    animation-timing-function: var(--ease-out);
  }
}

.story-enabled {
  scroll-padding: 0;
}

.story-enabled body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  block-size: 100dvh;
  overflow-y: clip;
}

.skip-link {
  position: absolute;
  z-index: 5;
  inset: var(--space-sm) auto auto var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-control);
  background: var(--color-ink);
  color: var(--color-paper);
  transform: translateY(calc(-1 * var(--space-2xl)));
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.top,
.footer {
  position: relative;
  z-index: 2;
}

.top-inner,
.header-links,
.footer-links {
  display: flex;
  align-items: center;
}

.top-inner {
  justify-content: space-between;
  min-height: var(--header-height);
}

.wordmark,
.header-icon {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark {
  gap: var(--space-sm);
  font: 750 var(--text-logo)/1 var(--font-display);
  letter-spacing: -0.05em;
}

.wordmark img {
  width: var(--mark-size);
  height: var(--mark-size);
}

.header-links {
  gap: var(--space-2xs);
}

.header-icon {
  justify-content: center;
  min-width: var(--control-height);
  border-radius: var(--radius-pill);
  color: var(--color-ink-2);
  transition: background-color var(--dur-micro), color var(--dur-micro);
}

.header-icon:hover,
.header-icon:active {
  color: var(--color-accent-hover);
  background-color: var(--color-action-hover);
}

.header-icon svg,
.github-mark {
  width: var(--header-icon-size);
  height: var(--header-icon-size);
}

.github-mark {
  display: block;
  background-color: currentColor;
  mask: url("./github.svg") center / contain no-repeat;
}

.language-picker {
  position: relative;
}

.language-picker summary {
  list-style: none;
  cursor: pointer;
}

.language-picker summary::-webkit-details-marker {
  display: none;
}

.language-picker[open] summary {
  color: var(--color-ink);
  background: var(--color-action-hover);
}

.language-options {
  position: absolute;
  inset-block-start: calc(100% + var(--space-xs));
  inset-inline-end: 0;
  min-inline-size: 11.5rem;
  max-block-size: min(22rem, 65dvh);
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: var(--space-2xs);
  list-style: none;
  border: var(--rule-hair) solid var(--color-rule-strong);
  border-radius: calc(var(--radius-control) + var(--space-2xs));
  background: var(--color-paper-2);
  box-shadow: 0 12px 36px rgb(0 0 0 / 48%);
}

.language-options a {
  display: flex;
  align-items: center;
  min-block-size: 34px;
  padding-inline: var(--space-sm);
  border-radius: var(--radius-control);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}

.language-options a:hover,
.language-options a[aria-current="page"] {
  background: var(--color-action-hover);
  color: var(--color-ink);
}

.language-options a:focus-visible {
  outline-offset: -2px;
}

@media (prefers-reduced-motion: no-preference) {
  .language-picker[open] .language-options {
    animation: show-language-options var(--dur-short) var(--ease-out) both;
  }

  @keyframes show-language-options {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }
}

.footer a:hover,
.text-link:hover {
  color: var(--color-accent-hover);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--footer-height);
}

.footer-links {
  grid-column: 3;
  justify-self: end;
  gap: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.footer-name {
  color: var(--color-ink-2);
  font-weight: 750;
}

.footer a {
  text-decoration: none;
}

.story {
  position: relative;
  min-height: 0;
  isolation: isolate;
}

.story-shell {
  position: relative;
}

.story-enabled .story-shell,
.story-enabled .story-chapters {
  height: 100%;
}

.story-chapters {
  min-height: 0;
}

.chapter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: safe center;
  min-height: 280px;
  padding-block: var(--space-2xl);
}

.story-enabled .chapter {
  min-height: 0;
  height: 100%;
  padding-block: var(--space-lg);
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.chapter-copy {
  width: var(--copy-width);
}

.chapter h1,
.chapter h2 {
  font-weight: 660;
  text-wrap: wrap;
}

.chapter h1 {
  line-height: 1.01;
}

.headline-prefix {
  display: block;
  margin-block-end: 0.10em;
  color: var(--color-ink-2);
}

.headline-word {
  position: relative;
  display: inline-block;
  min-block-size: 1lh;
  vertical-align: top;
  max-inline-size: 100%;
  overflow-wrap: anywhere;
}

.headline-subject {
  display: block;
}

.headline-subject + .headline-prefix {
  margin-block: 0.10em 0;
}

.is-scrambling {
  position: relative;
}

.scramble-source {
  opacity: 0;
}

.scramble-text {
  position: absolute;
  inset: 0;
  overflow: clip;
  pointer-events: none;
  user-select: none;
}

.chapter:is(:lang(zh), :lang(ja), :lang(ko)) h1,
.chapter:is(:lang(zh), :lang(ja), :lang(ko)) h2 {
  letter-spacing: -0.035em;
  line-height: 1.14;
}

@media (prefers-reduced-motion: no-preference) {
  .story-enabled .chapter:not([hidden]) .chapter-copy {
    animation: chapter-enter var(--dur-long) var(--ease-out) both;
  }

  @keyframes chapter-enter {
    from {
      opacity: 0;
      translate: 0 var(--space-xs);
    }
  }

  .headline-word.is-typing::after {
    position: absolute;
    inset: 0.12em auto 0.05em calc(100% + 0.13em);
    width: 2px;
    border-radius: var(--radius-pill);
    background: currentColor;
    animation: caret-blink 1030ms step-end infinite;
    content: "";
  }

  @keyframes caret-blink {
    55% {
      opacity: 0;
    }
  }
}

.lead {
  max-width: 39ch;
  margin-block-start: clamp(var(--space-md), 1.5vw, var(--space-lg));
  color: var(--color-ink-2);
  font-size: var(--text-lead);
  line-height: 1.65;
}

.lead:is(:lang(zh), :lang(ja), :lang(ko)) {
  max-width: 26em;
}

.download-options,
.feature-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-block-start: var(--space-lg);
}

.download-options {
  gap: clamp(var(--space-2xs), 1vw, var(--space-sm));
  margin-block-start: clamp(var(--space-lg), 2vw, var(--space-xl));
}

.platform-menu {
  position: relative;
}

.platform-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--download-height);
  padding-inline: clamp(var(--space-sm), 1.35vw, var(--space-lg));
  border-radius: var(--radius-pill);
  color: var(--color-button-ink);
  background-color: var(--color-button);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro);
}

.platform-pick::-webkit-details-marker {
  display: none;
}

.platform-pick:hover,
.platform-menu[open] .platform-pick {
  color: var(--color-button-ink);
  background-color: var(--color-accent-hover);
}

.platform-pick:active {
  color: var(--color-button-ink);
  background-color: var(--color-button-active);
}

.platform-icon {
  display: inline-block;
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  background: currentColor;
  mask: var(--platform-icon) center / contain no-repeat;
}

.icon-windows {
  --platform-icon: url("./platforms/windows.svg");
}

.icon-macos {
  --platform-icon: url("./platforms/apple.svg");
}

.icon-linux {
  --platform-icon: url("./platforms/linux.svg");
}

.platform-chevron {
  width: 5px;
  height: 5px;
  margin-inline-start: var(--space-2xs);
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: translateY(-25%) rotate(45deg);
  transition: transform var(--dur-short) var(--ease-out);
}

.platform-menu[open] .platform-chevron {
  transform: translateY(25%) rotate(225deg);
}

.mac-options {
  position: absolute;
  z-index: 2;
  inset: calc(100% + var(--space-2xs)) auto auto 50%;
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  width: max-content;
  translate: -50%;
}

.mac-options a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-height: var(--installer-choice-height);
  padding-inline: var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
  background: var(--color-paper-2);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.mac-options a:hover,
.mac-options a:active {
  color: var(--color-accent-hover);
  background: var(--color-action-hover);
}

@media (prefers-reduced-motion: no-preference) {
  .platform-menu[open] .mac-options {
    animation: installer-reveal 300ms var(--ease-out) both;
  }

  @keyframes installer-reveal {
    from {
      opacity: 0;
      transform: translateY(-6px) scale(0.96);
    }
  }
}

@media (hover: hover) and (pointer: fine) {
  .story-enabled .chapter-overview {
    margin-inline: calc(-1 * var(--space-md));
    padding-inline: var(--space-md);
  }

  :is(.platform-pick, .mac-options a, .header-icon, .privacy-back) {
    position: relative;
  }

  :is(.platform-pick, .mac-options a, .header-icon, .privacy-back)::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px white, 0 0 12px 2px rgb(255 255 255 / 64%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-short) var(--ease-out);
    content: "";
  }

  :is(.platform-pick, .mac-options a, .header-icon, .privacy-back):hover::after {
    opacity: 0.78;
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  :is(.platform-pick, .mac-options a, .header-icon, .privacy-back):hover::after {
    animation: edge-breathe 1900ms ease-in-out infinite;
  }

  @keyframes edge-breathe {
    0%, 100% {
      opacity: 0.35;
    }

    50% {
      opacity: 0.9;
    }
  }
}

.capture-steps {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xs) var(--space-sm);
  min-inline-size: 0;
  margin: var(--space-sm) 0 var(--space-md);
  padding: 0;
  border: 0;
}

.capture-steps input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.capture-steps label {
  display: grid;
  align-items: center;
  min-height: var(--control-height);
  color: var(--color-muted);
  font-size: var(--text-sm);
  cursor: pointer;
}

.capture-steps label:not(:last-of-type)::after {
  content: "→";
  position: absolute;
  margin-inline-start: calc(100% + var(--space-xs));
  color: var(--color-muted);
  font-size: var(--text-xs);
  pointer-events: none;
}

.capture-steps label:not(:last-of-type) {
  position: relative;
  margin-inline-end: var(--space-md);
}

.capture-steps label:hover,
.capture-steps input:checked + label {
  color: var(--color-accent);
}

.capture-steps input:focus-visible + label {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.capture-steps input:disabled + label {
  background: var(--color-paper-2);
  color: var(--color-disabled);
  cursor: not-allowed;
}

.capture-pane {
  display: none;
  flex: 0 0 100%;
  max-width: none;
  color: var(--color-ink-2);
  font: var(--text-xs)/1.5 var(--font-code);
  overflow-wrap: anywhere;
}

#cap-0:checked ~ #capture-pane-0,
#cap-1:checked ~ #capture-pane-1,
#cap-2:checked ~ #capture-pane-2 {
  display: block;
}

.feature-links {
  gap: var(--space-lg);
  margin-block-start: var(--space-md);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  color: var(--color-accent);
  font-size: var(--text-sm);
}

.story-nav {
  grid-column: 2;
  position: relative;
  display: flex;
  justify-content: center;
  gap: clamp(var(--space-2xs), 1.65vw, var(--space-xl));
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  isolation: isolate;
}

.story-nav a {
  display: grid;
  place-items: center;
  min-height: var(--control-height);
  padding-inline: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 580;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-short);
}

.story-nav a:hover,
.story-nav a[aria-current="step"] {
  color: var(--color-accent-hover);
}

.story-nav a:active {
  color: var(--color-ink);
}

.story-light {
  position: absolute;
  z-index: 1;
  inset: 50% auto auto 0;
  width: var(--light-width);
  height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translate(calc(var(--light-x, 0px) - 50%), -50%);
}

[data-light-positioned] .story-light {
  background: radial-gradient(ellipse, var(--color-nav-glow), transparent 69%);
  transition: transform var(--dur-long) var(--ease-out);
}

@media (max-width: 52rem) {
  .footer-inner {
    grid-template-columns: 1fr;
    padding-block-end: var(--space-xs);
  }

  .story-nav,
  .footer-links {
    grid-column: 1;
    justify-self: center;
  }

  .story-enabled .chapter {
    justify-content: flex-start;
    padding-block: calc(var(--mobile-stage-height) - var(--space-md)) var(--space-lg);
  }

  .chapter-copy {
    width: min(100%, 520px);
    margin-inline: auto;
  }

  .lead {
    margin-block-start: var(--space-xs);
    line-height: 1.50;
  }

  .download-options {
    gap: var(--space-2xs);
    margin-block-start: var(--space-md);
  }

  .platform-pick {
    padding-inline: var(--space-sm);
  }

  .feature-links {
    margin-block-start: var(--space-xs);
  }
}

@media (max-width: 22rem) {
  .platform-pick {
    gap: var(--space-2xs);
    padding-inline: var(--space-xs);
  }
}

@media (forced-colors: active) {
  .story-nav a[aria-current="step"] {
    color: Highlight;
    text-decoration: underline;
  }

  .platform-icon,
  .github-mark {
    forced-color-adjust: none;
  }
}
