/* Hallmark · macrostructure: Workbench · tone: dark-technical · anchor hue: 255 (brand blue)
 * theme: custom — tuned for this brief (vibe: "深夜工位 · 电光蓝 · 冷峻克制")
 *   paper-band: dark · display-style: grotesk-sans + mono metadata · accent-hue: cool
 * nav: N5 Floating pill (first build in this project — no previous nav to rotate against)
 * footer: Ft5 Statement · enrichment: real brand icon in a hairline frame + hand-built SVG trace
 * knobs — F3 spec sheet: columns=2, rules=every row, numbers=tabular
 *         F4 steps: numbering=01/02/03, layout=vertical stack, connector=line
 *         Ft5 statement: sentence width=22em, wordmark=under sentence, rule above meta=hairline
 * motion: underline reveal · disclosure chevron — no load-time or scroll-triggered animation
 * pre-emit critique: P5 H4 E5 S4 R5 V5
 */

/* ── reset ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: clip;                 /* never `hidden` — gate 34 */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--color-paper);
  background-image: linear-gradient(180deg, var(--color-paper-top) 0%, var(--color-paper) 42rem);
  background-repeat: no-repeat;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
p  { text-wrap: pretty; }

::selection {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  /* focus rings never animate — they must show instantly */
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.skip {
  position: absolute;
  left: var(--space-sm);
  top: var(--space-sm);
  z-index: var(--z-toast);
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-ink);
  color: var(--color-paper);
  border-radius: var(--radius-sm);
  transform: translateY(-250%);
}
.skip:focus-visible { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

[id] { scroll-margin-top: 5.5rem; }

/* ── nav · N5 floating pill ────────────────────────────────────────── */
.nav {
  position: sticky;
  top: var(--space-sm);
  z-index: var(--z-sticky);
  display: flex;
  justify-content: center;
  padding-inline: var(--gutter);
}

.nav__pill {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  max-width: 100%;
  padding: 0.375rem 0.375rem 0.375rem 0.5rem;
  border: var(--rule-w) solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: var(--color-paper-veil);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-2xs);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: block;
  flex: none;
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__cn {
  font-size: var(--text-xs);
  color: var(--color-neutral);
  letter-spacing: 0.06em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1.25rem);
}

.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: var(--space-2xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: var(--space-2xs);
  right: var(--space-2xs);
  bottom: 0.5rem;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-short) var(--ease-out);
}
.nav__links a:hover { color: var(--color-ink); }
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 46px;
  padding: 0.75rem 1.5rem;
  border: var(--rule-w) solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;                 /* clickable text never wraps — gate 49 */
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out),
              color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out),
              transform var(--dur-instant) var(--ease-out);
}
.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
}
.btn--primary:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.btn--primary:active { transform: translateY(1px); }
.btn--primary[disabled] {
  background: var(--color-paper-3);
  color: var(--color-neutral);
  cursor: not-allowed;
}
.btn--sm {
  min-height: 36px;
  padding: 0.5rem 1.125rem;
  font-size: var(--text-xs);
}

/* typographic link — no box, accent underline on interaction */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px;
  color: var(--color-ink);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-decoration-color: var(--color-rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  white-space: nowrap;
  transition: text-decoration-color var(--dur-short) var(--ease-out);
}
.tlink:hover { text-decoration-color: var(--color-accent); }
.tlink__arrow { transition: transform var(--dur-short) var(--ease-out); }
.tlink:hover .tlink__arrow { transform: translateX(3px); }

/* ── sections ──────────────────────────────────────────────────────── */
.sec { border-top: var(--rule-w) solid var(--color-rule-soft); }

.sec__title {
  margin: 0 0 var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-style: normal;                  /* headers are always roman */
  line-height: 1.25;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* one-line explanation that sits between a section title and its content */
.sec__lede {
  margin: calc(-1 * var(--space-sm)) 0 var(--space-lg);
  max-width: var(--measure-wide);
  color: var(--color-muted);
}

/* ── hero · H2 split diptych ───────────────────────────────────────── */
.sec--hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem);
  border-top: 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero__title {
  margin: 0 0 var(--space-md);
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  font-style: normal;
  line-height: 1.16;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
}
.hero__title span { display: block; }
.hero__title span + span { color: var(--color-muted); }

