/* ================================================
   LESSON LAB — Hub Styles
   Filterable lesson index with GSAP Flip
   ================================================ */

:root {
  --ink: #0a0a0a;
  --white: #FFFFFF;
  --paper: #F2F2EC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ============ PAGE CONTAINER ============ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ============ HEADER ============ */
.header {
  margin-bottom: 36px;
}
.header-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 36px;
  width: auto;
}
.hub-link {
  margin-left: auto;
  text-decoration: none;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: opacity 0.15s;
}
.hub-link:hover { opacity: 0.6; }
.header h1 {
  font-family: 'Geologica', sans-serif;
  font-weight: 900;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.header h1 .outline {
  -webkit-text-stroke: 2px var(--ink);
  color: transparent;
}
.header > p {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  max-width: 50ch;
}

/* ============ FILTER BAR ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-bottom: 32px;
  padding: 18px 24px;
  border: 2px solid var(--ink);
  background: var(--white);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink: 0;
  margin-right: 4px;
  opacity: 0.5;
}

/* Filter buttons — single-select per category */
.filter-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 5px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  outline: none;
}
.filter-btn:hover {
  background: var(--ink);
  color: var(--white);
}
.filter-btn.active {
  background: var(--ink);
  color: var(--white);
}

/* ============ LESSON GRID ============ */
.lessons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  width: calc((100% - 16px) / 3);
  min-height: 220px;
  padding: 28px 24px 24px;
  border: 2px solid var(--ink);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  /* NO CSS transition — prevents fighting with GSAP Flip */
}

/* Corner asterisks */
.lesson-card .corner {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
}
.lesson-card .corner.tr { top: 10px; right: 12px; }
.lesson-card .corner.bl { bottom: 10px; left: 12px; }

/* Card tags */
.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  background: var(--ink);
}

/* Card content */
.lesson-card h2 {
  font-family: 'Geologica', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.04em;
}
.lesson-card > p {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  opacity: 0.85;
}

/* Grade badges */
.card-grades {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}
.grade-badge {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--white);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  border: 2px solid var(--ink);
  background: var(--white);
}
.empty-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 48px;
  font-weight: 700;
  display: block;
  margin-bottom: 16px;
}
.empty-state p {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 24px;
}
.reset-btn {
  position: relative;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 13px 26px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.14s ease-out, color 0.2s ease-out;
}
.reset-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #FF2E7E;
  transform: translateX(-101%);
  transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}
.reset-btn:hover::before { transform: translateX(0); }
.reset-btn:hover {
  color: var(--ink);
  transform: scale(1.03) rotate(-0.6deg);
}
.reset-btn:active {
  transform: scale(0.95) rotate(0.8deg);
  transition: transform 0.08s ease-in;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .lesson-card { width: calc((100% - 8px) / 2); }
}
@media (max-width: 900px) {
  .filters { flex-direction: column; gap: 14px; }
  .filter-group { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .page { padding: 24px 16px; }
  .lesson-card { width: 100%; }
  .header h1 { font-size: clamp(36px, 10vw, 64px); }
}
