@import url('/brand.css');

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--blue) 14%, transparent), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  font-family: var(--font-body);
}

.progress-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 56px;
  display: grid;
  gap: 24px;
}

.progress-hero,
.progress-card,
.mastery-card,
.timeline-card,
.chart-card,
.coach-card {
  border: 2px solid var(--border);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.progress-hero,
.progress-card,
.timeline-card,
.chart-card,
.coach-card {
  padding: 24px;
}

.progress-hero {
  display: grid;
  gap: 18px;
}

.progress-hero-head,
.progress-meter-head,
.coach-head,
.timeline-head,
.chart-head,
.mastery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.progress-hero p,
.progress-card p,
.timeline-card p,
.chart-card p,
.mastery-card p,
.coach-card p,
.timeline-date,
.mastery-meta,
.progress-meter-copy,
.progress-tag {
  color: var(--ink-soft);
}

.progress-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.progress-hero-stats,
.summary-grid,
.mastery-grid {
  display: grid;
  gap: 16px;
}

.progress-hero-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card,
.mastery-card {
  padding: 20px;
}

.summary-value,
.level-value,
.xp-value {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.progress-meter-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
}

.progress-track {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-2);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), var(--blue));
  transition: width 0.8s ease;
}

.progress-button,
.progress-link,
.filter-select {
  border: 2px solid var(--border);
  border-radius: 18px;
  font: inherit;
}

.progress-button,
.progress-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--lime);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
}

.progress-button:hover,
.progress-link:hover {
  transform: translate(-2px, -2px);
}

.filter-select {
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--ink);
}

.timeline-list {
  display: grid;
  gap: 16px;
}

.timeline-item {
  position: relative;
  padding-left: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow-sm);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  bottom: -14px;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::after {
  display: none;
}

.chart-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.chart-shell {
  min-height: 280px;
}

.mastery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mastery-card {
  display: grid;
  gap: 14px;
}

.mastery-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  font-size: 1.6rem;
}

.mastery-meter {
  display: grid;
  gap: 8px;
}

.mastery-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.mastery-rank {
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .progress-meter-grid,
  .chart-layout,
  .mastery-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .progress-page {
    width: min(100% - 20px, 1180px);
    gap: 18px;
  }

  .progress-hero,
  .progress-card,
  .timeline-card,
  .chart-card,
  .coach-card,
  .summary-card,
  .mastery-card {
    padding: 20px;
    border-radius: 24px;
  }

  .progress-hero-stats {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .site-nav,
  .site-footer,
  .progress-button,
  .progress-link,
  #refresh-ai,
  #view-milestones,
  .filter-select {
    display: none !important;
  }

  .progress-page,
  .progress-hero,
  .progress-card,
  .chart-card,
  .timeline-card,
  .coach-card,
  .mastery-card,
  .summary-card {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    color: #111;
  }

  .progress-page {
    width: 100%;
    margin: 0;
    gap: 12px;
  }

  canvas {
    max-height: 220px !important;
  }
}
