/* FCMS Pro website - page-level layout. Uses tokens.css / components.css only. */

/* ============ Shared section head ============ */
.section-head { max-width: 680px; margin: 0 auto var(--sp-7); text-align: center; }
.section-head p { margin-top: var(--sp-4); color: var(--text-muted); font-size: var(--fs-lg); }
.section-head .eyebrow { display: block; margin-bottom: var(--sp-3); }
.section--alt { background: var(--surface-1); border-block: 1px solid var(--border); }

/* ============ Home: hero ============ */
.hero { position: relative; isolation: isolate; padding-block: clamp(var(--sp-7), 7vw, var(--sp-9)) var(--sp-8); text-align: center; overflow: clip; }
/* CSS-only gradient mesh. Two static radial gradients: no blur filters, no
   animation, nothing that costs paint time. */
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
  background:
    radial-gradient(40% 45% at 25% 20%, var(--mesh-a), transparent 70%),
    radial-gradient(35% 40% at 78% 12%, var(--mesh-b), transparent 70%);
}
.hero h1 { max-width: 16ch; margin-inline: auto; }
.hero__sub { max-width: 56ch; margin: var(--sp-5) auto 0; font-size: var(--fs-lg); color: var(--text-muted); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-6); }
.hero__cta > div { text-align: center; }
.hero .trust-strip { margin-top: var(--sp-6); }
.hero__visual { position: relative; max-width: 1040px; margin: var(--sp-8) auto 0; text-align: left; }
.hero__visual .window { aspect-ratio: 16 / 10; } /* reserves space: CLS stays ~0 */
.platform-note { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); }

/* ============ Video showcase ============ */
.video-showcase { max-width: 980px; margin-inline: auto; }
.window--video { box-shadow: var(--shadow-3); overflow: hidden; border-radius: var(--radius-lg); }
.video-frame-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #06090e; }
.video-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.video-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
}
.video-meta__creator { display: flex; align-items: center; gap: var(--sp-3); }
.video-meta__avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent); background: var(--surface-2); flex-shrink: 0;
}
.video-meta__title { display: block; font-weight: 700; font-size: var(--fs-md); color: var(--text); line-height: 1.25; }
.video-meta__sub { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.video-meta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }

/* ============ Product showcase ============ */
.showcase { display: grid; justify-items: center; }
.showcase .window { position: relative; width: 100%; max-width: 980px; aspect-ratio: 16 / 10; }
.showcase__caption { margin-top: var(--sp-4); max-width: 60ch; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ============ Local-first comparison ============ */
.compare { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.compare .card--us { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.compare h3 { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.compare ul { margin: 0; padding: 0; list-style: none; }
.compare li { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.compare li:first-child { border-top: 0; }
.compare li svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.compare .yes svg { color: var(--success); }
.compare .no svg { color: var(--text-muted); }

/* ============ How it works ============ */
.steps { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); counter-reset: step; }
.step { counter-increment: step; position: relative; padding-top: var(--sp-6); }
.step::before {
  content: counter(step); position: absolute; top: 0; left: var(--sp-5); transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; font-family: var(--font-mono); font-weight: 700;
  color: var(--on-accent); background: var(--accent); border-radius: 50%;
}
.step ol { margin: var(--sp-3) 0 0; padding-left: 1.2rem; color: var(--text-muted); font-size: var(--fs-sm); }

/* ============ Keyboard-first ============ */
.shortcuts { display: grid; gap: 0 var(--sp-7); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); max-width: 880px; margin-inline: auto; }

/* ============ Releases + security (two-up) ============ */
.split { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }

/* ============ Support / final CTA ============ */
.cta-band { padding: clamp(var(--sp-6), 6vw, var(--sp-8)); text-align: center; background: var(--surface-1); border: 1px solid var(--border); border-radius: calc(var(--radius-lg) + 4px); box-shadow: var(--shadow-2); }
.cta-band p { max-width: 52ch; margin: var(--sp-4) auto var(--sp-5); color: var(--text-muted); }

/* ============ Download page ============ */
.page-head { padding-block: var(--sp-8) var(--sp-6); text-align: center; }
.page-head p { max-width: 60ch; margin: var(--sp-4) auto 0; color: var(--text-muted); font-size: var(--fs-lg); }
.os-tabs { display: grid; justify-items: center; }
.os-tabs [role="tablist"] { justify-self: center; }
.dl-card { width: min(100%, 760px); margin-inline: auto; display: grid; gap: var(--sp-5); }
.dl-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.dl-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); color: var(--text-muted); font-size: var(--fs-sm); }
.dl-card dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-5); margin: 0; font-size: var(--fs-sm); }
.dl-card dt { color: var(--text-muted); }
.dl-card dd { margin: 0; }
.dl-card ol { margin: 0; padding-left: 1.2rem; font-size: var(--fs-sm); }
.dl-card li + li { margin-top: var(--sp-2); }
.dl-unavailable { text-align: center; }
.dl-note { margin-top: var(--sp-5); text-align: center; }
.link-row--spaced { margin-top: var(--sp-5); }
.history { margin-top: var(--sp-8); }
.history h2 { margin-bottom: var(--sp-5); font-size: var(--fs-xl); }

