/* Quartermaster Templates — matches quartermaster.app (seanrogs/quartermaster-site, assets/css/site.css).
   Colours follow the app's AccentColor asset (light #8A2812, dark #F69882). Keep the shared parts in sync with that file. */
:root {
  --accent: #8a2812;
  --accent-strong: #6f1f0d;
  --accent-soft: #f6e7e2;
  --bg: #fbf9f7;
  --surface: #ffffff;
  --text: #1d1a19;
  --muted: #6b625e;
  --line: #e7e0dc;
  --shadow: 0 1px 2px rgb(40 20 10 / 6%), 0 8px 24px rgb(40 20 10 / 8%);
  --radius: 14px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Futura ships with iOS and macOS (the app's logo uses Futura Medium); others fall back to similar geometric fonts. */
  --font-display: Futura, "Futura PT", "Century Gothic", "Avenir Next", var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #f69882;
    --accent-strong: #ffb4a3;
    --accent-soft: #3a211b;
    --bg: #141110;
    --surface: #1e1a18;
    --text: #f1ece9;
    --muted: #aea29c;
    --line: #342d2a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-strong); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 19px; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 8px; }
.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a { font-family: var(--font-display); font-weight: 500; color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); background: var(--accent-soft); }
.site-nav .nav-cta { background: var(--accent); color: #fff; }
.site-nav .nav-cta:hover { background: var(--accent-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .site-nav .nav-cta, .site-nav .nav-cta:hover { color: #1d1a19; } }
@media (max-width: 640px) {
  .header-inner { padding-top: 8px; padding-bottom: 8px; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: 14px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }

/* Page heading */
.page-head { padding: 48px 0 8px; max-width: 720px; }
.eyebrow { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.eyebrow a { color: var(--muted); }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 500; line-height: 1.25; }
.page-head h1 { font-weight: 500; font-size: clamp(34px, 5vw, 48px); line-height: 1.1; margin: 0 0 12px; }
.lede { font-size: 20px; color: var(--muted); margin: 0; }

/* Jump links to each game system */
/* "Browse Game Systems" expands to the pills. Each <ul> is its own row. */
.contents { margin: 28px 0 40px; }
.contents > summary { display: inline-flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: 16px; padding: 9px 18px; border-radius: 999px; background: var(--accent); color: #fff; -webkit-user-select: none; user-select: none; }
.contents > summary::-webkit-details-marker { display: none; }
.contents > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s; }
/* Like an iOS disclosure group: points to the trailing edge when closed, down when open. */
.contents[open] > summary::after { transform: translateY(-2px) rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .contents > summary::after { transition: none; } }
.contents > summary:hover { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .contents > summary { color: #1d1a19; } }
.contents[open] > summary { margin-bottom: 16px; }
.contents ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 14px; padding: 0; }
.contents ul:last-child { margin-bottom: 0; }

/* Pills drop in when the section opens, row by row, left to right. */
@keyframes pill-in { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
.contents[open] li { animation: pill-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--row, 0) * 50ms + var(--col, 0) * 25ms); }
.contents ul:nth-of-type(2) { --row: 1; } .contents ul:nth-of-type(3) { --row: 2; } .contents ul:nth-of-type(4) { --row: 3; }
.contents ul:nth-of-type(5) { --row: 4; } .contents ul:nth-of-type(6) { --row: 5; } .contents ul:nth-of-type(n+7) { --row: 6; }
.contents li:nth-child(2) { --col: 1; } .contents li:nth-child(3) { --col: 2; } .contents li:nth-child(4) { --col: 3; }
.contents li:nth-child(5) { --col: 4; } .contents li:nth-child(n+6) { --col: 5; }
@media (prefers-reduced-motion: reduce) { .contents[open] li { animation: none; } }
.contents li { margin: 0; }
.contents a { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; color: var(--text); text-decoration: none; }
.contents a:hover { border-color: var(--accent); color: var(--accent); }
/* "More …" pills are secondary: no fill or border, accent text and a trailing chevron. */
.contents li.more a { display: inline-flex; align-items: center; gap: 7px; background: none; border-color: transparent; color: var(--accent); padding-left: 10px; padding-right: 10px; }
.contents li.more a::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.contents li.more a:hover { background: var(--accent-soft); border-color: transparent; }

/* Edition and status badges: <span class="edition">3rd Edition</span>, <span class="badge wip">WIP</span> */
.edition, .badge { display: inline-block; vertical-align: 0.2em; white-space: nowrap; font-family: var(--font-display); font-weight: 500; font-size: 12px; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px 4px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.badge.wip { background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.contents .edition { font-size: 11px; padding: 4px 6px 3px; margin-left: 2px; vertical-align: 0.1em; }

.banner {background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 18px; margin: 24px 0 0; max-width: 720px; }
.banner p { margin: 0; }

/* Game system cards */
#content { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
#content #content { grid-column: 1 / -1; }
.column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; min-width: 0; }
.column h2 { font-size: 24px; margin: 0 0 12px; }
.column h3 { font-size: 20px; margin: 24px 0 8px; }
.column h3:first-child { margin-top: 0; }
.column h4 { font-size: 17px; margin: 24px 0 8px; color: var(--muted); }
.column h5 { font-size: 15px; margin: 18px 0 6px; color: var(--muted); }
.column p { margin: 0 0 14px; }
.column ul { list-style: none; margin: 0; padding: 0; }
.column > ul, .column > div > ul { padding: 10px 0; border-top: 1px solid var(--line); }
.column > h2 + ul, .column > div > h3 + ul { border-top: 0; padding-top: 0; }
.column li { margin: 4px 0; }
.column li a { text-decoration: none; }
.column li a:hover { text-decoration: underline; }
.column ul ul { margin: 2px 0 6px 0; }
.column ul ul li { margin: 2px 0; }

/* Notes under a file */
ul.note, ul.local, ul.supplements, ul.prerequisite { color: var(--muted); font-size: 14px; line-height: 1.45; }
ul.supplements > li::before { content: "+"; margin-right: 6px; }
ul.prerequisite > li::before { content: "✓"; margin-right: 6px; }
ul.note a, ul.supplements a { color: var(--muted); text-decoration: underline; }
sup { font-size: 0.65em; color: var(--muted); }

/* What's been updated (home page): a timeline built from _updates/ */
.updates { list-style: none; margin: 16px 0 0; padding: 0; }
.update { position: relative; margin: 0 0 0 6px; padding: 0 0 26px 22px; border-left: 2px solid var(--line); }
.update:last-child { padding-bottom: 0; border-left-color: transparent; }
.update::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--surface); }
.update time { display: block; font-family: var(--font-display); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
.update h4 { font-size: 18px; margin: 4px 0 6px; color: var(--text); }
.update h4 a { text-decoration: none; }
.update-note { margin: 0 0 8px; font-size: 14px; font-style: italic; color: var(--muted); line-height: 1.45; }
.update ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.45; columns: 2 150px; column-gap: 20px; }
.update li { margin: 0 0 4px; break-inside: avoid; position: relative; padding-left: 14px; }
.update li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: 0.6; }
/* A group with its own list, like "Escher: The House of Blades", reads as a sub-heading. */
.update li:has(> ul) { padding-left: 0; margin-top: 8px; font-weight: 600; column-span: all; }
.update li:has(> ul)::before { display: none; }
.update li:has(> ul) > ul { font-weight: 400; margin: 4px 0 0; }
.update:has(li > ul) > ul { columns: auto; }

.caption h3 { margin-top: 24px; }

:target { background: var(--accent-soft); border-radius: 6px; }
.column:target, h2:target { background: none; }
.hidden { display: none; }
