/* SlopKit relay console.
   Same world as the prototypes: near-black ground, one lime accent for state and
   action, phase color only on status chips. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #0a0c0f;
  --surface: #10141a;
  --surface-2: #151b22;
  --surface-3: #1b222b;
  --line: #232b34;
  --line-soft: #1a2128;
  --line-strong: #313b46;

  --text: #e8ecf0;
  --text-2: #b3bcc6;
  --text-3: #919ba8;
  --text-4: #818b98;

  --lime: #b6f04a;
  --lime-ink: #0d1400;
  --lime-wash: rgba(182, 240, 74, 0.09);

  --plan: #93a4b8;
  --build: #b6f04a;
  --review: #b39bfb;
  --ship: #5ec8f2;
  --blocked: #ff7a70;
  --attention: #ffc247;

  --plan-wash: rgba(147, 164, 184, 0.12);
  --review-wash: rgba(179, 155, 251, 0.12);
  --ship-wash: rgba(94, 200, 242, 0.12);
  --blocked-wash: rgba(255, 122, 112, 0.12);
  --attention-wash: rgba(255, 194, 71, 0.12);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 25px;
  --fs-3xl: 33px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --rail: 258px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #0c1014, #0a0c0f 40%);
}

.rail-brand { display: flex; align-items: baseline; gap: 8px; padding: 2px 10px 16px; }
.rail-brand b {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.rail-brand span {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-label {
  padding: 14px 12px 6px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-4);
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-md);
  transition: background 160ms ease, color 160ms ease;
}
.rail-item:hover { background: var(--surface-2); color: var(--text); }
.rail-item[aria-current="page"] {
  background: var(--lime-wash);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--lime);
}
.rail-item[aria-disabled="true"] { color: var(--text-4); cursor: default; }
.rail-item[aria-disabled="true"]:hover { background: transparent; color: var(--text-4); }
.rail-item .count { margin-left: auto; }
.rail-item .soon {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
}

.rail-projects { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }

.proj {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-3);
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.proj:hover { background: var(--surface-2); color: var(--text-2); }
.proj[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }
.proj i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); flex: none; }
.proj[data-live="true"] i { background: var(--lime); }

.rail-foot {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 12, 15, 0.86);
  backdrop-filter: blur(10px);
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #7ea32f, transparent);
  opacity: 0.5;
}

.crumbs { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text-3); min-width: 0; }
.crumbs .here { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 24px 96px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  color: var(--text-4);
}

h1.title {
  margin: 9px 0 0;
  font-family: var(--display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.08;
  max-width: 26ch;
}

/* primitives ------------------------------------------------------------- */

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dim { color: var(--text-3); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.btn:hover { background: var(--surface-3); border-color: #46525f; }
.btn--primary { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.btn--primary:hover { background: #c8ff63; border-color: #c8ff63; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--quiet:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { min-height: 29px; padding: 0 10px; font-size: var(--fs-xs); }

.icon {
  width: 15px; height: 15px; flex: none;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chip--plan { color: var(--plan); background: var(--plan-wash); border-color: rgba(147,164,184,.24); }
.chip--build { color: var(--build); background: var(--lime-wash); border-color: rgba(182,240,74,.28); }
.chip--review { color: var(--review); background: var(--review-wash); border-color: rgba(179,155,251,.26); }
.chip--ship { color: var(--ship); background: var(--ship-wash); border-color: rgba(94,200,242,.26); }
.chip--blocked { color: var(--blocked); background: var(--blocked-wash); border-color: rgba(255,122,112,.3); }
.chip--attention { color: var(--attention); background: var(--attention-wash); border-color: rgba(255,194,71,.3); }
.chip--done { color: var(--text-3); background: transparent; border-color: var(--line); }
.chip--kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  height: 19px;
  padding: 0 7px;
  color: var(--text-3);
  border-color: var(--line);
  background: transparent;
}

.rounds { display: inline-flex; align-items: center; gap: 3px; }
.rounds i { width: 9px; height: 4px; border-radius: 1px; background: var(--line-strong); }
.rounds i.on { background: var(--text-3); }
.rounds[data-full="true"] i.on { background: var(--blocked); }
.rounds[data-hot="true"] i.on { background: var(--attention); }
.rounds-label { margin-left: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--text-4); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--line);
  flex: none;
  text-transform: uppercase;
}
.avatar[data-role="you"] { color: var(--lime-ink); background: var(--lime); border-color: var(--lime); }

.agent { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }

.pulse { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); flex: none; }
.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--lime);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.5); opacity: .7; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } }

