/*
 * chrome.css - the shared site chrome injected by framework/shell.js:
 * floating controls (menu, home, presentation, theme), the nav drawer, the
 * scrim, the footer and the presentation-mode hint. Loaded by every page,
 * after framework.css. Colours come only from theme.css tokens.
 *
 * Every inline SVG this file targets has an explicit size here, and
 * framework/icons.js also stamps width/height attributes, so no icon can
 * grow to fill its container.
 */
/* ---------------- Floating controls ----------------
 * 40px rounded dark-glass buttons with a white icon: readable on the dark
 * hero and still legible over light page content (the no-JS default). With
 * JS, the light theme swaps to light glass once scrolled past the hero. */
.fab-row { position: fixed; z-index: 120; display: flex; gap: 8px; }
/* Two-class guard: a page class of the same name (a .tl timeline) must never pad or move the corner rows. */
.fab-row.tl, .fab-row.tr { margin: 0; padding: 0; }
.fab-row.tl { top: 16px; left: 16px; }
.fab-row.tr { top: 16px; right: 16px; }
.fab {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border-radius: 12px; border: 1px solid var(--fab-border);
  background: var(--fab-bg); color: var(--fab-icon); cursor: pointer;
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 4px 14px var(--fab-shadow);
  transition: background .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.fab:hover { transform: translateY(-1px); background: var(--fab-bg-hover); color: var(--fab-icon); }
/* Past the dark hero, in the light theme, the dark glass reads as heavy grey
 * blocks on the light page, so the fabs switch to light glass. The class is
 * set by an IntersectionObserver on the hero (framework/shell.js); without
 * JS, or over the hero, or in the dark theme, the dark glass above stays. */
html.fabs-past-hero body:not(.theme-dark) .fab-row .fab {
  background: var(--fab-light-bg); color: var(--fab-light-icon);
  border-color: var(--fab-light-border); box-shadow: 0 2px 10px var(--fab-light-shadow);
}
html.fabs-past-hero body:not(.theme-dark) .fab-row .fab:hover { background: var(--fab-light-bg-hover); color: var(--fab-light-icon); }
.fab:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.fab svg { width: 19px; height: 19px; display: block; flex: none; }
.fab > span { display: inline-grid; place-items: center; }
/* Theme toggle shows a moon in light mode (go dark) and a sun in dark mode. */
.fab .fab__sun { display: none; }
.theme-dark .fab .fab__sun { display: inline-grid; }
.theme-dark .fab .fab__moon { display: none; }
@media (max-width: 640px) {
  .fab-row.tl { top: 12px; left: 12px; }
  .fab-row.tr { top: 12px; right: 12px; }
  .fab { width: 38px; height: 38px; }
}
/* ---------------- Nav drawer ----------------
 * Compact slide-out panel: 300px wide, 40px rows, 14px single-line labels,
 * a small number badge, an 18px icon and a clear active state (tinted row,
 * red left rule, filled badge). */
.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw);
  background: var(--color-surface); color: var(--color-text);
  border-right: 1px solid var(--color-border);
  z-index: 200; transform: translateX(-100%); visibility: hidden;
  transition: transform .28s var(--ease), visibility 0s linear .28s;
  display: flex; flex-direction: column; box-shadow: 4px 0 28px var(--color-shadow-strong);
  overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--font-body); line-height: 1.3; padding-bottom: 16px;
}
.nav-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform .28s var(--ease), visibility 0s; }
.nav-drawer svg { width: 18px; height: 18px; flex: none; display: block; }
.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--color-border);
}
.nav-drawer__title { font-family: var(--font-heading); font-weight: 700; font-size: 14px; line-height: 1.25; }
.nav-drawer .fab {
  width: 32px; height: 32px; border-radius: 9px; box-shadow: none; flex: none;
  background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.nav-drawer .fab:hover { background: var(--color-border); color: var(--color-text); transform: none; }
.nav-drawer .fab svg { width: 16px; height: 16px; }
.nav-drawer__group { padding: 10px 0 2px; }
.nav-drawer__group-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--color-text-muted); padding: 6px 18px 6px; margin: 0; font-weight: 700;
}
.nav-drawer__link {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 15px;
  border-left: 3px solid transparent;
  color: var(--color-text); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.nav-drawer__link:hover { background: var(--color-surface-alt); color: var(--color-text); border-left-color: var(--color-border-strong); }
.nav-drawer__link:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -3px; border-radius: 0; }
.nav-drawer__idx {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  background: var(--color-surface-alt); color: var(--color-text-muted);
}
.nav-drawer__ico { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; color: var(--color-text-muted); }
.nav-drawer__label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-drawer__link[aria-current="page"] {
  background: var(--color-primary-soft); color: var(--color-text); font-weight: 700;
  border-left-color: var(--color-primary);
}
.nav-drawer__link[aria-current="page"] .nav-drawer__ico { color: var(--color-primary); }
.nav-drawer__link[aria-current="page"] .nav-drawer__idx { background: var(--tab-pill-active-bg); color: var(--tab-pill-active-text); }
.nav-scrim {
  position: fixed; inset: 0; background: var(--color-overlay); z-index: 190;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.nav-scrim.is-open { opacity: 1; visibility: visible; }
/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--color-footer-bg); color: var(--color-footer-text);
  padding: 30px 0; margin-top: 0; border-top: 1px solid var(--color-footer-rule);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.site-footer p { margin: 0; font-size: .9rem; color: var(--color-footer-text); }
.site-footer .foot-name { font-family: var(--font-heading); font-weight: 700; color: var(--hero-text); }
/* ---------------- Presentation mode chrome ---------------- */
body.present-mode .fab-row.tl, body.present-mode .nav-drawer, body.present-mode .nav-scrim { display: none; }
.present-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--color-footer-bg); color: var(--color-footer-text);
  font-family: var(--font-mono); font-size: 12px; padding: 7px 14px; border-radius: 999px;
  z-index: 130; opacity: .9;
}
