:root {
  --bg: #f3f6f7;
  --bg-elev: #ffffff;
  --text: #16212a;
  --text-dim: #5c6b74;
  --border: #e3e9ec;
  --accent: #0d8f8a;
  --accent-2: #1cb5a5;
  --accent-dim: #0d8f8a1a;
  --accent-contrast: #ffffff;
  --hero-1: #0b3d3e;
  --hero-2: #0d8f8a;
  --hero-text: #eafffb;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 6px rgba(15, 35, 40, 0.06), 0 8px 24px rgba(15, 35, 40, 0.06);
  --shadow-hover: 0 6px 16px rgba(15, 35, 40, 0.10), 0 12px 32px rgba(15, 35, 40, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1316;
    --bg-elev: #141d21;
    --text: #eaf1f3;
    --text-dim: #8fa1a8;
    --border: #223034;
    --accent: #2bc9bd;
    --accent-2: #55ddce;
    --accent-dim: #2bc9bd22;
    --accent-contrast: #052321;
    --hero-1: #061c1d;
    --hero-2: #0a3a3a;
    --hero-text: #eafffb;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  background:
    radial-gradient(1100px 420px at 15% -20%, rgba(255,255,255,0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,255,255,0.08), transparent 55%),
    linear-gradient(120deg, var(--hero-1), var(--hero-2));
  color: var(--hero-text);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cellipse cx='60' cy='68' rx='13' ry='16'/%3E%3Cellipse cx='38' cy='48' rx='7' ry='9'/%3E%3Cellipse cx='58' cy='38' rx='7' ry='9'/%3E%3Cellipse cx='80' cy='48' rx='7' ry='9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  background-position: 0 0, 60px 60px;
  pointer-events: none;
}

.hero-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hero-logo .paw {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-logo .paw svg { color: var(--hero-text); }

.hero-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 28px 34px;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  line-height: 1.25;
  font-weight: 800;
  max-width: 780px;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  margin: 12px 0 0;
  color: rgba(234, 255, 251, 0.75);
  font-size: 1rem;
  max-width: 620px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-top: 2px solid rgba(255,255,255,0.18);
  min-width: 76px;
}

.stat strong {
  font-size: 1.4rem;
  font-weight: 800;
}

.stat span {
  font-size: 0.75rem;
  color: rgba(234, 255, 251, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------------- Sub nav ---------------- */

.subnav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.subnav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 14px 4px;
  margin-right: 24px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.progress-wrap {
  min-width: 200px;
  text-align: right;
  padding: 10px 0;
}

.progress-track {
  width: 180px;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 6px;
  margin-left: auto;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
  border-radius: 99px;
}

#progress-label {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 600;
}

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

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein 0.25s ease; }

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.course-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 900px) {
  .course-layout { grid-template-columns: 1fr; }
}

/* ---------------- Lesson list ---------------- */

.lesson-list {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-y: auto;
  max-height: calc(100vh - 130px);
  box-shadow: var(--shadow);
  padding: 6px;
}

.week-heading {
  padding: 16px 12px 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.week-heading:first-child { padding-top: 10px; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.87rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.lesson-item:hover { background: var(--accent-dim); }

.lesson-item.active {
  background: var(--accent-dim);
  font-weight: 700;
}

.lesson-item.active .lesson-index {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.lesson-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg);
}

.lesson-index.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.lesson-body { min-width: 0; }

.lesson-title-txt {
  display: block;
  line-height: 1.35;
}

.lesson-speaker-txt {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 1px;
}

/* ---------------- Player panel ---------------- */

.player-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-wrap {
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
}

.now-playing { padding: 22px 26px 20px; }

.now-tags { margin-bottom: 10px; }

.tag {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

#now-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.speaker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.mkv-warning {
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.5;
}

.now-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.watched-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.watched-toggle input { display: none; }

.watched-box {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  position: relative;
  transition: all 0.15s ease;
}

.watched-toggle input:checked + .watched-box {
  background: var(--accent);
  border-color: var(--accent);
}

.watched-toggle input:checked + .watched-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: filter 0.15s ease;
}

.btn-download:hover { filter: brightness(1.08); }

.lesson-nav {
  display: flex;
  border-top: 1px solid var(--border);
}

.nav-arrow {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-arrow:hover:not(:disabled) { background: var(--accent-dim); color: var(--accent); }

.nav-arrow:disabled { opacity: 0.35; cursor: default; }

.nav-arrow.next {
  justify-content: flex-end;
  text-align: right;
  border-left: 1px solid var(--border);
}

/* ---------------- Materials ---------------- */

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.material-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.material-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.material-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.material-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  flex-grow: 1;
}

.material-size {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.material-actions { display: flex; gap: 8px; }

.material-actions a {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.material-actions a:hover { filter: brightness(1.05); }

.material-actions .view {
  background: var(--accent-dim);
  color: var(--accent);
}

.material-actions .download {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ---------------- Footer ---------------- */

.site-footer {
  text-align: center;
  padding: 30px 24px 40px;
  color: var(--text-dim);
  font-size: 0.8rem;
}
