/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0b0c0e;
  --bg-card:     #141619;
  --bg-card-hover: #1a1d22;
  --border:      #23272e;
  --text:        #e0e2e6;
  --text-dim:    #8a8f98;
  --accent:      #3be063;
  --accent-dim:  rgba(59, 224, 99, .12);
  --yellow:      #f0c040;
  --orange:      #e87830;
  --red:         #e04040;
  --ring-track:  #1e2128;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem 2.5rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.site-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: .5rem;
}
.site-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 600px;
}

/* ── Main ───────────────────────────────────────────────────── */
main {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.section-heading {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

/* ── Projects Grid ──────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 1.25rem;
}
.loading {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: .85rem;
}
.error-msg {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: .85rem;
}

/* ── Project Card ───────────────────────────────────────────── */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: background .15s, border-color .15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  text-decoration: none;
  color: inherit;
}

/* Card top row: ring + info */
.card-top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Progress ring */
.progress-ring-container {
  flex-shrink: 0;
  position: relative;
  width: 72px;
  height: 72px;
}
.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 6;
}
.progress-ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease, stroke .3s;
}
.progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
}

/* Card info */
.card-info { flex: 1; min-width: 0; }
.card-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: .3rem;
  line-height: 1.35;
}
.card-id {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* LIVE badge */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .5rem;
  border-radius: 4px;
}
.badge-live::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* Stats row */
.card-stats {
  display: flex;
  gap: 1.5rem;
  font-size: .8rem;
  color: var(--text-dim);
}
.stat-label { color: var(--text-dim); }
.stat-value {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 600;
}

/* Current task row */
.card-current-task {
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  padding: .75rem 1rem;
  font-size: .8rem;
  line-height: 1.5;
}
.current-task-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .25rem;
  font-weight: 600;
}
.current-task-path {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .75rem;
}
.current-task-desc {
  color: var(--text);
  margin-top: .15rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 560px) {
  .projects-grid { grid-template-columns: 1fr; }
  header { padding: 2rem 1.25rem 1.75rem; }
  main { padding: 1.75rem 1.25rem; }
  .card-stats { flex-wrap: wrap; gap: 1rem; }
}
