/* ============================================================================
   FOUNDERS ALLEY APP · COMPONENTS
   The pieces every screen is built from. Cards are hard-edged; pills,
   avatars and buttons carry the rounding. Category color shows up as a rule,
   a chip or a mark, never as a wash across a card.
   ========================================================================== */

/* ------------------------------------------------------------------ buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:var(--tap); padding:0 18px; border-radius:var(--r-md);
  font-weight:700; font-size:var(--fs-15); line-height:1; white-space:nowrap;
  border:1.5px solid transparent; transition:transform var(--dur-1) var(--ease), background var(--dur-1), border-color var(--dur-1);
  user-select:none;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--ink-900); color:#fff; }
.btn-primary:hover{ background:var(--ink-800); }
.btn-accent{ background:var(--magenta-press); color:#fff; }
.btn-accent:hover{ background:var(--magenta-ink); }
.btn-events{ background:var(--orange); color:var(--ink-900); }
.btn-secondary{ background:var(--surface); color:var(--ink-900); border-color:var(--border-strong); }
.btn-secondary:hover{ background:var(--ink-50); }
.btn-ghost{ background:transparent; color:var(--ink-900); }
.btn-ghost:hover{ background:var(--ink-100); }
.btn-danger{ background:var(--surface); color:var(--bad); border-color:var(--bad); }
.btn-sm{ min-height:36px; padding:0 14px; font-size:var(--fs-14); border-radius:var(--r-sm); }
.btn-block{ width:100%; }
.btn-pill{ border-radius:var(--r-pill); }
.btn .ic{ width:18px; height:18px; }
.btn:disabled{ opacity:.5; }

.iconbtn{
  display:inline-flex; align-items:center; justify-content:center;
  width:var(--tap); height:var(--tap); border-radius:var(--r-pill); color:var(--ink-900); position:relative;
  transition:background var(--dur-1);
}
.iconbtn:hover{ background:var(--ink-100); }
.iconbtn .ic{ width:24px; height:24px; }
.iconbtn .dot{ position:absolute; top:9px; right:9px; min-width:18px; height:18px; padding:0 5px; border-radius:var(--r-pill);
  background:var(--magenta); color:#fff; font-size:11px; font-weight:700; line-height:18px; text-align:center; box-shadow:0 0 0 2px var(--surface); }

.ic{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }

/* --------------------------------------------------------------------- chips */
.chip{
  display:inline-flex; align-items:center; gap:6px;
  min-height:30px; padding:0 12px; border-radius:var(--r-pill);
  font-size:var(--fs-14); font-weight:500; line-height:1; white-space:nowrap;
  background:var(--ink-100); color:var(--ink-700); border:1px solid transparent;
}
.chip-sm{ min-height:26px; padding:0 10px; font-size:var(--fs-13); }
.chip-people{ background:var(--c-people-50); color:var(--c-people-ink); }
.chip-events{ background:var(--c-events-50); color:var(--c-events-ink); }
.chip-content{ background:var(--c-content-50); color:var(--c-content-ink); }
.chip-capital{ background:var(--c-capital-50); color:var(--c-capital-ink); }
.chip-services{ background:var(--c-services-50); color:var(--c-services-ink); }
.chip-outline{ background:var(--surface); border-color:var(--border-strong); color:var(--ink-700); }
.chip-good{ background:var(--good-50); color:var(--good); }
.chip-attention{ background:var(--attention-50); color:var(--attention); }
.chip-bad{ background:var(--bad-50); color:var(--bad); }
.chip-ink{ background:var(--ink-900); color:#fff; }
.chip .ic{ width:14px; height:14px; }
.chip-row{ display:flex; flex-wrap:wrap; gap:8px; }

/* selectable chips (onboarding, filters, intent editing) */
.chip-select{ display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; min-height:var(--tap); padding:0 20px; border-radius:var(--r-pill); font-size:var(--fs-15); font-weight:500; line-height:1.2; white-space:nowrap; background:var(--surface); border:1.5px solid var(--border-strong); color:var(--ink-700); transition:all var(--dur-1); }
.chip-select:hover{ border-color:var(--ink-500); }
.chip-select[aria-pressed="true"]{ background:var(--ink-900); border-color:var(--ink-900); color:#fff; }
.chip-select[aria-pressed="true"].tone-people{ background:var(--magenta-press); border-color:var(--magenta-press); }
.chip-select[aria-pressed="true"].tone-capital{ background:var(--gold); border-color:var(--gold); color:var(--ink-900); }
.chip-select[aria-pressed="true"].tone-services{ background:var(--cyan); border-color:var(--cyan); color:var(--ink-900); }
.chip-select[aria-pressed="true"].tone-events{ background:var(--orange); border-color:var(--orange); color:var(--ink-900); }
.chip-select .ic{ width:16px; height:16px; flex:none; }

/* ------------------------------------------------------------------- avatars */
.avatar{
  display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:44px; height:44px; border-radius:var(--r-pill);
  font-family:var(--font-display); font-size:18px; letter-spacing:.02em; color:#fff;
  background:var(--ink-700);
}
.avatar-sm{ width:32px; height:32px; font-size:13px; }
.avatar-lg{ width:64px; height:64px; font-size:26px; }
.avatar-xl{ width:96px; height:96px; font-size:38px; }
.avatar.a-purple{ background:var(--purple); } .avatar.a-magenta{ background:var(--magenta); color:var(--ink-900); }
.avatar.a-orange{ background:var(--orange); color:var(--ink-900); } .avatar.a-amber{ background:var(--amber); color:var(--ink-900); }
.avatar.a-gold{ background:var(--gold); color:var(--ink-900); } .avatar.a-cyan{ background:var(--cyan); color:var(--ink-900); }
.avatar.a-ink{ background:var(--ink-900); }
.avatar-team{ background:var(--surface); box-shadow:inset 0 0 0 1.5px var(--border); }
.avatar-team img{ width:56%; height:auto; }
.avatar-stack{ display:inline-flex; }
.avatar-stack .avatar{ box-shadow:0 0 0 2px var(--surface); margin-left:-10px; }
.avatar-stack .avatar:first-child{ margin-left:0; }

/* Signal tier mark: a small square, word beside it. Nobody sees a score. */
.tier{ display:inline-flex; align-items:center; gap:6px; font-size:var(--fs-13); font-weight:700; color:var(--ink-600); letter-spacing:.04em; text-transform:uppercase; }
.tier::before{ content:""; width:10px; height:10px; background:var(--ink-300); }
.tier-member::before{ background:var(--ink-500); }
.tier-regular::before{ background:var(--magenta); }
.tier-pillar::before{ background:var(--ink-900); box-shadow:2px 2px 0 var(--magenta); }

.mark{ display:inline-flex; align-items:center; gap:6px; font-size:var(--fs-13); font-weight:500; color:var(--ink-600); padding:4px 10px; border:1px solid var(--border); border-radius:var(--r-sm); background:var(--surface); }
.mark .ic{ width:14px; height:14px; color:var(--good); }

/* --------------------------------------------------------------------- cards */
.card{ min-width:0; background:var(--surface); box-shadow:var(--shadow-1); border-radius:var(--r-0); position:relative; }
.card-pad{ padding:var(--s-4); }
.card-rule{ border-left:4px solid var(--ink-300); }
.card-rule.rule-events{ border-left-color:var(--c-events); }
.card-rule.rule-people{ border-left-color:var(--c-people); }
.card-rule.rule-content{ border-left-color:var(--c-content); }
.card-rule.rule-capital{ border-left-color:var(--c-capital); }
.card-rule.rule-services{ border-left-color:var(--c-services); }
.card-link{ display:block; transition:box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); }
.card-link:hover{ box-shadow:var(--shadow-2); }
.card-link:active{ transform:scale(.995); }

.section-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:var(--s-6) 0 var(--s-3); }
.section-head .display{ font-size:var(--fs-22); }
.section-head .more{ font-size:var(--fs-14); font-weight:700; color:var(--c-people-ink); min-height:var(--tap); display:inline-flex; align-items:center; }
.section-head:first-child{ margin-top:0; }

