/* Stoked Logic App Registry — styles.css
   Static dashboard for builds.stokedlogic.com
   Brand: warm, intentional, human-centered. Clean, confident, precise, friendly. */

:root {
  /* Brand palette */
  --teal: #2CC3C9;
  --ink-black: #111111;
  --deep-charcoal: #1A1A1A;
  --soft-cream: #F5F4EF;
  --light-stone: #E8E7E3;
  --cloud-white: #FFFFFF;
  --slate-blue: #6A8CA3;
  --seafoam: #B9FFEE;
  --warm-orange: #FFB357;
  --gradient-start: #199EA6;
  --gradient-end: #D4E36B;
  --primary-gradient: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));

  /* Semantic tokens */
  --bg: var(--soft-cream);
  --surface: var(--cloud-white);
  --text: var(--ink-black);
  --muted: #5B5B57;
  --border: var(--light-stone);
  --accent: var(--teal);

  /* Shape & spacing */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 1px 2px rgba(17, 17, 17, 0.04), 0 8px 24px rgba(17, 17, 17, 0.06);
  --shadow-lift: 0 2px 4px rgba(17, 17, 17, 0.06), 0 16px 40px rgba(17, 17, 17, 0.10);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--gradient-start); }

/* ---------- Header ---------- */
.site-header {
  background: var(--primary-gradient);
  color: var(--ink-black);
  padding: 48px 0 40px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

.site-header .wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-black);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35);
  flex: none;
}

.site-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-subtitle {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(17, 17, 17, 0.82);
  font-weight: 500;
}

.meta-line {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(17, 17, 17, 0.72);
  font-weight: 600;
}

.meta-line .owner { opacity: 0.9; }

/* ---------- Section scaffolding ---------- */
section { padding: 36px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head .hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Summary counts ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* rendered as a <button>: reset native styling */
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.stat-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 195, 201, 0.4);
}

.stat-card.is-active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(44, 195, 201, 0.35), var(--shadow-soft);
}

.stat-card.is-active .num { color: var(--gradient-start); }

.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card .label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card.is-total { border-top: 3px solid var(--ink-black); }
.stat-card.is-live { border-top: 3px solid var(--teal); }
.stat-card.is-testflight { border-top: 3px solid var(--slate-blue); }
.stat-card.is-activedev { border-top: 3px solid var(--warm-orange); }
.stat-card.is-phone { border-top: 3px solid var(--gradient-end); }
.stat-card.is-parked { border-top: 3px solid var(--muted); }
.stat-card.is-work { border-top: 3px solid var(--slate-blue); }

/* ---------- Controls / filters ---------- */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
}

.control--search { grid-column: 1 / -1; }

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.control input,
.control select {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--soft-cream);
  color: var(--text);
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.control input:focus,
.control select:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--cloud-white);
  box-shadow: 0 0 0 3px rgba(44, 195, 201, 0.25);
}

.control select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235B5B57' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.controls-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.result-count {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.btn-reset {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-reset:hover { background: var(--light-stone); border-color: var(--slate-blue); }

