/* carl.showhelm.com — project hub. Dark, quiet, fast. No dependencies. */

:root {
  color-scheme: dark;
  --bg: #0c0f16;
  --surface: #131826;
  --surface-2: #1a2133;
  --border: #242e45;
  --border-soft: #1d2537;
  --text: #e8ecf6;
  --text-soft: #97a3bd;
  --text-faint: #8290ad;
  --accent: #8da2ff;
  --accent-deep: #5f79e8;
  --ok: #5ad68f;
  --warn: #e8c15a;
  --info: #63b8e8;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 78% -10%, rgba(95, 121, 232, 0.13), transparent 60%),
    radial-gradient(800px 420px at -10% 8%, rgba(90, 214, 143, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) clamp(18px, 4vw, 36px) 28px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

/* ---------------- Hero ---------------- */

.hero { margin-bottom: 34px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 0 0 18px;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(90, 214, 143, 0.5);
  animation: pulse 2.4s infinite;
}
.live-dot.stale { background: var(--warn); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(90, 214, 143, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(90, 214, 143, 0); }
  100% { box-shadow: 0 0 0 0 rgba(90, 214, 143, 0); }
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 52px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero .sub {
  margin: 0;
  max-width: 62ch;
  color: var(--text-soft);
  font-size: clamp(15px, 2.2vw, 17px);
}

.hero-controls { margin-top: 24px; }

#search {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-size: 16px; /* >=16px prevents iOS focus auto-zoom */
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
#search::placeholder { color: var(--text-faint); }
#search:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 1px; }

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.project-card:hover, .project-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-deep);
  background: var(--surface-2);
  outline: none;
}

.pc-top { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.pc-top h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; line-height: 1.3; }

.status {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 3px;
  white-space: nowrap;
}
.status-active   { color: var(--ok);   border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.status-building { color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.status-paused   { color: var(--text-faint); border: 1px solid var(--border); }
.status-done     { color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 45%, transparent); }

.pc-tagline { margin: 0; color: var(--text-soft); font-size: 14px; flex: 1; }

.pc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 6px;
  padding: 1.5px 8px;
}

.pc-updated { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.pc-updated.fresh { color: var(--ok); }

.pc-open {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  font-weight: 550;
  white-space: nowrap;
}
.project-card:hover .pc-open { text-decoration: underline; }

/* Ghost / coming-soon card */
.project-card.ghost {
  border-style: dashed;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-faint);
  min-height: 150px;
  cursor: default;
}
.project-card.ghost:hover { transform: none; border-color: var(--border); background: transparent; }
.project-card.ghost h2 { font-size: 15px; color: var(--text-faint); margin: 0; }
.project-card.ghost p { font-size: 13px; margin: 4px 0 0; }

.empty-note {
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}

/* ---------------- Toast / footer ---------------- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 14px);
  background: var(--surface-2);
  border: 1px solid var(--accent-deep);
  color: var(--text);
  font-size: 13.5px;
  border-radius: 999px;
  padding: 9px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-faint);
  font-size: 12.5px;
}
.footer p { margin: 0; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .project-card { padding: 18px 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .project-card { transition: none; }
}

@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2;
    --border: #999; --border-soft: #bbb;
    --text: #000; --text-soft: #333; --text-faint: #555;
    --accent: #000; --accent-deep: #444; --ok: #000; --warn: #000; --info: #000;
  }
  body { background: #fff; }
  .hero-controls, .toast, .live-dot, .project-card.ghost { display: none !important; }
}
