/* ==========================================================================
   Fractional DevRel — advocate application design system (SHARED)
   --------------------------------------------------------------------------
   The single stylesheet every advocate-app page imports. It holds the design
   TOKENS and the components shared across the directory, account, auth, admin,
   dashboard and notifications screens — everything that used to be copy-pasted
   into each mockup's inline <style>. Page-specific rules stay in that page's
   own <style> block; anything here is, by definition, used by more than one.

   Authored to BRAND_STYLE.md — read it before changing a token or adding a
   component. Rules of the system: three colours only (bone / black /
   ultramarine), Funnel Display + DM Sans, no rounded corners, no shadows,
   no gradients, no tints, 1.5px rules.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  /* palette — three colours, no fourth */
  --bone: #f4f4f2;
  --black: #000000;
  --ultra: #2241ff;
  /* supporting neutrals */
  --bone-deep: #ebebe7;
  --ink: #0a0a0a;
  --mute: #6b7280;
  /* state colours — the ONLY sanctioned exception to the three-colour rule, and
     only ever for machine states a person must act on (a failed submit, a risky
     action). Never decorative: if it isn't failure or warning, it's ultramarine.
     --fail carries text directly (5.9:1 on bone, the same weight as --ultra).
     --warn CANNOT carry text (1.7:1) — use it as a fill/spine with black on top
     (11.3:1) and reach for --warn-ink (6.3:1) when warning text must stand alone. */
  --fail: #b3261e;
  --warn: #f5b301;
  --warn-ink: #7a5200;
  /* structure */
  --rule: 1.5px solid var(--black);
  --hair: 1.5px solid var(--black);
  --maxw: 1280px;
  /* rendered height of the shared header (one row), for sticky bars below it */
  --header-h: 87.4px;
}

/* ---------- reset + base ---------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bone);
  color: var(--black);
  font-family:
    "DM Sans",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

/* display face — never below 18px, always negative tracking */
h1,
h2,
h3,
h4,
.disp {
  font-family: "Funnel Display", "DM Sans", system-ui, sans-serif;
  font-weight: 800;
  margin: 0;
}
h1 {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
/* h1 is set at line-height 0.9 with no margin, so a lede straight after it sat flush
   against the heading (and against the descenders of a wrapped title). */
h1 + .lede {
  margin-top: 20px;
}
h2 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 700;
}
h3 {
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}
h4 {
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
a {
  color: var(--black);
}

/* focus — the ultramarine ring is the one interaction accent */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ultra);
  outline-offset: 2px;
}
::selection {
  background: var(--ultra);
  color: var(--bone);
}

/* ---------- meta label — the only caps in the system ---------- */
.meta {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
  line-height: 1.4;
}
.num {
  font-family: "Funnel Display";
  font-weight: 800;
  color: var(--ultra);
  letter-spacing: -0.02em;
}

/* section marker:  01 ───────── SECTION NAME */
.marker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.marker .n {
  font-family: "DM Sans";
  font-weight: 700;
  font-size: 12px;
  color: var(--ultra);
}
.marker .r {
  width: 80px;
  height: 1px;
  background: var(--black);
  flex: none;
}
.marker .t {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}

/* ---------- round logo mark + wordmark lockup ---------- */
.lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}
.lockup-mark {
  display: block;
  width: 40px;
  height: 40px;
  flex: none;
}
.wordmark {
  font-family: "Funnel Display";
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--black);
}

/* ---------- header ---------- */
header {
  border-bottom: var(--rule);
  background: var(--bone);
  padding: 20px 48px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 60;
  /* one-row height is the same whether or not the page has a Join button */
  min-height: var(--header-h);
}
header .crumb {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
}
.count {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--mute);
}
.count b {
  color: var(--black);
  font-weight: 700;
}

