/* ==========================================================================
   VCO Collective · base.css
   Design tokens, reset, typography, buttons, forms and shared components.
   Loaded by every page.
   ========================================================================== */

:root {
  --paper: #F3F5F8;
  --card: #FFFFFF;
  --ink: #141C2E;
  --muted: #5A6477;
  --line: #DCE1EA;
  --navy: #1E3A78;
  --navy-deep: #142A5C;
  --navy-soft: #E5EBF8;
  --red: #C2392B;
  --red-soft: #FBE9E6;
  --ok: #2C7A4E;
  --ok-soft: #E3F3EA;
  --on-accent: #FFFFFF;
  --shadow: 0 1px 2px rgba(20, 28, 46, .05), 0 4px 16px rgba(20, 28, 46, .06);
  --logo-plate: transparent;

  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --r: 12px;
  --r-sm: 8px;
  --wrap: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D121C; --card: #151C2A; --ink: #E7EBF2; --muted: #98A2B6; --line: #263044;
    --navy: #93AEF0; --navy-deep: #0F1A33; --navy-soft: #1C2843;
    --red: #F07A6A; --red-soft: #3A201E; --ok: #6CC892; --ok-soft: #173226;
    --on-accent: #0D121C; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --logo-plate: #FFFFFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D121C; --card: #151C2A; --ink: #E7EBF2; --muted: #98A2B6; --line: #263044;
  --navy: #93AEF0; --navy-deep: #0F1A33; --navy-soft: #1C2843;
  --red: #F07A6A; --red-soft: #3A201E; --ok: #6CC892; --ok-soft: #173226;
  --on-accent: #0D121C; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --logo-plate: #FFFFFF;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

/* ---------- Utilities ---------- */
.mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.m0 { margin: 0; }
.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;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Airmail stripe used across header, auth and landing */
.airmail {
  height: 7px;
  background: repeating-linear-gradient(-45deg,
    var(--red) 0 14px, var(--card) 14px 22px,
    var(--navy) 22px 36px, var(--card) 36px 44px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 8px 15px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, background-color .15s, color .15s;
}
.btn:hover { border-color: var(--navy); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); padding: 5px 9px; }
.btn.ghost:hover { color: var(--ink); background: var(--paper); }
.btn.on { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.btn.big { padding: 12px 22px; font-size: 17px; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-soft);
}
textarea { resize: vertical; min-height: 88px; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.field-error { color: var(--red); font-size: 13px; font-weight: 600; }
input[aria-invalid="true"] { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }

/* ---------- Panels & cards ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.panel h3 { font-size: 17px; margin-bottom: 8px; }
details.panel summary { cursor: pointer; font-weight: 700; }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.chip:hover { color: var(--ink); }
a.chip { text-decoration: none; display: inline-block; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }
/* Radio buttons shown as chips (board post type) */
.chip-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-radio:checked + .chip { background: var(--ink); border-color: var(--ink); color: var(--card); }
.chip-radio:focus-visible + .chip { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---------- Badges ---------- */
.kind {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.k-ask { background: var(--navy-soft); color: var(--navy); }
.k-offer { background: var(--ok-soft); color: var(--ok); }
.k-intro { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.k-notice { background: var(--red-soft); color: var(--red); }
.tag {
  align-self: flex-start;
  font-size: 12px; font-weight: 700;
  color: var(--navy); background: var(--navy-soft);
  border-radius: 4px; padding: 2px 8px;
}

/* ---------- People ---------- */
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--navy); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
}
.av.team { background: var(--red); }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.who .n { font-weight: 700; line-height: 1.2; }
.who .c { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink); color: var(--card);
  padding: 11px 18px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px;
  z-index: 100; max-width: calc(100% - 32px);
  box-shadow: var(--shadow);
}

/* ---------- Notice strip ---------- */
.notice-strip {
  background: var(--navy-soft);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
}
.notice-strip.warn { background: var(--red-soft); }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .25s ease-out; }
  @keyframes rise { from { transform: translateY(4px); opacity: .6; } to { transform: none; opacity: 1; } }
}