/* ---------- App cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.app-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-card__name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.app-card__category {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.badge--dist {
  background: var(--soft-cream);
  border-color: var(--border);
  color: var(--muted);
}

.badge--dist::before { display: none; }

/* Status badge colors */
.badge.status-idea        { background: #F0EFEA; color: #6B6B66; }
.badge.status-prototype   { background: rgba(255, 179, 87, 0.18); color: #A15C10; }
.badge.status-active-dev  { background: rgba(255, 179, 87, 0.22); color: #8A4B08; }
.badge.status-testflight  { background: rgba(106, 140, 163, 0.18); color: #3C5D74; }
.badge.status-live        { background: rgba(44, 195, 201, 0.18); color: #0E6E72; }
.badge.status-maintenance { background: rgba(185, 255, 238, 0.55); color: #12655A; }
.badge.status-phone-only  { background: rgba(212, 227, 107, 0.30); color: #5C6510; }
.badge.status-work-only   { background: rgba(106, 140, 163, 0.16); color: #435C6E; }
.badge.status-parked      { background: #E6E5E0; color: #56564F; }
.badge.status-stuck       { background: rgba(255, 120, 90, 0.16); color: #A33418; }
.badge.status-retired     { background: #ECEBE6; color: #7A7A72; }
.badge.status-unknown     { background: #EEEDE8; color: #6B6B66; }

/* ---------- Tag chips (clickable) ---------- */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--soft-cream);
  color: var(--muted);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.tag-chip::before {
  content: "#";
  opacity: 0.5;
  margin-right: 1px;
}

.tag-chip:hover { transform: translateY(-1px); }
.tag-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(44, 195, 201, 0.35); }

.tag-chip.tag-stoked-logic {
  background: rgba(44, 195, 201, 0.12);
  border-color: rgba(44, 195, 201, 0.35);
  color: #0E6E72;
}
.tag-chip.tag-stoked-logic:hover { background: rgba(44, 195, 201, 0.22); }

.tag-chip.tag-work {
  background: rgba(106, 140, 163, 0.14);
  border-color: rgba(106, 140, 163, 0.4);
  color: #3C5D74;
}
.tag-chip.tag-work:hover { background: rgba(106, 140, 163, 0.24); }

/* Tag chips inside the dark "Needs attention" section */
.attention .tag-chip {
  background: #2b2b2b;
  border-color: #3a3a3a;
  color: var(--light-stone);
}
.attention .tag-chip.tag-stoked-logic { color: var(--seafoam); border-color: rgba(185, 255, 238, 0.3); }
.attention .tag-chip.tag-work { color: #9fc4dc; border-color: rgba(106, 140, 163, 0.5); }

.app-card__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.app-card__meta dt {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.app-card__meta dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  font-weight: 500;
}

.app-card__meta dd.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--deep-charcoal);
}

.app-card__meta dd .unknown { color: #A3A29B; font-style: italic; font-weight: 500; }

.next-action {
  background: var(--soft-cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.next-action .na-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 3px;
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--deep-charcoal);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notes-list li { line-height: 1.4; }

/* ---------- Project evidence (auto-scanned) ---------- */
.evidence {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evidence__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evidence__title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-blue);
}

.tree-status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tree-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.tree-status.is-clean {
  background: rgba(44, 195, 201, 0.14);
  color: #0E6E72;
}

/* Dirty: noticeable (warm orange) but calm, not an error red. */
.tree-status.is-dirty {
  background: rgba(255, 179, 87, 0.20);
  color: #8A4B08;
}

.evidence__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0;
  font-size: 0.82rem;
}

.evidence__meta dt {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.evidence__meta dd {
  margin: 0;
  color: var(--deep-charcoal);
  word-break: break-word;
  min-width: 0;
}

.evidence__meta dd.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--deep-charcoal);
}

.evidence__meta .commit-date {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--slate-blue);
  font-weight: 600;
}

.evidence__meta .commit-subject { font-weight: 500; }

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.links-row a {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--seafoam);
  color: #10514A;
}

.links-row a:hover { background: #a3f5e0; }

/* ---------- Needs attention ---------- */
.attention {
  background: var(--deep-charcoal);
  color: var(--soft-cream);
  border-radius: var(--radius-lg);
  padding: 8px 0 12px;
}

.attention .wrap { max-width: var(--maxw); }

.attention .section-head h2 { color: var(--cloud-white); }
.attention .section-head .hint { color: rgba(245, 244, 239, 0.7); }

.attention .app-card {
  background: #232323;
  border-color: #333;
  color: var(--soft-cream);
}

.attention .app-card__name { color: var(--cloud-white); }
.attention .app-card__meta { border-top-color: #333; }
.attention .app-card__meta dd { color: var(--light-stone); }
.attention .app-card__meta dd.mono { color: var(--seafoam); }
.attention .next-action { background: #1A1A1A; border-color: #333; color: var(--soft-cream); }
.attention .notes-list { color: var(--light-stone); }
.attention .app-card__category { color: var(--seafoam); }
.attention .evidence { border-top-color: #3a3a3a; }
.attention .evidence__title { color: var(--seafoam); }
.attention .evidence__meta dd { color: var(--light-stone); }
.attention .evidence__meta dd.mono { color: var(--seafoam); }
.attention .evidence__meta .commit-date { color: #9fc4dc; }
.attention .tree-status.is-clean { background: rgba(185, 255, 238, 0.14); color: var(--seafoam); }
.attention .tree-status.is-dirty { background: rgba(255, 179, 87, 0.22); color: var(--warm-orange); }

/* ---------- Update guide ---------- */
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

.guide-card p { color: var(--deep-charcoal); }
.guide-card ul { color: var(--deep-charcoal); padding-left: 20px; }
.guide-card li { margin-bottom: 6px; }

.guide-card code,
.inline-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--soft-cream);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.85em;
  color: var(--ink-black);
}

.guide-card pre {
  background: var(--ink-black);
  color: var(--seafoam);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.55;
}

.guide-card pre code { background: none; border: none; padding: 0; color: inherit; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 179, 87, 0.14);
  border: 1px solid rgba(255, 179, 87, 0.5);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.callout .callout-mark { font-size: 1.2rem; line-height: 1.2; }
.callout p { margin: 0; font-size: 0.92rem; }

/* ---------- States ---------- */
.state-msg {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 1rem;
}

.state-msg.error {
  color: #A33418;
  background: rgba(255, 120, 90, 0.08);
  border: 1px solid rgba(255, 120, 90, 0.3);
  border-radius: var(--radius-md);
}

.hidden { display: none !important; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  margin-top: 12px;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.site-footer .domain { font-weight: 700; color: var(--deep-charcoal); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .controls .control--search { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-header { padding: 34px 0 30px; }
  section { padding: 26px 0; }
  .controls { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .app-card:hover { transform: none; }
}
