/* Priors website: shared styles for every page.
   Page-only styles live in assets/pages/<page>.css (see PAGES.md).
   Layout: patrol bands. Each section is a full-width .band with a centered 1180px .wrap. */

:root {
  /* Light by default: the CAD's off-white paper, pine green and red clay accents. */
  --bg: #f6f4ee;
  --bg-2: #ecebe3;
  --surface: #ffffff;
  --line: #d6d4c8;
  --fg: #17231c;
  --muted: #4f5d53;
  --clay: #a8401c;
  --clay-ink: #ffffff;
  --sign: #1b6b43;
  --sign-fg: #ffffff;
  --pine: #1b6b43;      /* pine accent for text and lines (brighter in dark) */
  --water: #3f86a8;     /* rivers, lakes and the coast on maps and diagrams */
  --amber: #8a5800;
  --term-bg: #0a0f0c;
  --ok: #1f7f4c;
  --warn: #8a5800;
  --bad: #b3261e;
  /* Status badges: what really runs, what is designed, what is planned */
  --st-working: #1b6b43;
  --st-designed: #a8401c;
  --st-planned: #4f5d53;
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.3rem;
  --step-4: clamp(2.6rem, 6.4vw, 4.6rem);
  --radius: 6px;
  --header-h: 64px;
  color-scheme: light;
}
/* Dark (night patrol) only when the visitor picks it with Switch theme */
:root[data-theme="dark"] {
  --bg: #0c1511; --bg-2: #111d17; --surface: #16231c; --line: #29392f;
  --fg: #e6ece3; --muted: #9cab9f; --clay: #e0703f; --clay-ink: #1a0d06;
  --sign: #1f7a4d; --sign-fg: #f4fbf6; --pine: #57c78a; --water: #5ea7c9; --amber: #ffb547;
  --ok: #57c78a; --warn: #ffb547; --bad: #ff6b5b;
  --st-working: #57c78a; --st-designed: #e8875a; --st-planned: #a9b7ab;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 3px; }
main:focus { outline: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.02; letter-spacing: 0.005em; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); text-transform: uppercase; }
h3 { font-size: var(--step-2); text-transform: uppercase; }
p { margin: 0; }
.prose a, .section-head a, .lede a { color: var(--clay); text-underline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--fg); color: var(--bg); padding: .6rem .9rem; border-radius: 4px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line); }
.band.alt { background: var(--bg-2); }
.band.tight { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--clay);
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 62ch; line-height: 1.5; }
.section-head { display: grid; gap: 0.9rem; margin-bottom: 2.5rem; max-width: 780px; }
.section-head p:not(.eyebrow) { color: var(--muted); max-width: 64ch; }
.section-head .status-row { margin-top: .2rem; }
.muted { color: var(--muted); }
.note { font-size: .82rem; color: var(--muted); }
.map-note { font-size: .82rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center;
  font: 600 0.95rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  padding: 0.85rem 1.2rem; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }
