/* ==========================================================================
   OpenMarkdown — shared chrome (nav + footer).
   GENERATED from site-chrome/chrome.css — do not edit site/assets/chrome.css.

   Two consumers: every site page (via `@import` at the top of site.css) and the
   public demo, which links this file alone. That second consumer is why every
   token here is read as `var(--x, <fallback>)` and why NOTHING is declared on
   `:root` (spec: site-chrome / chrome.css 不落 :root, enforced by
   `build-site-chrome.mjs --check`):

     - on the site, site.css's :root supplies every token, so the fallbacks are
       never used and this file provably cannot change how a page looks;
     - in the demo this file lands on a page that is the app, whose own theme
       owns :root. A token block here would fight it. The fallbacks carry the
       values instead, scoped to the chrome's own subtree.

   The fonts live here rather than in site.css so the demo gets them with the
   same one <link>; their url()s are relative to THIS file, which sits beside
   site.css in assets/, so they resolve identically for both consumers.
   ========================================================================== */

/* —— self-hosted brand fonts (relative paths, file://-safe) ——————————— */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/space-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Space Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/space-mono-700.woff2") format("woff2"); }

/* —— the content column: ONE width for the whole site ———————————————
   The single definition (spec: site-chrome / 全站一个内容栏宽). Registered
   rather than declared, because this file may not touch :root (see above):
   @property gives every element an initial --site-col without a cascade value
   that could fight a host page's tokens. The syntax is "*" on purpose: a typed
   "<length>" registration rejects a rem initial-value (not computationally
   independent) and the WHOLE rule silently drops, leaving every column
   unbounded. site.css and the editor site's
   site.css derive their --col from it, the nav and footer read it directly;
   `build-site-chrome.mjs` fails if either sheet hardcodes a --col again. */
@property --site-col { syntax: "*"; inherits: true; initial-value: 64rem; }

