/* Super Studio (v3 layout 17 Nov 2026; v4 brand 18 Nov 2026): the CHROME (header, footer, skip link) and the shared colour tokens.
   Studio pages get it inside /site.css; the legacy pages (/curiosity-kills/..., /tread-and-thunder/) load it as /chrome.css on top
   of their own stylesheet, so every rule here names its own classes (st-*) and sets everything the legacy stylesheets would
   otherwise change. Light by default, dark when the system asks for it; data-theme="dark" on an element forces the dark tokens.
   No scripts and no inline styles anywhere (the CSP forbids them). System fonts only: nothing to download.
   v4 palette (tools/make_logo_v4.py): RED #d0262d, DEEP #8f161b, TAN #e8d3aa, TAN_DIM #bfae8c, INK #16110f, INK_2 #1f1916,
   CREAM #fbf6ec. NO BLUE anywhere (tools/check_no_blue.py). Text contrast (WCAG AA, 4.5:1), worst case on --st-bg-2:
   light: text 15.96, muted 5.99, link (deep red) 7.79; dark: text 15.06, muted 7.35, link (tan) 11.85.
   The red accent is for graphics only (3:1): 4.48 on the light --st-bg-2, 3.31 on the dark --st-bg-2.
   Cream on red (the primary button): 4.88. */
:root {
  --st-bg: #fbf6ec; --st-bg-2: #f4ecde; --st-card: #fffcf6; --st-text: #16110f; --st-muted: #62574d; --st-line: #e4d9c6;
  --st-accent: #d0262d; --st-accent-deep: #8f161b; --st-on-accent: #fbf6ec; --st-link: #8f161b; --st-focus: #8f161b;
  --st-wordmark: #8f161b;
  --st-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --st-wrap: 1120px; --st-gutter: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --st-bg: #16110f; --st-bg-2: #1f1916; --st-card: #1f1916; --st-text: #f5eee2; --st-muted: #b3a796; --st-line: #382e28;
    --st-link: #e8d3aa; --st-focus: #e8d3aa; --st-wordmark: #e8d3aa;
  }
}
[data-theme="dark"] {
  --st-bg: #16110f; --st-bg-2: #1f1916; --st-card: #1f1916; --st-text: #f5eee2; --st-muted: #b3a796; --st-line: #382e28;
  --st-link: #e8d3aa; --st-focus: #e8d3aa; --st-wordmark: #e8d3aa;
}

.st-wrap { max-width: var(--st-wrap); margin: 0 auto; padding-inline: var(--st-gutter); box-sizing: border-box; }
.st-skip { position: absolute; left: -999px; top: 8px; z-index: 60; background: var(--st-text); color: var(--st-bg); padding: 8px 12px;
  font: 600 16px/1.2 var(--st-font); border-radius: 6px; }
.st-skip:focus { left: 8px; }

/* Header */
header.nav.st-head { position: sticky; top: 0; z-index: 30; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--st-line);
  background: var(--st-bg); color: var(--st-text); font: 400 16px/1.4 var(--st-font); backdrop-filter: none; -webkit-backdrop-filter: none; }
@supports (backdrop-filter: blur(8px)) {
  header.nav.st-head { background: color-mix(in srgb, var(--st-bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
}
.st-head .st-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-top: env(safe-area-inset-top, 0px); }
.st-brand { display: inline-flex; align-items: center; color: var(--st-wordmark); text-decoration: none; flex: none; padding: 6px 0; }
.st-lockup { display: block; height: 30px; width: auto; }
.st-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.st-links a { color: var(--st-muted); text-decoration: none; font: 500 15px/1.2 var(--st-font); padding: 8px 0; letter-spacing: 0; text-transform: none; }
.st-links a:hover, .st-links a[aria-current="page"] { color: var(--st-text); }
.st-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--st-accent); }
.st-head a:focus-visible, .st-foot a:focus-visible, .st-skip:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 3px; border-radius: 3px; }
/* The account entry (18 Nov 2026): "Sign in" / "Account" as a small outlined pill; with the profile picture when signed in
   (site-nav.js on the site pages, account.js on the account pages add img.nav-avatar and .has-avatar). */
.st-links a.st-acct { color: var(--st-text); border: 1px solid var(--st-line); border-radius: 999px; padding: 7px 14px; background: var(--st-card); }
.st-links a.st-acct:hover { border-color: var(--st-muted); }
.st-links a.st-acct[aria-current="page"] { box-shadow: none; border-color: var(--st-accent); }
.st-links a.st-acct.has-avatar { display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px 3px 3px; }
.st-links a.st-acct .nav-avatar { display: block; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid var(--st-line); }
@media (max-width: 430px) {
  .st-lockup { height: 24px; }
  .st-links a.st-acct { padding: 6px 11px; }
  .st-links a.st-acct.has-avatar { padding: 6px 11px; }
  .st-links a.st-acct .nav-avatar { display: none; }
}
@media (max-width: 380px) { .st-lockup { height: 21px; } .st-links { gap: 11px; } }

/* Footer */
footer.st-foot { margin: 0; padding: 32px 0 calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--st-line);
  background: var(--st-bg); color: var(--st-muted); font: 400 14px/1.6 var(--st-font); text-align: left; }
.st-foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.st-foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--st-text); text-decoration: none; font: 600 15px/1 var(--st-font); }
.st-mark { width: 26px; height: 26px; flex: none; }
.st-foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.st-foot-links a { color: var(--st-muted); text-decoration: none; font: 400 14px/1.6 var(--st-font); }
.st-foot-links a:hover { color: var(--st-text); text-decoration: underline; }
.st-legal { margin: 18px 0 0; font: 400 12.5px/1.6 var(--st-font); color: var(--st-muted); max-width: 78ch; }