.btn-primary { background: var(--clay); color: var(--clay-ink); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); }
.btn-discord::before { content: ""; width: 16px; height: 12px; display: inline-block; vertical-align: -1px;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M20.3 1.5A19.6 19.6 0 0 0 15.4 0l-.6 1.3a18 18 0 0 0-5.6 0L8.6 0a19.6 19.6 0 0 0-4.9 1.5C.6 6.2-.3 10.7.1 15.2A19.8 19.8 0 0 0 6.1 18l1.3-2.1a12.7 12.7 0 0 1-2-1l.5-.4a14 14 0 0 0 12.2 0l.5.4a12.7 12.7 0 0 1-2 1l1.3 2.1a19.7 19.7 0 0 0 6-2.8c.5-5.2-.9-9.7-3.6-13.7ZM8 12.4c-1.2 0-2.2-1.1-2.2-2.4S6.8 7.6 8 7.6s2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Zm8 0c-1.2 0-2.2-1.1-2.2-2.4s1-2.4 2.2-2.4 2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M20.3 1.5A19.6 19.6 0 0 0 15.4 0l-.6 1.3a18 18 0 0 0-5.6 0L8.6 0a19.6 19.6 0 0 0-4.9 1.5C.6 6.2-.3 10.7.1 15.2A19.8 19.8 0 0 0 6.1 18l1.3-2.1a12.7 12.7 0 0 1-2-1l.5-.4a14 14 0 0 0 12.2 0l.5.4a12.7 12.7 0 0 1-2 1l1.3 2.1a19.7 19.7 0 0 0 6-2.8c.5-5.2-.9-9.7-3.6-13.7ZM8 12.4c-1.2 0-2.2-1.1-2.2-2.4S6.8 7.6 8 7.6s2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Zm8 0c-1.2 0-2.2-1.1-2.2-2.4s1-2.4 2.2-2.4 2.2 1.1 2.2 2.4-1 2.4-2.2 2.4Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.btn-text { background: none; border: 0; padding: .4rem 0; color: var(--muted); font: 500 .9rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn-text:hover { color: var(--fg); }
.soon { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; }
.more { color: var(--clay); font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Header and navigation. The current page's link carries aria-current="page" (set by build.mjs). */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header > .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-h); position: relative; }
.wordmark { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex: none; }
.wordmark-mark { display: block; width: 30px; height: 40px; flex: none; }
.wordmark-text { font: 900 1.35rem/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; }
.nav a {
  display: flex; align-items: center; min-height: var(--header-h); position: relative;
  text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--clay); border-radius: 2px 2px 0 0; }
.nav a:focus-visible { outline-offset: -2px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.site-header .btn { padding: .6rem .9rem; font-size: .88rem; white-space: nowrap; }
.nav-toggle { display: none; align-items: center; gap: .5rem; font: 600 .88rem/1 var(--font-body); color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; cursor: pointer; min-height: 40px; }
.nav-toggle:hover { border-color: var(--muted); }
.nav-toggle-bars { width: 16px; height: 12px; display: inline-block; position: relative; border-block: 2px solid currentColor; }
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: currentColor; }
.nav-toggle[aria-expanded="true"] { border-color: var(--fg); }
@media (max-width: 1120px) {
  .header-actions { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  /* Without script the nav wraps onto its own row under the logo. */
  .site-header > .wrap { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 0; flex-wrap: wrap; gap: 0 1rem; padding-bottom: .4rem; }
  .nav a { min-height: 40px; }
  html:not(.js) .nav-toggle { display: none; }
  /* With script it is a drop-down panel behind the Menu button. */
  .js .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -28px rgba(0,0,0,.5);
    padding: .4rem max(16px, env(safe-area-inset-right, 0px)) 1rem max(16px, env(safe-area-inset-left, 0px));
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .js .site-header.nav-open .nav { display: flex; }
  .js .nav a { min-height: 48px; font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-left: .9rem; }
  .js .nav a:last-child { border-bottom: 0; }
  .js .nav a[aria-current="page"]::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; border-radius: 0 2px 2px 0; }
}
@media (max-width: 720px) { .site-header .btn-discord { display: none; } }
@media (max-width: 380px) { .wordmark-text { font-size: 1.2rem; } .site-header .btn { padding: .6rem .7rem; } .nav-toggle { padding: .6rem; } .nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); } }

/* Inner page hero: eyebrow, h1, lede, then a row of status badges */
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2.5rem, 5vw, 3.5rem);
  background:
    radial-gradient(ellipse 55% 80% at 90% 20%, color-mix(in srgb, var(--sign) 8%, transparent), transparent 70%),
    radial-gradient(ellipse 45% 70% at 0% 100%, color-mix(in srgb, var(--clay) 8%, transparent), transparent 70%),
    var(--bg);
}
.page-hero .wrap { display: grid; gap: 1.1rem; }
.page-hero h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); font-weight: 900; text-transform: uppercase; max-width: 18ch; }
.page-hero h1 em { font-style: normal; color: var(--clay); }
.page-hero .lede { max-width: 66ch; }

/* On-this-page jump links */
.toc { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: .4rem 0 0; padding: 0; }
.toc a { display: inline-block; font-size: .85rem; font-weight: 600; text-decoration: none; padding: .35rem .7rem; border-radius: 99px; border: 1px solid var(--line); color: var(--fg); background: var(--surface); }
.toc a:hover { border-color: var(--muted); }

/* Status badges: <span class="status status-working|status-designed|status-planned">Label</span>
   working = really runs today; designed = decided in the GDD with a concrete design; planned = intended, not designed in detail. */