.hero__lede {
  margin: 0 0 var(--space-lg);
  max-width: var(--measure-tight);
  color: var(--color-muted);
  font-size: var(--text-lg);
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
}

.hero__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.hero__mark {
  width: clamp(9rem, 22vw, 13.5rem);
  aspect-ratio: 1;
  padding: var(--space-xs);
  border: var(--rule-w) solid var(--color-rule);
  border-radius: var(--radius-md);
  background: var(--color-paper-2);
}
.hero__mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-md) - 5px);
}
.hero__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3xs);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-neutral);
  text-align: center;
}

/* No entrance animation on the hero — deliberate.
   A load-time fade depends on the animation clock ticking; in static renderers,
   headless screenshotters, print, and social-preview services it never ticks, and
   `fill-mode: both` then leaves the entire first screen invisible. The motion budget
   goes to state feedback the user actually drives (link underline, disclosure). */

/* ── brand ─────────────────────────────────────────────────────────── */
.sec--brand { padding-block: clamp(3.5rem, 8vw, 6rem); }

.brand__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.prose p {
  margin: 0 0 var(--space-md);
  max-width: var(--measure-body);
  color: var(--color-muted);
}
.prose p:last-child { margin-bottom: 0; }

.statement {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-statement);
  font-weight: 500;
  font-style: normal;
  line-height: 1.5;
  max-width: 22em;
}
.statement::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: var(--space-md);
  background: var(--color-accent);
}

.trace {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding-top: var(--space-lg);
  border-top: var(--rule-w) solid var(--color-rule);
}
.trace__diagram { display: block; width: 100%; height: auto; }

/* narrow-screen replacement — the SVG's labels shrink below a readable size */
.trace__flow {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trace__caption {
  margin: var(--space-sm) 0 0;
  font-size: var(--text-sm);
  color: var(--color-neutral);
  max-width: var(--measure-wide);
}

.t-rail   { stroke: var(--color-rule); stroke-width: 1; }
.t-node   { fill: var(--color-paper); stroke: var(--color-rule); stroke-width: 1; }
.t-node--on { fill: var(--color-accent); stroke: var(--color-accent); }
.t-arrow  { fill: var(--color-accent); }
.t-label  {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  fill: var(--color-neutral);
}

/* ── capability · F3 tabular spec sheet ────────────────────────────── */
.sec--cap { padding-block: clamp(3rem, 7vw, 5rem); }

.spec {
  margin: 0;
  border-top: var(--rule-w) solid var(--color-rule);
}
.spec__row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-lg);
  align-items: baseline;
  padding-block: var(--space-md);
  border-bottom: var(--rule-w) solid var(--color-rule-soft);
}
.spec__row dt {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  font-style: normal;
  line-height: 1.5;
}
.spec__row dd {
  margin: 0;
  max-width: var(--measure-body);
  color: var(--color-muted);
}

/* ── start · F4 step sequence ──────────────────────────────────────── */
.sec--start { padding-block: clamp(4rem, 9vw, 6.5rem); }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps__item {
  position: relative;
  padding: 0 0 var(--space-lg) var(--space-xl);
}
.steps__item:last-child { padding-bottom: 0; }
.steps__item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.75rem;
  bottom: 0;
  width: var(--rule-w);
  background: var(--color-rule-soft);
}
.steps__item:last-child::before { bottom: auto; height: 1rem; }
.steps__item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
}
.steps__num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--color-neutral);
  margin-bottom: var(--space-3xs);
}
.steps__item h3 {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  font-style: normal;
  line-height: 1.4;
}
.steps__item p {
  margin: 0;
  max-width: var(--measure-body);
  color: var(--color-muted);
}

/* ── download · hairline platform ledger ───────────────────────────── */
.sec--dl { padding-block: clamp(3rem, 6vw, 4.5rem); }

