/* ============================================================
   Crosswalk — design system
   Concept: a wayfinding tool. Ink + a confident pine-green
   "go" accent, warm-gold signal for urgency. Grotesque display,
   humanist sans body, mono for data/labels.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --paper:      #F4F6F4;
  --surface:    #FFFFFF;
  --surface-2:  #EEF2EF;
  --ink:        #16201D;
  --muted:      #586662;
  --faint:      #8A9793;
  --line:       #DEE4E0;
  --accent:     #146A5B;
  --accent-ink: #0C4A3F;
  --accent-soft:#E3EFEB;
  --gold:       #A9701B;
  --gold-soft:  #F6EBD5;
  --urgent:     #B23A2E;
  --urgent-soft:#F7E4E1;
  --open:       #2C6E4B;
  --open-soft:  #E3F0E7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,32,29,.04), 0 6px 20px -12px rgba(20,32,29,.18);
  --shadow-lg: 0 2px 4px rgba(20,32,29,.05), 0 24px 48px -20px rgba(20,32,29,.28);

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #0E1513;
    --surface:    #15201D;
    --surface-2:  #1B2825;
    --ink:        #E8EEEB;
    --muted:      #9DAAA5;
    --faint:      #6E7C77;
    --line:       #253431;
    --accent:     #4FB39E;
    --accent-ink: #7ECab6;
    --accent-soft:#183029;
    --gold:       #D6A34E;
    --gold-soft:  #302711;
    --urgent:     #E58072;
    --urgent-soft:#331E1A;
    --open:       #6FC297;
    --open-soft:  #16301F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 30px 60px -24px rgba(0,0,0,.7);
  }
}
:root[data-theme="light"] {
  --paper:#F4F6F4; --surface:#FFFFFF; --surface-2:#EEF2EF; --ink:#16201D; --muted:#586662;
  --faint:#8A9793; --line:#DEE4E0; --accent:#146A5B; --accent-ink:#0C4A3F; --accent-soft:#E3EFEB;
  --gold:#A9701B; --gold-soft:#F6EBD5; --urgent:#B23A2E; --urgent-soft:#F7E4E1; --open:#2C6E4B; --open-soft:#E3F0E7;
  --shadow:0 1px 2px rgba(20,32,29,.04),0 6px 20px -12px rgba(20,32,29,.18);
  --shadow-lg:0 2px 4px rgba(20,32,29,.05),0 24px 48px -20px rgba(20,32,29,.28);
}
:root[data-theme="dark"] {
  --paper:#0E1513; --surface:#15201D; --surface-2:#1B2825; --ink:#E8EEEB; --muted:#9DAAA5;
  --faint:#6E7C77; --line:#253431; --accent:#4FB39E; --accent-ink:#7ECab6; --accent-soft:#183029;
  --gold:#D6A34E; --gold-soft:#302711; --urgent:#E58072; --urgent-soft:#331E1A; --open:#6FC297; --open-soft:#16301F;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px -14px rgba(0,0,0,.6);
  --shadow-lg:0 2px 6px rgba(0,0,0,.4),0 30px 60px -24px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- top nav ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 8px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--muted); font-weight: 500; font-size: .92rem; padding: 7px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--accent-ink); background: var(--accent-soft); }
.theme-btn { background: none; border: 1px solid var(--line); color: var(--muted); width: 36px; height: 36px; border-radius: 9px; cursor: pointer; font-size: 1rem; display: grid; place-items: center; }
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }

/* ---- generic ---- */
.eyebrow { font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.section { padding: 56px 0; }
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600;
  font-size: .95rem; padding: 11px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-ink); }
:root[data-theme="dark"] .btn-primary, .btn-primary { color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #06110E; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06110E; } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- chips / badges ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.chip.urgent { background: var(--urgent-soft); color: var(--urgent); }
.chip.soon   { background: var(--gold-soft); color: var(--gold); }
.chip.open   { background: var(--open-soft); color: var(--open); }
.chip.region { background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; }

/* ---- forms ---- */
label.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field-hint { color: var(--faint); font-size: .82rem; font-weight: 400; }
textarea, input[type="text"] {
  width: 100%; font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; resize: vertical;
}
textarea:focus, input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 220px; line-height: 1.5; }

/* ---- utility ---- */
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.spin { width: 18px; height: 18px; border: 2.5px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition: none !important; } }

.footer { border-top: 1px solid var(--line); color: var(--faint); font-size: .85rem; padding: 32px 0 48px; }
.footer a { color: var(--muted); }

/* ---- passcode modal ---- */
.cw-modal { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, #000 55%, transparent); display: grid; place-items: center; padding: 20px; }
.cw-modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px; max-width: 380px; width: 100%; }
.cw-modal-box h3 { font-size: 1.2rem; margin-bottom: 8px; }
.cw-modal-box p { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.cw-modal-box input { margin-bottom: 16px; }
.cw-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