/* summary ---------------------------------------------------------------- */

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--line-soft);
  overflow: hidden;
}
.stat { padding: 13px 15px 14px; background: var(--surface); }
.stat b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat > span { display: block; margin-top: 2px; font-size: var(--fs-xs); letter-spacing: .03em; color: var(--text-3); }
.stat[data-tone="attention"] b { color: var(--attention); }
.stat[data-tone="blocked"] b { color: var(--blocked); }
.stat[data-tone="live"] b { color: var(--lime); }

/* section ---------------------------------------------------------------- */

.section-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 10px; }
.section-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.011em; }

.shell-2 { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 26px; align-items: start; }
.aside { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 18px; }
.aside-block { border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); padding: 12px 13px; }
.aside-block h2 {
  margin: 0 0 9px;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  font-weight: 500;
}
.aside-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.aside-row:last-child { border-bottom: 0; }
.aside-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aside-row .mono { color: var(--text-4); font-size: 10.5px; flex: none; }

/* cards ------------------------------------------------------------------ */

.stack { display: flex; flex-direction: column; gap: 8px; }

.card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 140ms ease, background 140ms ease;
}
.card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.card[data-tone="blocked"] {
  border-color: rgba(255,122,112,.28);
  background: linear-gradient(90deg, rgba(255,122,112,.06), transparent 40%);
}
.card[data-tone="attention"] {
  border-color: rgba(255,194,71,.24);
  background: linear-gradient(90deg, rgba(255,194,71,.05), transparent 40%);
}

.card-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
}
.card[data-tone="blocked"] .card-mark { color: var(--blocked); border-color: rgba(255,122,112,.3); background: var(--blocked-wash); }
.card[data-tone="attention"] .card-mark { color: var(--attention); border-color: rgba(255,194,71,.3); background: var(--attention-wash); }

.card-body { min-width: 0; }
.card-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--text-4);
}
.card-kicker > span { white-space: nowrap; }
.card-title {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.3;
}
.card-why { margin: 5px 0 0; font-size: var(--fs-sm); color: var(--text-2); max-width: 68ch; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 9px; font-size: var(--fs-xs); color: var(--text-3); }
.card-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.quiet .card { opacity: .8; }
.quiet .card:hover { opacity: 1; }

/* feedback --------------------------------------------------------------- */

.empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.empty b { display: block; color: var(--text-2); font-size: var(--fs-md); margin-bottom: 4px; }

.skeleton {
  height: 74px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 122, 112, .3);
  background: var(--blocked-wash);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.banner .btn { margin-left: auto; }

/* login ------------------------------------------------------------------ */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(420px, 100%); }
.login-card h1 {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.login-card p { margin: 12px 0 0; color: var(--text-2); font-size: var(--fs-md); }
.login-card .btn { margin-top: 22px; }
.login-note { margin-top: 18px; font-size: var(--fs-xs); color: var(--text-4); }

/* mobile ----------------------------------------------------------------- */

.tabbar { display: none; }

@media (max-width: 1020px) {
  .shell-2 { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .page { padding: 18px 16px 112px; }
  .topbar { min-height: 50px; padding: 0 16px; }
  h1.title { font-size: 22px; letter-spacing: -0.028em; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 11px 13px; }
  .stat b { font-size: 19px; }
  .card { grid-template-columns: 30px minmax(0, 1fr); padding: 12px 13px; }
  .card-mark { width: 30px; height: 30px; }
  .card-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; margin-top: 4px; }
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: rgba(12, 16, 20, .94);
    backdrop-filter: blur(12px);
  }
  .tabbar a, .tabbar button {
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 44px;
    font-size: 11px;
    color: var(--text-4);
    border-radius: var(--r-sm);
    background: transparent;
    border: 0;
  }
  .tabbar a[aria-current="page"] { color: var(--lime); }
}