.status {
  display: inline-flex; align-items: center; gap: .45rem; justify-self: start; align-self: start;
  font: 600 .68rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  padding: .32rem .5rem .32rem .45rem; border-radius: 3px; border: 1px solid currentColor; vertical-align: middle;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status-working { color: var(--st-working); background: color-mix(in srgb, var(--st-working) 9%, transparent); }
.status-working::before { background: currentColor; }
.status-designed { color: var(--st-designed); }
.status-designed::before { border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.status-planned { color: var(--st-planned); border-style: dashed; }
.status-planned::before { border: 1.5px dashed currentColor; }
.status-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.status-legend { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--muted); }
.status-legend li { display: inline-flex; align-items: center; gap: .6rem; }

/* Cards: .cards is an auto-fitting grid; .card is one item. a.card-link makes the whole card a link. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1rem; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.4rem; display: grid; gap: .75rem; align-content: start; min-width: 0; }
.band.alt .card { background: var(--bg); }
.card h3 { font-size: 1.4rem; }
.card p { color: var(--muted); font-size: .94rem; }
.card .strong, .card p.strong { color: var(--fg); }
/* Mono small-caps label in a card head (e.g. the page name on Home's Explore cards) */
.card-key { font: 600 .72rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem 1rem; flex-wrap: wrap; }
.card-link { text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; position: relative; }
.card-link:hover { border-color: var(--muted); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card-link:hover { transform: none; } }
.card-link .go { font-weight: 600; font-size: .9rem; color: var(--clay); margin-top: auto; }
.card-link .go::after { content: " →"; }

/* Shared screenshot frame */
.shot { margin: 0; display: grid; gap: .7rem; min-width: 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 18px 40px -24px rgba(0,0,0,.45); background: #f6f4ee; }
.shot-link { display: block; border-radius: 6px; }
.shot-link:hover img { border-color: var(--muted); }
.shot figcaption { font-size: .88rem; color: var(--muted); max-width: 70ch; }
.shot figcaption b { color: var(--fg); }

/* Concept demos (assets/demos/<name>, loaded with the page's demos: line): an intro, then the mount point.
   <div class="demo-block" id="..."><div class="section-head">eyebrow, h3, p</div><div class="demo" data-demo="name"></div></div>
   Each demo draws its own "Concept UI" badge, status badge and note. */
.demo-block { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--line); min-width: 0; }
.demo-block > .section-head { margin-bottom: 1.5rem; }
.demo-block > .section-head h3 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.demo { min-width: 0; }

.sub-label { font: 600 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 99px; border: 1px solid var(--line); color: var(--fg); }

/* Lists */
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: .55rem; font-size: .93rem; }
.ticks li { position: relative; padding-left: 1.3rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; background: var(--clay); border-radius: 1px; transform: rotate(45deg); }
.ticks b { font-weight: 600; }
kbd { font: 600 .78rem var(--font-mono); padding: .05rem .35rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; background: var(--surface); white-space: nowrap; }

/* Form bits shared by the server config and Weigh in */
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 4px; font-family: var(--font-mono); font-size: .85rem; }
.seg input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.seg input:focus-visible + span { outline: 2px solid var(--clay); outline-offset: 2px; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .93rem; cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--clay); width: 16px; height: 16px; flex: none; }
.check small { display: block; color: var(--muted); font-size: .8rem; }

/* Join CTA (partials/join.html, included with <!--#include join-->) */
.cta { background: var(--sign); color: var(--sign-fg); border-top: 0; }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 860px) { .cta-grid { grid-template-columns: minmax(0, 1fr); } }
.cta h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.cta p { opacity: .92; max-width: 56ch; }
.cta .eyebrow { color: var(--sign-fg); }
.cta :focus-visible { outline-color: var(--sign-fg); }
.cta a { color: var(--sign-fg); }
.cta ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.cta li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: .5rem; }
.cta li::before { content: "✓"; font-weight: 700; }
.cta .btn-primary { background: var(--sign-fg); color: var(--sign); }
.cta .btn-ghost { border-color: color-mix(in srgb, var(--sign-fg) 50%, transparent); color: var(--sign-fg); }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Footer */
.site-footer { padding-block: 2.5rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer > .wrap { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: .9rem; min-width: 0; flex: 1 1 320px; }
.footer-brand img { width: 36px; height: 48px; flex: none; }
.footer-brand b { display: block; color: var(--fg); font: 900 1.1rem/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; margin-bottom: .25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; }
.footer-links span { color: var(--fg); font-weight: 700; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--fg); }
.footer-links a[aria-current="page"] { color: var(--fg); }
.footer-pages { width: 100%; padding-bottom: 1.25rem; border-bottom: 1px dashed var(--line); }
.logo-files { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; width: 100%; padding-top: 1.25rem; border-top: 1px dashed var(--line); }
.logo-files span { font: 600 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg); }
.logo-files a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.logo-files a:hover { color: var(--fg); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; padding: .35rem .7rem; font: inherit; cursor: pointer; }
.theme-toggle:hover { color: var(--fg); border-color: var(--muted); }

/* Previous / next page strip at the end of every page (written by build.mjs from each page's hook: line) */
.pager { border-top: 1px solid var(--line); padding-block: 1.5rem; }
.pager .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); grid-template-areas: "prev next"; gap: 1rem; }
.pager-prev { grid-area: prev; }
.pager-next { grid-area: next; }
.pager-link { display: grid; gap: .25rem; align-content: start; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; color: var(--fg); min-width: 0; transition: border-color .15s ease; }
.pager-link:hover { border-color: var(--muted); }
.pager-dir { font: 600 .72rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pager-name { font: 800 1.5rem/1.05 var(--font-display); text-transform: uppercase; }
.pager-hook { color: var(--muted); font-size: .9rem; }
.pager-next { text-align: right; justify-items: end; }
.pager-next .pager-name::after { content: " →"; color: var(--clay); }
.pager-prev .pager-name::before { content: "← "; color: var(--clay); }
@media (max-width: 600px) { .pager .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "next" "prev"; } }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
