/* =========================================================================
   RouterBaba Labs Hub
   The visual language for the 9-lab progression page.
   Design intent: dark, technical, considered. Not childish, not corporate.
   ========================================================================= */

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

.hub-body {
  background: var(--bg, #0C1E2F);
  color: var(--text, #E8EEF5);
}

.hub-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header strip ---------- */

.hub-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hub-header-inner {
  max-width: 800px;
}

.hub-header h1 {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0.5rem 0 1.5rem;
  letter-spacing: -0.02em;
}

.hub-lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(232, 238, 245, 0.78);
  max-width: 640px;
  margin-bottom: 2rem;
}

/* ---------- Progress bar ---------- */

.hub-progress {
  margin-top: 2rem;
  max-width: 480px;
}

.progress-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #F5A623 0%, #F7B84B 100%);
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: rgba(232, 238, 245, 0.6);
}

#progress-count {
  font-variant-numeric: tabular-nums;
}

.link-btn {
  background: none;
  border: none;
  color: rgba(232, 238, 245, 0.5);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.2);
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.link-btn:hover,
.link-btn:focus-visible {
  color: rgba(232, 238, 245, 0.9);
  text-decoration-color: currentColor;
  outline: none;
}

/* ---------- Curriculum arc ---------- */

.curriculum-arc {
  padding: 3.5rem 0 1rem;
}

.arc-section {
  margin-bottom: 4rem;
}

.arc-section-head {
  margin-bottom: 1.75rem;
  max-width: 720px;
}

.arc-num {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #F5A623;
  margin-bottom: 0.5rem;
}

.arc-section-head h3 {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.arc-section-head p {
  font-size: 1rem;
  color: rgba(232, 238, 245, 0.7);
  margin: 0;
  line-height: 1.55;
}

/* ---------- Lab grid ---------- */

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* ---------- Lab card ---------- */

.lab-card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.lab-card[data-status="available"]:hover,
.lab-card[data-status="completed"]:hover {
  border-color: rgba(245, 166, 35, 0.4);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}

.lab-card[data-status="locked"] {
  opacity: 0.5;
  filter: grayscale(0.4);
}

.lab-card[data-status="locked"] .lab-cta {
  pointer-events: none;
}

.lab-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(232, 238, 245, 0.5);
  font-variant-numeric: tabular-nums;
}

.lab-tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: rgba(245, 166, 35, 0.12);
  color: #F5A623;
  border-radius: 4px;
}

.lab-tag.tag-capstone {
  background: rgba(157, 78, 221, 0.15);
  color: #C589FF;
}

.lab-status-badge {
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.lab-card[data-status="available"] .lab-status-badge {
  background: #F5A623;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.15);
}

.lab-card[data-status="completed"] .lab-status-badge {
  background: #4ADE80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.15);
}

.lab-card[data-status="locked"] .lab-status-badge {
  background: rgba(255,255,255,0.15);
}

.lab-card[data-status="completed"]::after {
  content: "Completed";
  position: absolute;
  top: 1rem;
  right: 3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #4ADE80;
  letter-spacing: 0.05em;
}

.lab-card[data-status="locked"]::after {
  content: "Complete previous to unlock";
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  right: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: rgba(232, 238, 245, 0.4);
  text-align: center;
  padding-top: 1rem;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

.lab-card h4 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.625rem;
  letter-spacing: -0.01em;
}

.lab-blurb {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(232, 238, 245, 0.72);
  margin: 0 0 1.25rem;
  flex-grow: 1;
}

.lab-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: rgba(232, 238, 245, 0.5);
}

.lab-meta li {
  display: flex;
  align-items: center;
}

.lab-meta li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: rgba(232, 238, 245, 0.3);
  border-radius: 50%;
  margin-right: 0.5rem;
}

.lab-meta .meta-time::before {
  background: #F5A623;
}

.lab-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: rgba(245, 166, 35, 0.12);
  color: #F5A623;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.lab-cta:hover {
  background: rgba(245, 166, 35, 0.2);
}

.lab-card[data-status="completed"] .lab-cta {
  background: rgba(74, 222, 128, 0.1);
  color: #4ADE80;
}

.lab-card[data-status="completed"] .lab-cta:hover {
  background: rgba(74, 222, 128, 0.18);
}

.lab-card[data-status="completed"] .cta-text::before {
  content: "Replay ";
}

.cta-arrow {
  transition: transform 0.15s ease;
}

.lab-cta:hover .cta-arrow {
  transform: translateX(2px);
}

/* Capstone special styling */
.lab-card.lab-capstone {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.08) 0%, rgba(255,255,255,0.03) 100%);
  border-color: rgba(157, 78, 221, 0.2);
}

.lab-card.lab-capstone .lab-cta {
  background: rgba(157, 78, 221, 0.15);
  color: #C589FF;
}

.lab-card.lab-capstone .lab-cta:hover {
  background: rgba(157, 78, 221, 0.25);
}

/* ---------- How it works ---------- */

.hub-howto {
  padding: 5rem 0 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 2rem;
}

.howto-inner {
  max-width: 900px;
}

.hub-howto h2 {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  margin: 0.5rem 0 2.5rem;
  letter-spacing: -0.02em;
}

.howto-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.howto-steps li {
  position: relative;
}

.howto-steps .step-num {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #F5A623;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.howto-steps h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.howto-steps p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(232, 238, 245, 0.7);
  margin: 0;
}

.howto-steps code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.06);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  color: #F7B84B;
}

/* ---------- Why this exists ---------- */

.hub-why {
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.why-inner {
  max-width: 720px;
}

.hub-why h2 {
  font-family: 'Crimson Pro', serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  margin: 0.5rem 0 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hub-why p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(232, 238, 245, 0.78);
  margin-bottom: 1.25rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .hub-main {
    padding: 0 1rem 3rem;
  }

  .hub-header {
    padding: 2.5rem 0 2rem;
  }

  .arc-section {
    margin-bottom: 2.5rem;
  }

  .lab-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .lab-card {
    min-height: 240px;
    padding: 1.25rem;
  }

  .howto-steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hub-howto,
  .hub-why {
    padding: 3rem 0 2rem;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .progress-bar,
  .lab-card,
  .lab-cta,
  .cta-arrow {
    transition: none;
  }

  .lab-card[data-status="available"]:hover,
  .lab-card[data-status="completed"]:hover {
    transform: none;
  }
}

/* ---------- Focus states (accessibility) ---------- */

.lab-cta:focus-visible {
  outline: 2px solid #F5A623;
  outline-offset: 2px;
}
