/* GitHub Hackathon Platform — main.css
   Design language: GitHub color palette, minimal, responsive */

:root {
  --color-primary:      #0969da;
  --color-primary-dark: #0550ae;
  --color-success:      #2ea44f;
  --color-danger:       #d1242f;
  --color-warning:      #bf8700;
  --color-bg:           #ffffff;
  --color-surface:      #f6f8fa;
  --color-border:       #d0d7de;
  --color-text:         #1f2328;
  --color-text-muted:   #57606a;
  --color-gold:         #bf8700;
  --color-canvas-dark:  #0d1117;
  --font-sans:          -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:          ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --radius:             6px;
  --radius-lg:          12px;
  --shadow:             0 1px 3px rgba(31,35,40,0.12), 0 8px 24px rgba(66,74,83,0.12);
  --shadow-sm:          0 1px 0 rgba(31,35,40,0.04), 0 1px 3px rgba(31,35,40,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--color-text); }
.cta-btn {
  background: var(--color-success) !important;
  color: #ffffff !important;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-weight: 600 !important;
  font-size: 14px;
}
.cta-btn:hover { background: #2c974b !important; text-decoration: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--color-canvas-dark) 0%, #161b22 100%);
  color: #f0f6fc;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 40px;
}
.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f0f6fc 0%, #79c0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: #8b949e;
  max-width: 560px;
  margin: 0 auto;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; color: #fff; }
.btn-secondary {
  background: transparent;
  color: #f0f6fc;
  padding: 10px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid #30363d;
  transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: #8b949e; text-decoration: none; }

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-number {
  font-size: 36px;
  font-weight: 800;
  color: #79c0ff;
}
.stat-label {
  font-size: 13px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Sections ── */
.section { padding: 72px 0; }
.section-alt { background: var(--color-surface); }
.section h2, main h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.3px;
}

/* ── Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon { font-size: 32px; margin-bottom: 12px; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--color-text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.card-link { font-size: 14px; font-weight: 600; color: var(--color-primary); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* ── Challenge Cards ── */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.challenge-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.challenge-card h3 { font-size: 16px; margin-bottom: 10px; }
.challenge-card h3 a { text-decoration: none; color: var(--color-text); }
.challenge-card h3 a:hover { color: var(--color-primary); }
.challenge-card p { color: var(--color-text-muted); font-size: 13px; margin: 10px 0; }
.challenge-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.badge {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: capitalize;
}

/* ── Steps ── */
.steps { display: flex; flex-direction: column; gap: 24px; }
.step { display: flex; gap: 20px; align-items: flex-start; }
.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.step-content h3 { font-size: 17px; margin-bottom: 6px; }
.step-content p { color: var(--color-text-muted); font-size: 15px; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 36px; max-width: 600px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--color-border);
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-dot {
  position: absolute;
  left: -32px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--color-border);
  border: 3px solid var(--color-bg);
  box-shadow: var(--shadow-sm);
}
.timeline-dot.phase-active,
.timeline-dot[data-phase="active"] { background: var(--color-success); }
.timeline-content h3 { font-size: 16px; margin-bottom: 4px; }
.timeline-content p { color: var(--color-text-muted); font-size: 14px; }

/* ── Leaderboard ── */
.leaderboard-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.leaderboard-controls input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
}
.leaderboard-controls input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}
.leaderboard-controls select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.leaderboard-table th {
  background: var(--color-surface);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tbody tr:hover td { background: var(--color-surface); }
.winner-row td { background: #fff8e5 !important; }
.finalist-row td { background: #f0f4ff !important; }
.total-score { font-weight: 700; font-size: 15px; color: var(--color-text); }
.rank { font-weight: 700; color: var(--color-text-muted); white-space: nowrap; }
.score-cell { text-align: center; color: var(--color-text-muted); font-family: var(--font-mono); }

.rubric-pill {
  display: inline-block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 13px;
  margin: 4px 3px;
  color: var(--color-text-muted);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.site-footer a { color: var(--color-text-muted); }

/* ── Utilities ── */
.loading { color: var(--color-text-muted); font-style: italic; padding: 24px 0; }
.last-updated { font-size: 12px; color: var(--color-text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 34px; }
  .hero { padding: 48px 20px; }
  .nav-links { display: none; }
  .leaderboard-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cards-grid { grid-template-columns: 1fr; }
  .stat-number { font-size: 28px; }
}