/* auth actions in header */
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signin {
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  padding: 10px 14px;
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.signin:hover {
  color: var(--ultra);
}
.joinbtn {
  font-size: 14px;
  font-weight: 500;
  background: var(--black);
  color: var(--bone);
  text-decoration: none;
  padding: 11px 22px;
  white-space: nowrap;
  border: 1.5px solid var(--black);
}
.joinbtn:hover {
  background: var(--ultra);
  border-color: var(--ultra);
  color: var(--bone);
}
.joinshort {
  display: none;
}

/* ---------- shared header layout (every app and blog page) ---------- */
/* One header everywhere: [mark + wordmark + crumb] on the left, the nav cluster
   right-aligned. Pages must not restyle these; page-specific header chrome (the
   .count, the signed-in .avlink) lives inside the same two zones. */
header .auth-actions {
  margin-left: auto;
}
header .count {
  margin-left: 0;
}
@media (max-width: 860px) {
  :root {
    --header-h: 79.4px;
  }
  header {
    padding: 16px 24px;
  }
  header .count {
    display: none;
  }
  header .joinlong {
    display: none;
  }
  header .joinshort {
    display: inline;
  }
  header .joinbtn {
    padding: 11px 16px;
  }
}
@media (max-width: 520px) {
  /* Phone: lockup and crumb stay on the first row (a 40px mark with the desktop
     gaps would push the crumb onto its own line, so step the mark down and
     tighten the gaps). The nav items live in the menu-bar dropdown below. */
  header {
    column-gap: 12px;
  }
  header .lockup {
    gap: 6px;
  }
  header .lockup-mark {
    width: 36px;
    height: 36px;
  }
}

/* ---------- collapsible nav: menu-bar button + dropdown ---------- */
/* When the nav items do not fit on one row beside the logo (always at phone
   width, 860px and under), every item folds into one dropdown behind a
   menu-bar button. app/supabase.js wireMobileNav adds the button and sets
   header.navcollapsed after measuring. The header is sticky, so it
   anchors the dropdown. */
.navtoggle {
  display: none;
}
/* Before the script has measured (first paint on a phone), keep the row hidden
   rather than flash every link. */
@media (max-width: 860px) {
  header:not(.navready) .auth-actions {
    display: none;
  }
}
header.navcollapsed .navtoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: var(--rule);
  color: var(--black);
  cursor: pointer;
}
header.navcollapsed .navtoggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
header.navcollapsed .navtoggle:hover,
header.navcollapsed.navopen .navtoggle {
  background: var(--black);
  color: var(--bone);
}
/* Collapsed, the header is one row: [lockup][crumb…][menu button]. A long crumb
   ("Account settings") shortens with an ellipsis rather than pushing the button
   onto a second row. */
header.navcollapsed {
  flex-wrap: nowrap;
}
header.navcollapsed .lockup,
header.navcollapsed .navtoggle {
  flex: none;
}
header.navcollapsed .crumb {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
header.navcollapsed .auth-actions {
  display: none;
}
header.navcollapsed.navopen .auth-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: absolute;
  top: 100%;
  right: 0;
  width: min(320px, 100%);
  margin: 0;
  background: var(--bone);
  border: var(--rule);
  border-top: 0;
  z-index: 61;
}
header.navcollapsed.navopen .auth-actions > * {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 14px 20px;
  font-size: 15px;
  text-align: left;
  border: 0;
  border-top: var(--rule);
}
header.navcollapsed.navopen .auth-actions > * {
  justify-content: flex-start;
}
/* Pages that show a plain (non-link) account chip keep it chip-sized. */
header.navcollapsed.navopen .auth-actions > .avatar {
  align-self: flex-start;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 12px 20px;
  border: 1.5px solid var(--black);
}
header.navcollapsed.navopen .auth-actions > :first-child {
  border-top: 0;
}
header.navcollapsed.navopen .auth-actions .signin:hover,
header.navcollapsed.navopen .auth-actions .bell:hover,
header.navcollapsed.navopen .auth-actions .avatar-link:hover,
header.navcollapsed.navopen .auth-actions .avlink:hover {
  background: var(--black);
  color: var(--bone);
}
header.navcollapsed.navopen .auth-actions .joinlong {
  display: inline;
}
header.navcollapsed.navopen .auth-actions .joinshort {
  display: none;
}
/* Icon-only items get a text label inside the dropdown. */
header.navcollapsed.navopen .auth-actions .bell::after {
  content: "Notifications";
  font-size: 15px;
  font-weight: 500;
}
header.navcollapsed.navopen .auth-actions .avatar-link {
  color: var(--black);
}
header.navcollapsed.navopen .auth-actions .notifdot {
  position: static;
}
header.navcollapsed.navopen .auth-actions .avatar-link::after {
  content: "Your account";
  font-size: 15px;
  font-weight: 500;
}

/* ---------- buttons ---------- */
.btn {
  font-family: "DM Sans";
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--black);
  padding: 13px 22px;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover {
  background: var(--black);
  color: var(--bone);
}
.btn.solid {
  background: var(--black);
  color: var(--bone);
}
.btn.solid:hover {
  background: var(--ultra);
  border-color: var(--ultra);
}
.btn.full {
  width: 100%;
  text-align: center;
  padding: 16px;
}
.btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn.danger {
  border-color: var(--black);
  color: var(--black);
}
.btn.danger:hover {
  background: var(--black);
  color: var(--bone);
}
/* Destructive actions (account deletion). Resting state matches every other solid
   button — red only on hover/focus, at the moment of commitment, so the colour
   reads as "this one is different" rather than decorating the page. */
.btn.solid.danger {
  background: var(--black);
  color: var(--bone);
}
.btn.solid.danger:hover,
.btn.solid.danger:focus-visible {
  background: var(--fail);
  border-color: var(--fail);
}