/* ---------------------------------------------------------------------- rows */
.row{ display:flex; align-items:center; gap:12px; min-height:var(--tap); padding:12px var(--s-4); background:var(--surface); }
.row + .row{ border-top:1px solid var(--border); }
.row-link{ transition:background var(--dur-1); }
.row-link:hover{ background:var(--ink-50); }
.row .grow{ flex:1; min-width:0; }
.row .title{ font-weight:700; color:var(--ink-900); font-size:var(--fs-15); }
.row .sub{ font-size:var(--fs-14); color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row .chev{ color:var(--text-faint); }
.list{ background:var(--surface); box-shadow:var(--shadow-1); }

/* ---------------------------------------------------------------------- forms */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:var(--fs-14); font-weight:700; color:var(--ink-900); }
.field .hint{ font-size:var(--fs-13); color:var(--text-muted); }
.input{
  width:100%; min-height:48px; padding:12px 14px; font-size:var(--fs-16);
  background:var(--surface); border:1.5px solid var(--border-strong); border-radius:var(--r-md); color:var(--ink-900);
  transition:border-color var(--dur-1), box-shadow var(--dur-1);
}
.input:focus{ outline:none; border-color:var(--ink-900); box-shadow:0 0 0 3px var(--cyan-100); }
.input::placeholder{ color:var(--ink-400); }
textarea.input{ min-height:110px; resize:vertical; line-height:var(--lh-body); }
.input-code{ font-family:var(--font-display); font-size:var(--fs-30); letter-spacing:.18em; text-align:center; text-transform:uppercase; min-height:64px; }
.search{ position:relative; }
.search .ic{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-faint); }
.search .input{ padding-left:44px; border-radius:var(--r-pill); }

