/* WAAN crew hub — same house style as the direction review pages:
   Host Grotesk + Red Hat Mono, 2px rules, light and dark.
   #2B4BFF is the interaction colour, which is what the September
   research concluded it actually is. */

:root {
  --page: #F6F6F3;
  --surface: #FFFFFF;
  --sunk: #F0F0EC;
  --ink: #131313;
  --muted: #63665F;
  --rule: #D7D9D2;
  --blue: #2B4BFF;
  --good: #1C7A45;
  --warn: #B4521A;
  --gutter: clamp(16px, 4vw, 44px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121310;
    --surface: #1B1D19;
    --sunk: #16180F;
    --ink: #F2F2EC;
    --muted: #9DA096;
    --rule: #34372F;
    --blue: #8B9DFF;
    --good: #6FD39B;
    --warn: #E8A06B;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: 'Host Grotesk', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.025em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }

.mono {
  font-family: 'Red Hat Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- shell ---------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.top-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand b { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; }
nav.tabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
nav.tabs a {
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
nav.tabs a:hover { background: var(--sunk); color: var(--ink); }
nav.tabs a[aria-current='page'] { background: var(--ink); color: var(--page); }
nav.tabs a .pip {
  display: inline-block;
  min-width: 17px;
  margin-left: 6px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--blue);
  color: #FFF;
  font-family: 'Red Hat Mono', monospace;
  font-size: 10px;
  text-align: center;
  vertical-align: 1px;
}
nav.tabs a[aria-current='page'] .pip { background: var(--page); color: var(--ink); }

.who { display: flex; align-items: center; gap: 9px; }
.who img { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; display: block; }
.who .nm { font-size: 13px; font-weight: 600; }
.who button {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  font-family: 'Red Hat Mono', monospace; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.who button:hover { color: var(--ink); text-decoration: underline; }

main { max-width: 1280px; margin: 0 auto; padding: clamp(20px, 3vw, 36px) var(--gutter) 120px; }

.band {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin: clamp(28px, 4vw, 44px) 0 18px;
  padding-bottom: 5px; border-bottom: 2px solid var(--ink);
}
.band:first-child { margin-top: 0; }
.band h2 { font-size: 18px; font-weight: 700; }
.band p { font-size: 14px; color: var(--muted); }
.band .sp { flex: 1; }

h1.page { font-size: clamp(26px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; }
p.lead { max-width: 72ch; margin-top: 10px; color: var(--muted); }

/* ---------- blocks ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.card.flat { border-width: 1px; border-color: var(--rule); }
.card h3 { font-size: 17px; font-weight: 700; }
.card .sub { font-size: 13.5px; color: var(--muted); }
.card .body { font-size: 15px; }

.rows { border-top: 1px solid var(--rule); }
.row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 2px; border-bottom: 1px solid var(--rule);
}
.row .grow { flex: 1; min-width: 0; }
.row .ttl { font-size: 15.5px; font-weight: 600; }
.row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row.done .ttl { text-decoration: line-through; color: var(--muted); }

.tag {
  display: inline-block;
  font-family: 'Red Hat Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--muted); white-space: nowrap;
}
.tag.open { border-color: var(--warn); color: var(--warn); }
.tag.decided { border-color: var(--good); color: var(--good); }
.tag.mine { border-color: var(--blue); color: var(--blue); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  padding: 8px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; border-radius: 0;
}
.btn:hover { background: var(--ink); color: var(--page); }
.btn.primary { background: var(--ink); color: var(--page); }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); color: #FFF; }
.btn.small { padding: 5px 10px; font-size: 13px; border-width: 1px; border-color: var(--rule); }
.btn.small:hover { border-color: var(--ink); }
.btn.on { background: var(--blue); border-color: var(--blue); color: #FFF; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input[type='text'], input[type='password'], textarea, select {
  width: 100%; background: var(--surface); border: 1px solid var(--rule);
  padding: 10px 12px; font-size: 15px; border-radius: 0;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
label.fld { display: block; }
label.fld > span { display: block; margin-bottom: 5px; }

.empty { color: var(--muted); font-size: 14.5px; padding: 18px 2px; }
.err { color: var(--warn); font-size: 14px; }

/* ---------- vote ---------- */

.dir { border: 2px solid var(--ink); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.dir .top-row { padding: 16px 18px 0; }
.dir h3 { font-size: 23px; font-weight: 800; letter-spacing: -0.03em; }
.dir .pitch { padding: 0 18px; font-size: 14.5px; }
.dir dl { margin: 0; padding: 0 18px; display: grid; grid-template-columns: 62px 1fr; gap: 3px 12px; font-size: 13.5px; }
.dir dt { font-family: 'Red Hat Mono', monospace; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.dir dd { margin: 0; }
.sw { display: inline-flex; gap: 4px; vertical-align: -3px; }
.sw i { width: 15px; height: 15px; border: 1px solid var(--rule); display: block; }
.pro { padding: 0 18px; font-size: 13.5px; color: var(--muted); }
.pro b { color: var(--ink); font-weight: 600; }
.dir .foot { margin-top: auto; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; align-items: center; gap: 9px; }
.bar .track { flex: 1; height: 8px; background: var(--sunk); border: 1px solid var(--rule); }
.bar .fill { height: 100%; background: var(--blue); }
.bar .n { font-family: 'Red Hat Mono', monospace; font-size: 12px; color: var(--muted); min-width: 56px; text-align: right; }
.voters { display: flex; gap: 5px; flex-wrap: wrap; }
.voters img { width: 22px; height: 22px; border-radius: 999px; object-fit: cover; display: block; }
.voters span.vn { font-family: 'Red Hat Mono', monospace; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); align-self: center; }

/* ---------- notes ---------- */

.note { display: flex; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--rule); }
.note img.av { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; flex: none; display: block; }
.note .av-f {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  background: var(--sunk); border: 1px solid var(--rule);
  display: grid; place-items: center;
  font-family: 'Red Hat Mono', monospace; font-size: 11px; color: var(--muted);
}
.note .nb { flex: 1; min-width: 0; }
.note .nh { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.note .nh b { font-size: 14px; font-weight: 700; }
.note .nh time { font-family: 'Red Hat Mono', monospace; font-size: 11px; color: var(--muted); }
.note .nt { font-size: 15px; white-space: pre-wrap; overflow-wrap: break-word; margin-top: 3px; }
.note .x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 4px; }
.note .x:hover { color: var(--warn); }

/* ---------- crew ---------- */

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.person { border: 1px solid var(--rule); background: var(--surface); padding: 14px; text-align: center; }
.person img { width: 74px; height: 74px; border-radius: 999px; object-fit: cover; margin: 0 auto 10px; display: block; }
.person h4 { font-size: 15px; font-weight: 700; }
.person p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- reader ---------- */

.reader { max-width: 74ch; }
.reader h1, .reader h2, .reader h3 { margin: 1.4em 0 0.4em; letter-spacing: -0.02em; }
.reader h1 { font-size: 30px; }
.reader h2 { font-size: 21px; }
.reader h3 { font-size: 17px; }
.reader p, .reader ul, .reader ol, .reader blockquote, .reader table { margin: 0.85em 0; }
.reader ul, .reader ol { padding-left: 22px; }
.reader li { margin: 0.3em 0; }
.reader code { font-family: 'Red Hat Mono', monospace; font-size: 0.88em; background: var(--sunk); padding: 1px 4px; }
.reader pre { background: var(--sunk); padding: 12px 14px; overflow-x: auto; }
.reader pre code { background: none; padding: 0; }
.reader blockquote { border-left: 3px solid var(--rule); padding-left: 14px; color: var(--muted); }
.reader table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.reader th, .reader td { border: 1px solid var(--rule); padding: 7px 9px; text-align: left; vertical-align: top; }
.reader img { max-width: 100%; height: auto; }
.reader a { color: var(--blue); }

/* ---------- sign in ---------- */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .box { width: 100%; max-width: 400px; border: 2px solid var(--ink); background: var(--surface); padding: 26px; }
.gate h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.gate p { font-size: 14.5px; color: var(--muted); margin: 10px 0 18px; }
.gate .acts { margin-top: 14px; }

/* ---------- misc ---------- */

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--ink); color: var(--page);
  padding: 10px 18px; font-size: 14px; font-weight: 600;
  z-index: 200; box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.frame { width: 100%; height: min(78vh, 900px); border: 2px solid var(--ink); background: var(--page); display: block; }
.skel { color: var(--muted); padding: 40px 2px; font-size: 15px; }

@media (max-width: 760px) {
  .top-in { gap: 10px; }
  nav.tabs { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .who { order: 2; }
  .brand { order: 1; flex: 1; }
  .cards, .cards.two { grid-template-columns: 1fr; }
}
@media print { header.top { display: none; } }