/* —— nav ————————————————————————————————————————————————————— */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h, 3.75rem);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.2s ease;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg, #FBFAF7) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom-color: var(--line-soft, rgba(23, 23, 26, 0.08));
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 1rem; }
.nav .brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.nav .brand img { height: 1.4rem; width: auto; display: block; }
.nav .links { display: flex; align-items: center; gap: 1.75rem; }
.nav .links a { font-family: var(--mono, "Space Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace); font-size: 0.8125rem; text-decoration: none; color: var(--signal, #9A9A9A); transition: color 0.15s ease; }
.nav .links a:hover { color: var(--fg, #17171A); }
.nav .links .btn { padding: 0.5rem 1rem; font-size: 0.8125rem; font-family: var(--sans, "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif); color: var(--bg, #FBFAF7); }
@media (max-width: 52rem) { .nav .links a:not(.btn), .nav .links .pending { display: none; } }
/* A launch-gated target (spec: editor-site): reads as a link-shaped label but is
   not one, so it never takes the hover colour or a pointer. */
.nav .links .pending { font-family: var(--mono, "Space Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace); font-size: 0.8125rem; color: var(--signal, #9A9A9A); opacity: 0.7; cursor: default; }

/* —— product toggle (spec: site-chrome / 导航栏的产品切换开关) ——————————
   Two plain links drawn as one pill, right after the brand: the current
   product's segment filled, the other an ordinary link. No script. The pair of
   colours is local to the toggle so each ground sets it once: paper (default),
   ink (reversed nav, below) and the docs' own scheme (docs.css). */
.nav .brand-row { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.nav .product-toggle {
  --pt-fg: var(--fg, #17171A); --pt-bg: var(--bg, #FBFAF7);
  display: inline-flex; flex: none; padding: 2px; gap: 2px;
  border: 1px solid color-mix(in srgb, var(--pt-fg) 22%, transparent); border-radius: 999px;
}
.nav .product-toggle a {
  padding: 0.22rem 0.7rem; border-radius: 999px;
  font-family: var(--mono, "Space Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.75rem; line-height: 1.3; text-decoration: none;
  color: color-mix(in srgb, var(--pt-fg) 62%, transparent);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav .product-toggle a:hover { color: var(--pt-fg); background: color-mix(in srgb, var(--pt-fg) 8%, transparent); }
.nav .product-toggle a[aria-current] { background: var(--pt-fg); color: var(--pt-bg); }
.nav .product-toggle a:focus-visible { outline: 2px solid #4a7fd6; outline-offset: 2px; }
/* Phone width: the toggle is the only way across in the nav, so it stays and
   shrinks; the wordmark yields first (still read out — the toggle names the
   product on screen). */
@media (max-width: 52rem) {
  .nav .brand-row { gap: 0.6rem; }
  .nav .product-toggle a { padding: 0.18rem 0.55rem; font-size: 0.6875rem; }
}
@media (max-width: 30rem) {
  .nav .brand .brand-name {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* ground-aware nav (design D11): reversed whenever the ground under the nav's
   bottom edge is ink — at the top over the hero (static .over-hero, the no-JS
   state) or wherever JS toggles .on-ink (hero + §5 band). */
.nav .brand .mark-rev { display: none; }
.nav .brand .mark-pri { display: block; }
.nav.over-hero:not(.scrolled) .brand .mark-pri,
.nav.on-ink .brand .mark-pri { display: none; }
.nav.over-hero:not(.scrolled) .brand .mark-rev,
.nav.on-ink .brand .mark-rev { display: block; }
.nav.over-hero:not(.scrolled),
.nav.on-ink { color: #F4F0E6; }
.nav.over-hero:not(.scrolled) .brand,
.nav.on-ink .brand { color: #F4F0E6; }
.nav.over-hero:not(.scrolled) .links a,
.nav.on-ink .links a { color: rgba(244, 240, 230, 0.72); }
.nav.over-hero:not(.scrolled) .links .pending,
.nav.on-ink .links .pending { color: rgba(244, 240, 230, 0.72); }
.nav.over-hero:not(.scrolled) .links a:hover,
.nav.on-ink .links a:hover { color: #F4F0E6; }
.nav.over-hero:not(.scrolled) .links .btn,
.nav.on-ink .links .btn { background: #F4F0E6; color: #17171A; border-color: #F4F0E6; }
.nav.over-hero:not(.scrolled) .product-toggle,
.nav.on-ink .product-toggle { --pt-fg: #F4F0E6; --pt-bg: #17171A; }
/* scrolled over ink: frosted ink glass instead of frosted paper */
.nav.scrolled.on-ink {
  background: color-mix(in srgb, var(--ink, #17171A) 82%, transparent);
  border-bottom-color: rgba(244, 240, 230, 0.14);
}


/* —— what the chrome markup borrows from the page ————————————————————
   `.wrap` and `.btn` are page-wide utilities that stay in site.css; these
   NAV-QUALIFIED copies exist so the nav renders standalone where site.css is
   absent (the demo). Same declarations, higher specificity — on the site they
   resolve to the same pixels, so this file can never change how a page looks.
   Keep them in step with site.css's `.wrap` / `.btn` if those ever change. */
.nav .wrap { max-width: var(--site-col); margin: 0 auto; padding: 0 1.5rem; }
.nav .btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--fg, #17171A); color: var(--bg, #FBFAF7);
  text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.2;
  border: 1px solid var(--fg, #17171A); border-radius: 0.5rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.nav .btn:hover { opacity: 0.88; }
.nav .btn:active { transform: translateY(1px); }

/* —— footer — the ink baseline (its own seam marks the crossing) —————— */
/* The hazard seam. It lives here, not in site.css, because the footer markup
   carries one and the footer has a consumer without site.css (the docs). The
   page sections reuse the same class; site.css only positions it. */
.seam {
  height: 0.75rem; flex: none; /* keeps its height inside the pinned flex stage */
  background: repeating-linear-gradient(-45deg, var(--ink, #17171A) 0 0.5rem, var(--paper, #FBFAF7) 0.5rem 1rem);
}
/* NAV-QUALIFIED .wrap's twin, for the same reason (see above). The footer is
   addressed by class, never as a bare `footer`: the docs have footers of their
   own (page navigation) that must not turn into an ink band. */
.site-footer .wrap { max-width: var(--site-col); margin: 0 auto; padding: 0 1.5rem; }

/* The ink footer (spec: site-chrome / footer 的结构): a brand block and four
   link columns, one link per line, then a thin rule over the copyright and the
   (launch-held) legal links. Headings are told apart by colour, not size.
   Colours on ink #17171A, all checked ≥ 4.5:1 — links #F4F0E6 15.7:1, tagline
   and the brand block's GitHub #A8A396 7.1:1, headings and the bottom bar
   #8A8579 4.9:1. Literal values rather than tokens: the footer is ink on every
   page and every consumer, whatever the page's own ground. */
.site-footer {
  background: var(--ink, #17171A);
  --fg: #F4F0E6; --bg: var(--ink, #17171A); --line: rgba(244,240,230,0.22);
  padding: 5.5rem 0 2.5rem;
  font-family: var(--sans, "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif);
  font-size: 0.9375rem; line-height: 1.4; color: #F4F0E6;
}
.site-footer a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
.site-footer a:hover { color: #FFFFFF; }
.site-footer a:focus-visible { outline: 2px solid #4a7fd6; outline-offset: 2px; border-radius: 2px; }
/* The last column is as wide as the address it carries, so the address never
   spills past the column edge; the other four share what is left. */
.site-footer .foot-main { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr max-content; gap: 2.5rem; }
.site-footer .foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1.125rem; }
.site-footer .foot-mark { display: flex; align-items: center; gap: 0.75rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.site-footer .foot-mark img { height: 1.375rem; width: auto; display: block; }
.site-footer .foot-tag { margin: 0; max-width: 16.25rem; font-size: 1rem; line-height: 1.5; color: #A8A396; }
.site-footer .foot-gh { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.875rem; color: #A8A396; }
.site-footer .foot-gh:hover { color: #F4F0E6; }
.site-footer .foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.875rem; }
.site-footer .foot-head { margin-bottom: 0.25rem; font-size: 0.875rem; color: #8A8579; }
.site-footer .foot-short { display: none; }
.site-footer .foot-base {
  margin-top: 5rem; padding-top: 1.375rem; border-top: 1px solid rgba(244, 240, 230, 0.14);
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; flex-wrap: wrap;
  font-family: var(--mono, "Space Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.8125rem; color: #8A8579;
}
.site-footer .foot-legal { display: flex; gap: 1.75rem; }
.site-footer .foot-legal a:hover { color: #F4F0E6; }
/* Narrower than the full column: the brand block takes its own row, the four
   link columns share the next. */
@media (max-width: 64rem) {
  .site-footer .foot-main { grid-template-columns: 1fr 1fr 1fr max-content; }
  .site-footer .foot-brand { grid-column: 1 / -1; }
}
/* Phone: two columns by two rows; short labels for the address and the legal
   links; legal above the copyright at the very bottom. */
@media (max-width: 45rem) {
  .site-footer { padding: 4rem 0 2rem; font-size: 1rem; }
  .site-footer .foot-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
  .site-footer .foot-brand { gap: 0.875rem; margin-bottom: 0.5rem; }
  .site-footer .foot-mark { font-size: 1.375rem; gap: 0.625rem; }
  .site-footer .foot-mark img { height: 1.25rem; }
  .site-footer .foot-tag { max-width: none; font-size: 0.9375rem; }
  .site-footer .foot-gh { display: none; } /* GitHub stays one tap away under Resources */
  .site-footer .foot-long { display: none; }
  .site-footer .foot-short { display: inline; }
  .site-footer .foot-base { margin-top: 3rem; padding-top: 1.25rem; flex-direction: column; align-items: flex-start; }
  .site-footer .foot-legal { order: -1; gap: 1.5rem; }
}

/* First-load lift for a page's hero (the app home and the editor home): each
   .rise element floats up and fades in once; .rise-N staggers them. Lives here,
   not in a page stylesheet, because chrome.css is the one file both products'
   pages load — so both heroes move the same way from one definition. */
@keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.7s cubic-bezier(0.2,0.7,0.2,1) both; }
.rise-2 { animation-delay: 0.07s; } .rise-3 { animation-delay: 0.14s; }
.rise-4 { animation-delay: 0.22s; } .rise-5 { animation-delay: 0.30s; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }
