/* Layout: night-sky band on top (always dark, like the badge), calendar of campout "tickets" below on a sage-grey ground. */
:root {
  --night: #0d0f10;
  --night-2: #1a1e1f;
  --star: #f4f1e8;
  --gold: #ffbb58;
  --bg: #eceee9;
  --surface: #ffffff;
  --surface-2: #f5f6f2;
  --ink: #151716;
  --muted: #59605b;
  --line: #d4d9d2;
  --accent-ink: #8a5600;
  --accent-soft: #fff1da;
  --ok: #24724a;
  --ok-soft: #e1f2e8;
  --danger: #b3261e;
  --danger-soft: #fbe7e5;
  --shadow: 0 1px 2px rgb(20 24 22 / .06), 0 8px 24px -12px rgb(20 24 22 / .18);
  --f-display: "Big Shoulders Display", "Oswald", "Arial Narrow", Impact, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --r-sm: 9px;
  --wrap: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1211; --surface: #171b19; --surface-2: #1d2220; --ink: #eceee8; --muted: #9ba49d;
    --line: #2b322e; --accent-ink: #ffbb58; --accent-soft: #33281a; --ok: #6fcf98; --ok-soft: #173326;
    --danger: #ff8a80; --danger-soft: #3a1c1a; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -14px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1211; --surface: #171b19; --surface-2: #1d2220; --ink: #eceee8; --muted: #9ba49d;
  --line: #2b322e; --accent-ink: #ffbb58; --accent-soft: #33281a; --ok: #6fcf98; --ok-soft: #173326;
  --danger: #ff8a80; --danger-soft: #3a1c1a; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -14px rgb(0 0 0 / .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--f-body);
  min-height: 100vh; display: flex; flex-direction: column;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night); }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.02; letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tnum { font-variant-numeric: tabular-nums; }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--night); color: var(--star); border-bottom: 1px solid rgb(255 255 255 / .08); }
.topbar-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: 36px; height: auto; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; gap: 2px; align-items: center; }
.nav a, .nav button { color: #c9cec9; text-decoration: none; font: 600 .92rem var(--f-body); padding: 8px 11px; border-radius: 999px; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.nav a:hover, .nav button:hover { color: #fff; background: rgb(255 255 255 / .07); }
.nav a[aria-current="page"] { color: var(--night); background: var(--gold); }
@media (max-width: 560px) {
  .brand-name { display: none; }
  .nav a, .nav button { padding: 8px 9px; font-size: .88rem; }
}

/* Hero */
.hero { position: relative; background: var(--night); color: var(--star); overflow: hidden; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; background: var(--bg);
  clip-path: polygon(0 100%, 0 62%, 9% 30%, 16% 55%, 27% 8%, 38% 58%, 46% 38%, 58% 72%, 69% 20%, 80% 60%, 88% 42%, 100% 70%, 100% 100%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: clamp(110px, 18vw, 190px) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding-block: clamp(28px, 6vw, 64px) clamp(80px, 9vw, 110px); }
.hero-logo { height: auto; width: clamp(110px, 18vw, 190px); filter: drop-shadow(0 10px 30px rgb(0 0 0 / .5)); }
.hero h1 { color: #fff; }
.hero h1 .gold { color: var(--gold); }
.hero .lede { margin-top: 12px; max-width: 54ch; color: #c9cec9; font-size: 1.05rem; }
.hero .eyebrow { color: var(--gold); }
@media (max-width: 640px) { .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-block: 20px 84px; } .hero h1 { font-size: clamp(2rem, 10vw, 3.2rem); } .hero-logo { width: 78px; } .hero .lede { font-size: .98rem; } }


/* Next campout band */
.next { margin-top: -54px; position: relative; z-index: 2; }
.next-card { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 1px solid var(--line); }
.next-card .art { min-height: 220px; }
.next-card .body { padding: clamp(18px, 3vw, 30px); display: flex; flex-direction: column; gap: 12px; justify-content: center; min-width: 0; }
.countdown { display: inline-flex; align-items: baseline; gap: 8px; font-family: var(--f-display); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--accent-ink); }
.countdown small { font-family: var(--f-body); font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 720px) { .next-card { grid-template-columns: 1fr; } .next-card .art { min-height: 0; aspect-ratio: 16 / 8; } }

/* Section */
.section { padding-block: clamp(28px, 5vw, 48px); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }

/* Campout tickets */
.month { margin-top: 26px; }
.month:first-child { margin-top: 0; }
.month-label { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.month-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.ticket { display: grid; grid-template-columns: 84px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.ticket:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ticket .stub { background: var(--night); color: var(--star); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px; text-align: center; border-right: 2px dashed rgb(255 255 255 / .2); }
.stub .mo { font-size: .72rem; font-weight: 700; letter-spacing: .16em; color: var(--gold); }
.stub .dd { font-family: var(--f-display); font-weight: 800; font-size: 2.3rem; line-height: 1; }
.stub .to { font-size: .75rem; color: #aab1ab; }
.ticket .info { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ticket h3 { font-size: 1.4rem; }
.meta { display: flex; flex-direction: column; gap: 3px; font-size: .92rem; color: var(--muted); }
.meta span { display: flex; gap: 7px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.meta svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--accent-ink); }
.ticket .thumb { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.gold { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.art { position: relative; background: var(--night-2); overflow: hidden; }
.art img, .art svg { width: 100%; height: 100%; object-fit: cover; display: block; }

details.past { margin-top: 32px; }
details.past summary { cursor: pointer; font-weight: 700; color: var(--muted); list-style: none; display: inline-flex; gap: 8px; align-items: center; }
details.past summary::before { content: "+"; font-size: 1.2rem; width: 1em; }
details.past[open] summary::before { content: "–"; }
details.past .tickets { margin-top: 16px; opacity: .85; }

/* Campout detail */
.detail-hero { position: relative; background: var(--night); color: #fff; }
.detail-hero .art { aspect-ratio: 21 / 8; max-height: 440px; width: 100%; }
.detail-hero .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgb(9 11 12 / .92), rgb(9 11 12 / .15) 60%, transparent); }
.detail-hero .title { position: absolute; left: 0; right: 0; bottom: 0; padding-block: 18px 22px; }
.detail-hero h1 { color: #fff; font-size: clamp(2.2rem, 7vw, 4rem); }
.detail-hero .when { color: var(--gold); font-weight: 700; margin-top: 6px; }
@media (max-width: 640px) { .detail-hero .art { aspect-ratio: 4 / 3; } }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; padding-block: 14px 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; padding-block: 18px 40px; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } .detail-grid .side { order: -1; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 3vw, 24px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { font-size: 1.7rem; }
.panel h3 { font-size: 1.25rem; }
.prose { white-space: pre-line; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.side { display: flex; flex-direction: column; gap: 16px; }
.wm { display: flex; gap: 12px; align-items: center; }
.wm .badge { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--night); color: var(--gold); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; }
.flyer-link { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: inherit; background: var(--surface-2); }
.hero-flyer { margin-top: 12px; }
/* Whole card is clickable through the title link; buttons inside sit above it. */
.ticket, .next-card { position: relative; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-actions { position: relative; z-index: 1; }
.card-actions .chip { position: relative; }
.ticket:has(.card-link:focus-visible), .next-card:has(.card-link:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.card-link:focus-visible { outline: none; }
.flyer-big { display: block; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.flyer-big img { width: 100%; max-height: 520px; object-fit: contain; }
.flyer-link img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; }
.flyer-link .pdf { width: 52px; height: 64px; border-radius: 4px; background: var(--night); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }

/* Sign-up list */
.tally { display: flex; gap: 22px; flex-wrap: wrap; }
.tally div { display: flex; flex-direction: column; }
.tally b { font-family: var(--f-display); font-size: 2.2rem; line-height: 1; font-weight: 800; }
.tally span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.people li:first-child { border-top: 0; }
.people .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.people .who small { display: block; color: var(--muted); }
.people .n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.empty { color: var(--muted); padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); text-align: center; }

/* Potluck */
.potluck-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.cat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cat-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cat-head strong { font-family: var(--f-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.cat ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .93rem; }
.cat li { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.cat li span { min-width: 0; overflow-wrap: anywhere; }
.cat li em { color: var(--muted); font-style: normal; }
.meter { height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); }

/* Forms */
form { display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label, .label { font-weight: 600; font-size: .9rem; }
.hint { font-size: .82rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; min-width: 0; font-size: 16px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgb(255 187 88 / .3); }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 .95rem var(--f-body); padding: 11px 18px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s, background .15s; }
.btn-primary { background: var(--gold); color: #1a1205; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger.armed { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--muted); font: 600 .82rem var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--danger); }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: var(--r-sm); font-weight: 600; font-size: .92rem; }
.notice { background: var(--accent-soft); color: var(--ink); padding: 14px 16px; border-radius: var(--r-sm); font-size: .95rem; }
.notice strong { color: var(--accent-ink); }

/* Narrow page (login, etc.) */
.narrow { max-width: 480px; margin: 0 auto; padding-block: 40px 60px; display: flex; flex-direction: column; gap: 18px; }

/* Officer tools */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.list-row .grow small { display: block; color: var(--muted); }
.list-row select { width: auto; padding: 6px 10px; }
.date-pill { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; white-space: nowrap; }
.upload { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.upload .preview { width: 160px; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.upload .preview img, .upload .preview svg { width: 100%; height: 100%; object-fit: cover; }
.potluck-edit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; background: var(--surface-2); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; z-index: 5; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { font: 600 .85rem var(--f-body); padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.doc-icon { width: 40px; height: 48px; border-radius: 6px; background: var(--night); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: .7rem; flex: none; letter-spacing: .04em; }

/* Footer, toast, preview banner */
.footer { margin-top: auto; background: var(--night); color: #aab1ab; font-size: .9rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 14px; align-items: center; padding-block: 26px calc(26px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.footer-inner > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.footer strong { color: #fff; font-family: var(--f-display); text-transform: uppercase; letter-spacing: .05em; font-size: 1.1rem; }
.footer a { color: var(--gold); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.loading { padding-block: 60px; text-align: center; color: var(--muted); }
.demo-bar { background: var(--accent-soft); color: var(--ink); font-size: .88rem; }
.demo-bar .wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-block: 8px; }
.demo-bar select { width: auto; padding: 5px 8px; font-size: .88rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