/* ============ Changelog ============ */
.cl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.cl-controls .chip {
  min-height: 40px; padding: 0.4rem 0.95rem; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
}
.cl-controls .chip[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.cl-list { display: grid; gap: var(--sp-6); max-width: 820px; margin-inline: auto; }
.cl-version { padding-bottom: var(--sp-6); border-bottom: 1px solid var(--border); }
.cl-version__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.cl-version__head h2 { font-family: var(--font-mono); font-size: var(--fs-xl); }
.cl-version__head time { color: var(--text-muted); font-size: var(--fs-sm); }
.cl-version__head .copy-btn { position: static; margin-left: auto; }
.cl-group { margin-top: var(--sp-4); }
.cl-group ul { margin: var(--sp-2) 0 0; padding-left: 1.2rem; }
.cl-group li + li { margin-top: var(--sp-2); }
.cl-version[hidden], .cl-group[hidden] { display: none; }

/* ============ Docs ============ */
.docs-layout { display: grid; gap: var(--sp-7); grid-template-columns: 1fr; padding-block: var(--sp-6) var(--sp-9); }
@media (min-width: 960px) { .docs-layout { grid-template-columns: 260px minmax(0, 1fr); } }
.docs-side { align-self: start; }
@media (min-width: 960px) {
  .docs-side { position: sticky; top: calc(var(--header-h) + var(--sp-4)); max-height: calc(100vh - var(--header-h) - var(--sp-6)); overflow-y: auto; }
}
.docs-search { width: 100%; min-height: 44px; padding: 0.6rem 0.9rem; margin-bottom: var(--sp-4); background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.docs-results { margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.docs-results a { display: block; padding: 0.5rem 0.75rem; font-size: var(--fs-sm); text-decoration: none; color: var(--text); border-radius: var(--radius-sm); }
.docs-results a:hover { background: var(--surface-2); }
.toc { margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.toc a { display: block; padding: 0.4rem 0.75rem; color: var(--text-muted); text-decoration: none; border-left: 2px solid var(--border); }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--accent-text); border-left-color: var(--accent); font-weight: 600; }
.toc .toc--sub a { padding-left: 1.5rem; }
.toc .toc-l3 a { padding-left: 1.5rem; }
.docs-search[hidden], .docs-results[hidden] { display: none; }
.docs-results .docs-none { padding: 0.5rem 0.75rem; font-size: var(--fs-sm); color: var(--text-muted); }
.docs-results small { display: block; color: var(--text-muted); }
.prose h1 { font-size: var(--fs-2xl, 2rem); }
.prose .anchor { margin-left: 0.4rem; font-size: 0.8em; color: var(--text-muted); text-decoration: none; opacity: 0; }
.prose :is(h2, h3):hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose { max-width: 74ch; }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { margin-top: var(--sp-8); font-size: var(--fs-xl); }
.prose h3 { margin-top: var(--sp-6); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: var(--sp-2); }
.prose table { font-size: var(--fs-sm); }
.prose .table-wrap { margin-block: var(--sp-5); }
.doc-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.pager { display: grid; gap: var(--sp-4); grid-template-columns: 1fr 1fr; margin-top: var(--sp-6); }
.pager a { display: block; padding: var(--sp-4); text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--text-muted); }
.pager .next { text-align: right; }

/* ============ 404 ============ */
.nf { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: var(--sp-5); padding-block: var(--sp-9); text-align: center; }
.nf__code { font-family: var(--font-mono); font-size: clamp(4rem, 15vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: -0.05em; color: var(--accent-text); }
.nf__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }

/* ============ Small screens: nothing may scroll sideways at 320px ============ */
@media (max-width: 480px) {
  .dl-card dl { grid-template-columns: 1fr; gap: 0; }
  .dl-card dd { margin-bottom: var(--sp-3); }
  .pager { grid-template-columns: 1fr; }
  .hero__cta .btn { width: 100%; }
  .hero__cta > div { width: 100%; }
}

/* ============ Changelog: class names emitted by build-site.py ============ */
.cl-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.cl-head h2 { font-size: var(--fs-xl); }
.cl-head h2 a { color: inherit; text-decoration: none; }
.cl-head h2 a:hover { color: var(--accent-text); }
.cl-head time { color: var(--text-muted); font-size: var(--fs-sm); }
.cl-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-left: auto; font-size: var(--fs-sm); }
.btn-link { min-height: 0; padding: 0; font: inherit; color: var(--accent-text); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.cl-group h3 { font-size: var(--fs-md); }
.cl-version:target { scroll-margin-top: 5rem; }
.badge-latest, .badge-added   { color: var(--success); background: var(--success-soft); }
.badge-changed                { color: var(--warning); background: var(--warning-soft); }
.badge-fixed                  { color: var(--accent-text); background: var(--accent-soft); }
.badge-removed                { color: var(--danger); background: var(--danger-soft); }
.badge-other                  { color: var(--text-muted); background: var(--surface-3); }
.cl-controls[hidden], .cl-empty[hidden] { display: none; }
.cl-empty { text-align: center; color: var(--text-muted); }