/* ---------- forms ---------- */
label.f {
  display: block;
  margin-bottom: 20px;
}
label.f .lb {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
  margin-bottom: 8px;
}
label.f .lb a {
  font-size: 12px;
  color: var(--ultra);
  text-transform: none;
  letter-spacing: 0;
}
.inp {
  width: 100%;
  border: 1.5px solid var(--black);
  background: transparent;
  padding: 15px 18px;
  font-family: "DM Sans";
  font-size: 15px;
  color: var(--black);
}
.inp:focus {
  outline: none;
  border-color: var(--ultra);
}
.inp::placeholder {
  color: var(--mute);
}
textarea.inp {
  resize: vertical;
  min-height: 92px;
  line-height: 1.6;
}
select.inp {
  cursor: pointer;
}
.help {
  font-size: 13px;
  color: var(--mute);
  margin-top: 7px;
  line-height: 1.55;
}
.err {
  font-size: 13px;
  color: var(--fail);
  font-weight: 500;
  margin-top: 7px;
  display: none;
}
.inp.bad {
  border-color: var(--fail);
}
.inp.bad + .err {
  display: block;
}

/* ---------- status notice (auth forms + anywhere a submit can be rejected) ----
   Progress stays quiet helper text; a failure gets boxed so it cannot be read as
   a caption under the button. Pair with role="alert" in the markup. Shape:
     <div class="notice error"><span class="why">Reason.</span>
                               <span class="fix">What to do next.</span></div>  */
.notice[hidden] {
  display: none;
}
.notice {
  margin-top: 12px;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.55;
}
.notice.error,
.notice.warn {
  border: 1.5px solid var(--black);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--black);
}
.notice.error {
  border-left: 4px solid var(--fail);
}
.notice.warn {
  border-left: 4px solid var(--warn);
}
.notice .why {
  display: block;
  font-weight: 700;
}
.notice.error .why {
  color: var(--fail);
}
.notice.warn .why {
  color: var(--warn-ink);
}
.notice .fix {
  display: block;
  margin-top: 4px;
  color: var(--mute);
  font-size: 13px;
}
.check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 14px;
  margin-bottom: 14px;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ultra);
  margin: 3px 0 0;
  flex: none;
  cursor: pointer;
}
.check a {
  color: var(--ultra);
}

/* ---------- tags / pills — sharp, not rounded ---------- */
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--black);
  padding: 3px 9px;
  margin: 0 5px 5px 0;
  color: var(--black);
}
.tag.q {
  border-color: var(--mute);
  color: var(--mute);
}

/* champion badge — ultramarine, the accent's job */
.champ {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ultra);
  color: var(--ultra);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  margin: 0 5px 5px 0;
  white-space: nowrap;
}
.champ svg {
  width: 9px;
  height: 9px;
  flex: none;
}
.champ .kind {
  color: var(--mute);
}

/* availability */
.avail {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.avail.open {
  color: var(--ultra);
}
.avail.soon {
  color: var(--black);
}
.avail.full {
  color: var(--mute);
}
.dotline::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: currentColor;
  margin-right: 7px;
  vertical-align: 1px;
}

/* social icon links — 1.5px stroke, no fill, sharp */
.socials {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}
.soc {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  text-decoration: none;
}
.soc svg {
  width: 13px;
  height: 13px;
}
.soc:hover {
  background: var(--ultra);
  border-color: var(--ultra);
  color: var(--bone);
}
.socials.lg .soc {
  width: 34px;
  height: 34px;
}
.socials.lg .soc svg {
  width: 15px;
  height: 15px;
}

/* ---------- utility ---------- */
.hidden {
  display: none !important;
}

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

/* ---------- signed-in header chrome (shared) ----------------------------- */
/* Account chip: image layered over centred initials, so a missing or broken
   avatar falls back to initials instead of an empty box. Pages that define their
   own .avatar (account, notifications) still win — their <style> loads after this. */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1.5px solid var(--black);
  background: var(--ultra);
  overflow: hidden;
  font-family: "Funnel Display";
  font-weight: 800;
  font-size: 13px;
  color: var(--bone);
  line-height: 1;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-link {
  display: inline-flex;
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Site footer — the same strip on every app page (and mirrored in
   blog/styles.css). The home for low-traffic links that don't earn a header
   slot: Privacy first, because it must be reachable from every page.
   --------------------------------------------------------------------------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: var(--rule);
  padding: 24px 28px 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  font-size: 13px;
  color: var(--mute);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.site-footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.site-footer a:hover {
  color: var(--ultra);
}
@media (max-width: 720px) {
  .site-footer {
    padding: 20px 16px 28px;
  }
}
