/* Quartermaster site — colours follow the app's AccentColor asset (light #8A2812, dark #F69882). */
:root {
  --accent: #8a2812;
  --accent-strong: #6f1f0d;
  --accent-soft: #f6e7e2;
  --bg: #fbf9f7;
  --surface: #ffffff;
  --text: #1d1a19;
  --muted: #6b625e;
  --line: #e7e0dc;
  --code-bg: #f3eeeb;
  --shadow: 0 1px 2px rgb(40 20 10 / 6%), 0 8px 24px rgb(40 20 10 / 8%);
  --radius: 14px;
  --max: 1120px;
  --prose: 720px;
  --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:not([data-theme="light"]) {
    --accent: #f69882;
    --accent-strong: #ffb4a3;
    --accent-soft: #3a211b;
    --bg: #141110;
    --surface: #1e1a18;
    --text: #f1ece9;
    --muted: #aea29c;
    --line: #342d2a;
    --code-bg: #2a2421;
    --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 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; }

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-family: var(--font-display); font-weight: 500; text-decoration: none; background: var(--accent); color: #fff; }
.button:hover { background: var(--accent-strong); color: #fff; }
.button.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.button.secondary:hover { background: var(--accent-soft); color: var(--accent); }
@media (prefers-color-scheme: dark) { .button, .button:hover { color: #1d1a19; } .button.secondary, .button.secondary:hover { color: var(--accent); } }

/* Home */
.hero { display: grid; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 0.9fr; padding-top: 88px; padding-bottom: 40px; } }
.hero-icon { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--shadow); }
.hero h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(40px, 7vw, 64px); line-height: 1.05; margin: 24px 0 16px; }
.hero p { font-size: 20px; color: var(--muted); max-width: 34em; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.app-store-badge { display: inline-block; line-height: 0; }
.app-store-badge img { height: 50px; width: auto; }
.hero .hero-meta { margin: 18px 0 0; font-size: 14px; }
.phones { display: flex; justify-content: center; gap: 16px; }
.phones img { width: 46%; max-width: 260px; border-radius: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.phones img:last-child { transform: translateY(40px); }

.section { padding: 64px 0 0; }
.section h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 38px); margin: 0 0 8px; }
.section > .wrap > p.sub { color: var(--muted); margin: 0 0 32px; max-width: 40em; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-family: var(--font-display); font-weight: 500; margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature .icon { font-size: 26px; display: block; margin-bottom: 10px; }
.games { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.games li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.news-list li a { display: block; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.news-list li a:hover { border-color: var(--accent); }
.news-list time { display: block; font-size: 13px; color: var(--muted); }
.news-list strong { font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.news-list .excerpt { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }
.news-year { font-family: var(--font-display); font-weight: 500; font-size: 24px; margin: 40px 0 12px; }

/* Prose */
.prose { max-width: var(--prose); }
.page, .post { padding-top: 48px; margin-left: auto; margin-right: auto; }
.prose h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 5vw, 48px); line-height: 1.1; margin: 0 0 16px; }
.prose h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.25; margin: 48px 0 12px; }
.prose h3 { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin: 32px 0 8px; }
.prose h4 { font-family: var(--font-display); font-weight: 500; font-size: 17px; margin: 24px 0 6px; }
.prose .lede { font-size: 20px; color: var(--muted); margin-bottom: 32px; }
.prose img { display: block; margin: 24px auto; border-radius: 12px; border: 1px solid var(--line); max-height: 640px; width: auto; }
.prose li + li { margin-top: 4px; }
.prose ol ul, .prose ul ul { margin-top: 4px; }
.prose code { background: var(--code-bg); border-radius: 6px; padding: 1px 6px; font-size: 0.9em; }
.prose kbd { font: 600 0.85em var(--font); background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.prose blockquote, .callout { margin: 24px 0; padding: 14px 18px; background: var(--accent-soft); border-radius: 12px; border: 0; }
.prose blockquote p, .callout p { margin: 0; }
.prose blockquote p + p { margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.eyebrow { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.eyebrow a { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 40px; }
.tags span { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { text-decoration: none; max-width: 48%; }
.post-nav .older { text-align: right; }
.post-nav small { display: block; color: var(--muted); font-size: 13px; }

/* Guide */
.guide { display: grid; gap: 32px; padding-top: 48px; }
@media (min-width: 900px) { .guide { grid-template-columns: 240px minmax(0, 1fr); gap: 56px; } }
.guide-toc { font-size: 14px; }
@media (min-width: 900px) { .guide-toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; } }
.guide-toc details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
@media (min-width: 900px) { .guide-toc details { background: none; border: 0; padding: 0; } .guide-toc summary { display: none; } }
.guide-toc summary { font-weight: 600; cursor: pointer; }
.guide-toc .toc-heading { margin: 16px 0 4px; font-family: var(--font-display); font-weight: 500; color: var(--text); text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em; }
.guide-toc ul { list-style: none; margin: 0; padding: 0; }
.guide-toc li a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; }
.guide-toc li a:hover { color: var(--accent); }
.guide-body h2 { padding-top: 24px; border-top: 1px solid var(--line); }
.guide-body h2:first-of-type { border-top: 0; }
.guide-body .figure-row { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.guide-body .figure-row img { width: 260px; margin: 8px 0; }
.start-steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.start-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 60px; position: relative; margin: 0; }
.start-steps li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--bg); font-family: var(--font-display); font-weight: 500; display: grid; place-items: center; font-size: 15px; }
.start-steps strong { display: block; }
.start-steps p { margin: 0; }
