/* =========================================================================
   Intsight Education — Apple-inspired theme
   Brand: primary #002a5c (deep navy), secondary light gray
   ========================================================================= */

:root {
  /* Brand */
  --brand: #002a5c;
  --brand-600: #013a7d;
  --brand-500: #1450a0;
  --brand-300: #6f95c6;
  --brand-100: #e6edf5;

  /* Neutrals (Apple-style light grays) */
  --bg: #ffffff;
  --bg-elevated: #f5f5f7;
  --bg-tint: #fbfbfd;
  --border: #e5e5ea;
  --border-strong: #d2d2d7;

  /* Text */
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-on-brand: #ffffff;

  /* Effects */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 18px 48px rgba(0, 0, 0, 0.08);
  --maxw: 1080px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
}

/* ----------------------------------------------------------------- Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------------- Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--brand);
}

.nav__logo {
  height: 26px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--text-secondary);
}

.nav__links a {
  transition: color 0.2s ease;
}

.nav__links a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 980px;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--brand);
  color: var(--text-on-brand);
}

.btn--primary:hover {
  background: var(--brand-600);
}

.btn--ghost {
  background: var(--bg-elevated);
  color: var(--brand);
}

.btn--ghost:hover {
  background: var(--border);
}

.btn--small {
  padding: 8px 16px;
  font-size: 14px;
}

/* ----------------------------------------------------------------- Hero */
.hero {
  text-align: center;
  padding: 88px 0 64px;
  background: radial-gradient(
      1200px 500px at 50% -10%,
      var(--brand-100),
      transparent 70%
    ),
    var(--bg);
}

.hero__eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand-500);
  background: var(--brand-100);
  padding: 6px 14px;
  border-radius: 980px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 16ch;
  margin: 0 auto 18px;
}

.hero h1 .accent {
  color: var(--brand);
}

.hero p {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--text-secondary);
  max-width: 52ch;
  margin: 0 auto 32px;
}

/* --------------------------------------------------------------- Section */
.section {
  padding: 64px 0;
}

.section__head {
  margin-bottom: 36px;
}

.section__head h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section__head p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-top: 8px;
}

/* ------------------------------------------------------------ Course grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.25s ease, border-color 0.25s ease;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.course-card__cover {
  height: 150px;
  background: linear-gradient(135deg, var(--brand), var(--brand-500));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: #fff;
  overflow: hidden;
}

.course-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px 160px at 80% 0%,
    rgba(255, 255, 255, 0.18),
    transparent 70%
  );
}

.course-card__category {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.92;
}

.course-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-card__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.course-card__subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  flex: 1;
}

.course-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 980px;
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.pill--level {
  background: var(--brand-100);
  color: var(--brand);
}

.course-card__arrow {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  font-size: 18px;
  transition: transform 0.2s ease;
}

.course-card:hover .course-card__arrow {
  transform: translateX(3px);
}

/* --------------------------------------------------- Course detail page */
.course-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #fff;
  padding: 56px 0 48px;
}

.course-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.course-hero__back:hover {
  color: #fff;
}

.course-hero__category {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-300);
  margin-bottom: 12px;
}

.course-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 18ch;
}

.course-hero__subtitle {
  font-size: clamp(17px, 2.4vw, 22px);
  color: rgba(255, 255, 255, 0.82);
  margin-top: 14px;
  max-width: 56ch;
}

.course-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.course-hero__meta .pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  backdrop-filter: blur(8px);
}

/* Player + playlist layout */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-info {
  margin-top: 22px;
}

.player-info__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.player-info__desc {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 8px;
  max-width: 62ch;
}

/* Playlist */
.playlist {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-tint);
  overflow: hidden;
  position: sticky;
  top: 80px;
}

.playlist__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.playlist__head h3 {
  font-size: 16px;
  font-weight: 600;
}

.playlist__head span {
  font-size: 13px;
  color: var(--text-secondary);
}

.playlist__items {
  list-style: none;
  max-height: 540px;
  overflow-y: auto;
}

.lesson {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.18s ease;
}

.lesson:last-child {
  border-bottom: none;
}

.lesson:hover {
  background: var(--bg-elevated);
}

.lesson.is-active {
  background: var(--brand-100);
}

.lesson__index {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

.lesson.is-active .lesson__index {
  background: var(--brand);
  color: #fff;
}

.lesson__body {
  flex: 1;
  min-width: 0;
}

.lesson__title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.lesson.is-active .lesson__title {
  color: var(--brand);
}

.lesson__duration {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* About / description block */
.prose {
  max-width: 70ch;
}

.prose h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.prose p {
  font-size: 17px;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------- States */
.empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-secondary);
}

.empty h2 {
  color: var(--text);
  font-size: 24px;
  margin-bottom: 8px;
}

/* ---------------------------------------------------------------- Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 40px 0;
  margin-top: 40px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo {
  height: 22px;
  opacity: 0.85;
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 880px) {
  .player-layout {
    grid-template-columns: 1fr;
  }
  .playlist {
    position: static;
  }
  .playlist__items {
    max-height: none;
  }
}

@media (max-width: 600px) {
  .nav__links {
    gap: 18px;
  }
  .hero {
    padding: 60px 0 44px;
  }
  .section {
    padding: 48px 0;
  }
}

/* Entrance animation */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rise {
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
