/* Composer Assistant — the public site (29 Sep 2026).
   ---------------------------------------------------------------------------
   Loaded AFTER tokens.css and main.css, by templates/site/_layout.html only, so
   nothing here can reach the checkout or the account pages.

   ⚠️ THE SAME DISCIPLINE AS main.css, CHECKED THE SAME WAY (scripts/test_site.py):
     · no raw colour — every colour is a token from tokens.css, so both themes
       work and the visitor's choice is respected;
     · no selector declared twice at column 0 (HWK-CA34);
     · no accent FILL used as text (--brass, --signal, --accent are fills; the
       text colours are --accent-text and friends).

   ⚠️ A NEUTRAL FIRST PASS, ON PURPOSE. The home page's layout and the site's
   look were held for Fede's and Marc's direction (coordinator, 29 Sep 08:52).
   This file styles the content pages with the app's existing system and gives
   the home page a clean, plain skeleton. The redesign lands here, not in the
   templates' plumbing.
   --------------------------------------------------------------------------- */

/* ── Header navigation (site pages only) ───────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: .92rem;
}

.site-nav__link {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav__link:hover { color: var(--text-primary); }

.site-nav__signin {
  color: var(--text-primary);
  text-decoration: none;
  padding: .38rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}

.site-nav__signin:hover { border-color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────────────────────── */

.site-footer__inner { flex-direction: column; gap: .5rem; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin-bottom: .75rem;
}

.site-footer__links a {
  color: var(--text-primary);
  text-decoration: none;
}

.site-footer__links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Content pages: manual, specs, changelog, legal ────────────────────────── */

.site-page__meta {
  color: var(--text-muted);
  font-size: .92rem;
  margin: 0 0 2rem;
}

.site-page__toc {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 0 0 2.5rem;
  background: var(--bg-panel);
}

.site-page__toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.2rem;
}

.site-page__toc a { text-decoration: none; color: var(--accent-text); }

/* Long-form text. Line length stays readable inside the wide page body. */
.prose {
  max-width: 44rem;
  font-size: 1.02rem;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--display);
  letter-spacing: -.015em;
  line-height: 1.25;
  scroll-margin-top: 1.5rem;
}

.prose h2 { font-size: 1.5rem; margin: 2.75rem 0 .75rem; }
.prose h3 { font-size: 1.2rem; margin: 2.25rem 0 .6rem; }
.prose h4 { font-size: 1.02rem; margin: 1.75rem 0 .5rem; }

.prose p,
.prose ul,
.prose ol { margin: 0 0 1.1rem; }

.prose li { margin-bottom: .35rem; }

.prose a { color: var(--accent-text); text-underline-offset: 3px; }

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.prose code {
  font-family: var(--data);
  font-size: .88em;
  background: var(--bg-panel);
  padding: .1em .35em;
  border-radius: 4px;
}

.prose pre {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

.prose pre code { background: none; padding: 0; }

.prose blockquote {
  margin: 1.5rem 0;
  padding: .25rem 0 .25rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* Tables scroll sideways on a phone rather than squashing their columns. */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .95rem;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose th { font-weight: 500; color: var(--text-primary); background: var(--bg-panel); }

.prose hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 2.5rem 0; }

/* ── The manual ────────────────────────────────────────────────────────────── */

.manual__toc {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  padding: 1.1rem 1.4rem;
  margin: 0 0 3rem;
}

.manual__toc ol { margin: 0; padding-left: 1.3rem; }
.manual__toc li { margin: .3rem 0; }
.manual__toc a { color: var(--text-primary); font-weight: 500; }

.manual__toc-summary {
  display: block;
  color: var(--text-muted);
  font-size: .9rem;
}

.chapter {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2.25rem;
  margin-top: 2.25rem;
  scroll-margin-top: 1rem;
}

.chapter__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -.025em;
  margin: 0 0 1rem;
}

.chapter__top { font-size: .88rem; margin-top: 2rem; }
.chapter__top a { color: var(--text-muted); }

/* ── Legal index ───────────────────────────────────────────────────────────── */

.legal-lead {
  border-left: 3px solid var(--accent);
  padding: .25rem 0 .25rem 1rem;
  margin: 0 0 2rem;
  max-width: 44rem;
}

.legal-lead a { color: var(--accent-text); font-weight: 500; white-space: nowrap; }

.legal-list { list-style: none; margin: 0; padding: 0; }

.legal-list__item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-list__link { font-weight: 500; font-size: 1.08rem; color: var(--text-primary); }
.legal-list__summary { color: var(--text-muted); }
.legal-list__meta { color: var(--text-muted); font-size: .88rem; }

/* ── Videos: a poster and a play button until someone presses it ──────────── */

.vid { margin: 0; }

.vid__play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-panel);
  aspect-ratio: 16 / 9;
  cursor: pointer;
}

.vid__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vid__icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.25rem;
  height: 3.25rem;
  margin: -1.625rem 0 0 -1.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
}

.vid__play:hover .vid__icon { filter: brightness(1.08); }

.vid__player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.vid__caption {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .6rem;
  margin-top: .6rem;
}

.vid__title { font-weight: 500; }

.vid__time {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: .85rem;
}

.vid__summary { width: 100%; color: var(--text-muted); font-size: .92rem; }

.vid-print { margin: 1.25rem 0; }

/* ── Animations (the manual's [[animation:…]] embed) ──────────────────────── */

.anim { margin: 1.5rem 0; }

.anim__video,
.anim img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
}

/* ── The home page has its OWN stylesheet: static/site/css/home.css ────────────
   ⚠️ Nothing home-specific lives here. The home page is built to be SWAPPED
   (Fede's redesign, later): its template and home.css go together, reading the
   same data, and nothing in this file or in the shared templates changes. */

/* ── Small screens ─────────────────────────────────────────────────────────── */

@media (max-width: 40rem) {
  /* ⚠️ The site's masthead carries a nav + Sign in on top of the wordmark and
     the theme toggle — wider than a 390px phone. Without the wrap it pushed
     every site page sideways (seen 29 Sep). Scoped to .site: the account and
     checkout pages keep the masthead they had. */
  .site .masthead__inner { flex-wrap: wrap; row-gap: .55rem; padding-inline: 1rem; }
  .site-nav { gap: .8rem; }
  .site-nav__link--wide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vid__play:hover .vid__icon { filter: none; }
}

/* ── Print (the web pages; the PDF's own rules are static/site/manual/print.css) ─ */

@media print {
  .masthead,
  .site-footer,
  .chapter__top { display: none; }
}