.toggle{ display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:var(--tap); }
.toggle > :first-child{ flex:1; min-width:0; }
.toggle > .segments{ flex:none; }
/* A label with a segmented control under it, so three options never crowd a phone row. */
.toggle-wrap{ flex-wrap:wrap; padding:6px 0; }
.toggle-wrap > :first-child{ flex-basis:100%; }
.toggle-wrap > .segments{ flex:1; }
.switch{ position:relative; width:48px; height:28px; border-radius:var(--r-pill); background:var(--ink-300); transition:background var(--dur-2); flex:none; }
.switch::after{ content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform var(--dur-2) var(--ease); }
.switch[aria-checked="true"]{ background:var(--good); }
.switch[aria-checked="true"]::after{ transform:translateX(20px); }

/* ------------------------------------------------------------------ segments */
.segments{ display:flex; gap:4px; padding:4px; background:var(--ink-100); border-radius:var(--r-md); }
.segments button{ flex:1; min-height:40px; padding:0 14px; border-radius:6px; text-align:center; white-space:nowrap; font-weight:700; font-size:var(--fs-14); color:var(--ink-600); transition:all var(--dur-1); }
.segments button[aria-selected="true"]{ background:var(--surface); color:var(--ink-900); box-shadow:0 1px 2px rgba(11,11,30,.12); }

