:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #64748b;
  --line: #dfe5ec;
  --brand: #2356a8;
  --brand-dark: #173e7f;
  --brand-soft: #eaf1fb;
  --accent: #b45309;
  --success: #20744a;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(15, 23, 42, .04);
  --max: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(35, 86, 168, .08), transparent 28rem),
    var(--bg);
  line-height: 1.55;
}

a { color: inherit; }

.container {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
}

.site-header {
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-text strong {
  display: block;
  font-size: .98rem;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.brand-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.2;
}

main {
  padding-top: 24px;
}

.archive {
  padding-bottom: 48px;
}

.course {
  margin-top: 28px;
}

.course:first-child {
  margin-top: 0;
}

.course-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--text);
}

.course-title {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -.025em;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.project {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color .2s ease, transform .2s ease;
}

.project:hover {
  border-color: #c8d2df;
}

.project-summary {
  width: 100%;
  padding: 11px 13px 9px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
}

.project-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
}

.project h3 {
  margin: 0;
  font-size: .95rem;
  letter-spacing: -.015em;
}

.files {
  display: block;
  padding: 0 13px 12px;
}

.files-inner {
  display: grid;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.file:hover {
  background: #fff;
  border-color: #bdc9d8;
  transform: translateY(-1px);
}

.file.disabled {
  opacity: .52;
  cursor: default;
  pointer-events: none;
}

.file.disabled:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  transform: none;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #feecec;
  color: #a62a2a;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
}

.file-icon.zip {
  background: #fff4cc;
  color: #8a6200;
}

.file-icon.web {
  background: #e6f6ec;
  color: #216e45;
}

.file-name {
  margin: 0;
  font-weight: 600;
  font-size: .76rem;
}

.file-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.empty-state {
  display: none;
  margin-top: 24px;
  margin-bottom: 60px;
  padding: 28px;
  border: 1px dashed #b8c4d3;
  border-radius: var(--radius);
  background: rgba(255,255,255,.7);
  text-align: center;
  color: var(--muted);
}

.empty-state.visible {
  display: block;
}

.site-footer {
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  text-align: center;
}

.site-footer strong {
  color: var(--text);
}

.site-footer a {
  color: inherit;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .projects {
    grid-template-columns: 1fr;
  }

  .project-summary {
    padding: 10px 12px 8px;
  }

  .files {
    padding: 0 12px 11px;
  }

  .course-header {
    align-items: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