.plat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--rule-w);
  background: var(--color-rule-soft);
  border: var(--rule-w) solid var(--color-rule-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.plat__cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 8.5rem;
  padding: var(--space-md);
  background: var(--color-paper-2);
  color: var(--color-ink);
  text-decoration: none;
  transition: background-color var(--dur-short) var(--ease-out);
}
.plat__cell:hover { background: var(--color-paper-3); }
.plat__cell.is-pending { pointer-events: none; }
.plat__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.chip {
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border: var(--rule-w) solid var(--color-rule);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  color: var(--color-neutral);
}

.note {
  margin: var(--space-md) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--color-neutral);
  max-width: var(--measure-wide);
}

/* ── faq · disclosure list ─────────────────────────────────────────── */
.sec--faq { padding-block: clamp(3.5rem, 8vw, 6rem); }

.faq { border-top: var(--rule-w) solid var(--color-rule); }
.faq__item { border-bottom: var(--rule-w) solid var(--color-rule-soft); }
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  font-style: normal;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.5px solid var(--color-accent);
  border-bottom: 1.5px solid var(--color-accent);
  transform: rotate(45deg);
  transition: transform var(--dur-short) var(--ease-out);
}
.faq__item[open] .faq__q::after { transform: rotate(-135deg); }
.faq__a {
  margin: 0 0 var(--space-md);
  max-width: var(--measure-wide);
  color: var(--color-muted);
}

/* ── compliance ────────────────────────────────────────────────────── */
.sec--legal { padding-block: clamp(2.5rem, 5vw, 4rem); }
.sec--legal .prose p { font-size: var(--text-sm); }

/* ── footer · Ft5 statement ────────────────────────────────────────── */
.foot {
  padding-block: clamp(3.5rem, 8vw, 6rem) var(--space-xl);
  border-top: var(--rule-w) solid var(--color-rule);
}
.foot__statement {
  margin: 0 0 var(--space-2xl);
  max-width: 22em;
  font-family: var(--font-display);
  font-size: var(--text-footer);
  font-weight: 700;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
}
.foot__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--rule-w) solid var(--color-rule-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-neutral);
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-short) var(--ease-out),
              border-color var(--dur-short) var(--ease-out);
}
.foot__links a:hover {
  color: var(--color-ink);
  border-bottom-color: var(--color-accent);
}

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 60rem) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .hero__figure { align-items: flex-start; }
  .hero__mark { width: clamp(7rem, 26vw, 10rem); }
  .hero__caption { align-items: flex-start; text-align: left; }

  .brand__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .statement { max-width: 26em; }

  .spec__row { grid-template-columns: minmax(0, 1fr); gap: var(--space-3xs); }

  .plat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plat__cell { min-height: 7rem; }

  .foot__meta { justify-content: flex-start; }
}

@media (max-width: 48rem) {
  .trace__diagram { display: none; }
  .trace__flow {
    display: grid;
    gap: var(--space-md);
  }
  .trace__flow li {
    position: relative;
    padding-left: var(--space-lg);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    line-height: 1.5;
    color: var(--color-muted);
    overflow-wrap: anywhere;
  }
  .trace__flow li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
  }
  .trace__flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 2.5px;
    top: 1.5em;
    bottom: calc(0.45em - var(--space-md));
    width: var(--rule-w);
    background: var(--color-rule);
  }
}

@media (max-width: 40rem) {
  .nav__links { display: none; }
  .btn--sm { min-height: 44px; padding-inline: 1rem; }

  .hero__title { line-height: 1.22; }
  .plat { grid-template-columns: minmax(0, 1fr); }
  .steps__item { padding-left: var(--space-lg); }
  .steps__item::before { left: 2px; }
  .steps__item::after { width: 6px; height: 6px; }

  .faq__q { font-size: var(--text-md); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav__links a::after,
  .tlink__arrow,
  .faq__q::after,
  .btn,
  .plat__cell,
  .foot__links a { transition-duration: 1ms; }
  .tlink:hover .tlink__arrow { transform: none; }
}