.filterbar{ display:flex; gap:8px; overflow-x:auto; padding:2px 0 8px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.filterbar::-webkit-scrollbar{ display:none; }
.filterbar .chip-select{ min-height:40px; padding:0 18px; flex:none; }

/* ---------------------------------------------------------------- empty state */
.empty{ padding:var(--s-8) var(--s-4); text-align:center; color:var(--text-muted); }
.empty .display{ font-size:var(--fs-22); margin-bottom:6px; }
.empty .ic{ width:40px; height:40px; margin:0 auto 12px; color:var(--text-faint); }

/* ------------------------------------------------------------------- skeleton */
.skel{ background:linear-gradient(90deg,var(--ink-100) 25%,var(--ink-50) 50%,var(--ink-100) 75%); background-size:200% 100%; animation:skel 1.2s linear infinite; border-radius:var(--r-sm); }
@keyframes skel{ to{ background-position:-200% 0; } }
@media (prefers-reduced-motion:reduce){ .skel{ animation:none; } }

/* -------------------------------------------------------------- sheet / modal */
.overlay{ position:fixed; inset:0; z-index:60; background:rgba(11,11,30,.45); display:flex; align-items:flex-end; justify-content:center; animation:fade var(--dur-2) var(--ease); }
.sheet{ width:100%; max-height:92dvh; overflow:auto; background:var(--surface); border-radius:var(--r-lg) var(--r-lg) 0 0; box-shadow:var(--shadow-3); animation:rise var(--dur-3) var(--ease); padding-bottom:env(safe-area-inset-bottom); }
.sheet-head{ position:sticky; top:0; background:var(--surface); display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px var(--s-4) 10px; border-bottom:1px solid var(--border); z-index:1; }
.sheet-head .display{ font-size:var(--fs-22); }
.sheet-body{ padding:var(--s-4); display:flex; flex-direction:column; gap:var(--s-4); }
.sheet-grab{ width:40px; height:4px; border-radius:var(--r-pill); background:var(--ink-300); margin:10px auto 0; }
@keyframes rise{ from{ transform:translateY(24px); opacity:0; } }
@keyframes fade{ from{ opacity:0; } }
@media (min-width:1000px){
  .overlay{ align-items:center; }
  .sheet{ width:min(560px,92vw); max-height:86vh; border-radius:var(--r-lg); }
  .sheet-grab{ display:none; }
}

/* --------------------------------------------------------------------- toast */
.toasts{ position:fixed; left:50%; bottom:calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:70; display:flex; flex-direction:column; gap:8px; width:min(420px,calc(100vw - 32px)); pointer-events:none; }
.toast{ background:var(--ink-900); color:#fff; padding:12px 16px; border-radius:var(--r-md); font-size:var(--fs-15); font-weight:500; box-shadow:var(--shadow-3); display:flex; gap:10px; align-items:center; animation:rise var(--dur-3) var(--ease); pointer-events:auto; }
.toast .ic{ color:var(--cyan); }
@media (min-width:1000px){ .toasts{ bottom:24px; } }

/* ------------------------------------------------------------- media blocks */
.poster{ position:relative; aspect-ratio:16/9; background:var(--ink-900); overflow:hidden; display:flex; align-items:flex-end; }
.poster svg.art, .poster img.photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
img.photo{ display:block; width:100%; height:100%; object-fit:cover; transform-origin:center; }
.poster:has(.caption)::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:60%; background:linear-gradient(180deg,rgba(11,11,30,0),rgba(11,11,30,.8)); }
.poster .play{ z-index:2; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:64px; height:64px; border-radius:50%; background:#fff; color:var(--ink-900); display:flex; align-items:center; justify-content:center; box-shadow:var(--shadow-3); }
.poster .play .ic{ width:28px; height:28px; margin-left:3px; fill:currentColor; stroke:none; }
.poster .caption{ z-index:1; position:relative; padding:14px 16px; color:#fff; font-weight:700; font-size:var(--fs-15); text-shadow:0 1px 2px rgba(0,0,0,.5); }

.cover{ position:relative; aspect-ratio:3/1; background:var(--ink-900); overflow:hidden; }
.cover svg, .cover img.photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }

/* ----------------------------------------------------------------- misc */
.stat{ display:flex; flex-direction:column; gap:2px; }
.stat .num{ font-family:var(--font-display); font-size:var(--fs-30); line-height:1; color:var(--ink-900); }
.stat .lbl{ font-size:var(--fs-13); color:var(--text-muted); font-weight:500; }
.divider{ height:1px; background:var(--border); }
.kicker{ font-size:var(--fs-13); font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.kicker.k-events{ color:var(--c-events-ink); } .kicker.k-people{ color:var(--c-people-ink); } .kicker.k-content{ color:var(--c-content-ink); } .kicker.k-capital{ color:var(--c-capital-ink); } .kicker.k-services{ color:var(--c-services-ink); }
.pullmeter{ height:6px; background:var(--ink-100); overflow:hidden; }
.pullmeter > span{ display:block; height:100%; background:var(--magenta); }
.ramp{ height:4px; background:var(--ramp); }
.note{ font-size:var(--fs-14); color:var(--text-muted); line-height:var(--lh-body); }
.callout{ padding:14px 16px; border-left:4px solid var(--ink-900); background:var(--surface); box-shadow:var(--shadow-1); font-size:var(--fs-15); }
.callout.c-people{ border-left-color:var(--magenta); background:var(--c-people-50); box-shadow:none; }
.callout.c-events{ border-left-color:var(--orange); background:var(--c-events-50); box-shadow:none; }
.callout.c-content{ border-left-color:var(--purple); background:var(--c-content-50); box-shadow:none; }
.callout.c-services{ border-left-color:var(--cyan); background:var(--c-services-50); box-shadow:none; }
.inline-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.spread{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.stack{ display:flex; flex-direction:column; gap:var(--s-3); }
.stack > *{ min-width:0; }
.stack-lg{ gap:var(--s-5); }
