:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --surface: #12181d;
  --surface-2: #172027;
  --line: #2a3238;
  --text: #f5f2ea;
  --muted: #9da4aa;
  --orange: #e77c4b;
  --orange-soft: #f3b28e;
  --blue: #79b9ff;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input, video { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }

.site-header {
  position: sticky; top: 0; z-index: 50; height: 78px; border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 18, .94); backdrop-filter: blur(18px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  padding: 0 clamp(20px, 5vw, 78px); gap: 26px;
}
.brand { justify-self: start; border: 0; background: none; padding: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #ef8b59, #ca5c31); box-shadow: 0 8px 22px rgba(231,124,75,.28); font-size: 20px; }
.brand-copy strong { display: block; font: 700 18px/1 var(--serif); }
.brand-copy small { display: block; margin-top: 5px; color: #7f878d; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.main-nav { justify-self: center; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.nav-button, .home-link { border: 0; background: none; color: #b8bdc1; text-decoration: none; cursor: pointer; font-size: 14px; font-weight: 800; white-space: nowrap; flex-shrink: 0; padding: 12px 16px; border-radius: 999px; }
.nav-button:hover, .nav-button.is-active, .home-link:hover { background: #27221f; color: #ffd4bd; box-shadow: inset 0 0 0 1px #5f3a2a; }
.lesson-count { justify-self: end; color: #86bce7; font-size: 12px; font-weight: 800; }
.mobile-menu, .mobile-nav { display: none; }

.page { min-height: calc(100vh - 78px); }
.container { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 620px; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(46px, 7vw, 112px); align-items: center; padding: 72px 0; }
.eyebrow { color: var(--orange-soft); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ''; display: inline-block; width: 30px; height: 1px; background: var(--orange-soft); vertical-align: middle; margin-right: 14px; }
.hero h1 { margin: 22px 0 20px; font: 700 clamp(58px, 6.2vw, 94px)/.92 var(--serif); letter-spacing: -.045em; }
.hero h1 em { display: block; color: var(--orange); font-weight: 400; }
.hero-copy > p { max-width: 600px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.hero-actions { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; }
.primary, .secondary { min-height: 50px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-weight: 850; }
.primary { background: var(--orange); color: white; box-shadow: 0 14px 35px rgba(231,124,75,.2); }
.secondary { background: #151c21; border-color: #354049; }
.hero-stats { display: flex; gap: 26px; margin-top: 42px; }
.hero-stat { padding-right: 25px; border-right: 1px solid var(--line); }
.hero-stat:last-child { border: 0; }
.hero-stat strong { display: block; font: 700 22px/1 var(--serif); }
.hero-stat span { color: #757e85; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.featured-card { position: relative; overflow: hidden; min-height: 440px; border: 1px solid #3a4248; border-radius: 10px; background: #151b1f; cursor: pointer; box-shadow: 14px 14px 0 #2b211d; }
.featured-card img { width: 100%; height: 325px; object-fit: cover; }
.featured-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(9,12,14,.25) 62%, #0c1114 75%); pointer-events: none; }
.featured-copy { position: absolute; z-index: 2; left: 24px; right: 24px; bottom: 21px; }
.featured-copy h2 { margin: 9px 0 5px; font: 700 clamp(25px, 3vw, 36px)/1.08 var(--serif); }
.featured-copy p { margin: 0; color: #b0b5b8; font-size: 13px; }
.play-orb { position: absolute; z-index: 3; left: 50%; top: 44%; transform: translate(-50%,-50%); width: 58px; height: 58px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; font-size: 22px; box-shadow: 0 10px 26px rgba(0,0,0,.4); }

.category-strip { border-block: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.category-link { min-height: 112px; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 22px 26px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 16px; text-align: left; cursor: pointer; }
.category-link:last-child { border-right: 0; }
.category-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: #d86f3f; }
.category-link:nth-child(2) .category-icon { background: #348ccf; }
.category-link:nth-child(3) .category-icon { background: #e9b38f; color: #312016; }
.category-link:nth-child(4) .category-icon { background: #9b3de8; }
.category-link strong { display: block; font: 700 19px/1.08 var(--serif); }
.category-link small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }

.catalog { padding: 76px 0 110px; }
.section { margin-bottom: 86px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font: 700 clamp(32px, 4vw, 46px)/1 var(--serif); }
.section-heading .index { color: var(--orange); font: italic 16px/1 var(--serif); margin-right: 14px; }
.text-button { border: 0; background: none; cursor: pointer; color: #e6e4df; font-weight: 900; font-size: 11px; letter-spacing: .1em; }
.course-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.course-card { min-width: 0; }
.course-cover { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border: 0; padding: 0; overflow: hidden; background: #20272c; cursor: pointer; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.course-cover:hover img { transform: scale(1.025); }
.course-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.66)); }
.course-duration { position: absolute; z-index: 2; right: 8px; bottom: 8px; background: rgba(5,7,8,.82); padding: 4px 7px; font-size: 11px; }
.course-body { padding: 15px 3px 0; }
.course-meta { display: flex; align-items: center; justify-content: space-between; color: var(--orange-soft); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.bookmark { border: 0; background: none; cursor: pointer; color: #8d969c; font-size: 20px; padding: 2px 5px; }
.bookmark.is-active { color: var(--orange); }
.course-title { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.course-title h3 { margin: 10px 0 14px; font: 700 21px/1.14 var(--serif); }
.course-footer { border-top: 1px solid #232b30; padding-top: 13px; display: flex; justify-content: space-between; color: #7d858b; font-size: 10px; text-transform: uppercase; }
.free { color: #6db6f2; font-weight: 900; }

.library-hero { padding: 70px 0 35px; }
.library-hero h1 { margin: 10px 0 18px; font: 700 clamp(46px, 6vw, 78px)/.96 var(--serif); }
.library-hero p { max-width: 680px; color: var(--muted); line-height: 1.7; }
.library-tools { display: flex; gap: 14px; margin: 30px 0; flex-wrap: wrap; }
.search { min-width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); color: white; padding: 13px 16px; border-radius: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: #11171b; border-radius: 999px; padding: 10px 14px; cursor: pointer; color: #aeb5ba; }
.filter.is-active { color: white; border-color: #8b4c31; background: #2b211d; }
.empty { border: 1px dashed #39434a; padding: 42px; color: var(--muted); text-align: center; }

.lesson-page { min-height: calc(100vh - 78px); }
.lesson-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding: 30px clamp(20px,4vw,64px) 22px; border-bottom: 1px solid var(--line); background: #10161a; }
.lesson-head h1 { margin: 8px 0 0; font: 700 clamp(24px,2.4vw,29px)/1.04 var(--serif); }
.lesson-head-actions { display: flex; gap: 10px; align-items: center; }
.back { border: 1px solid #39434a; background: #151c21; border-radius: 999px; min-height: 42px; padding: 0 17px; cursor: pointer; font-weight: 800; }
.lab-frame { display: block; width: 100%; height: calc(100vh - 178px); min-height: 660px; border: 0; background: #0d1114; }
.standard-player { width: min(1180px,calc(100% - 40px)); margin: 40px auto; display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; }
.standard-player video { width: 100%; background: black; border-radius: 14px; }
.lesson-info { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.lesson-info h2 { font: 700 28px/1 var(--serif); }
.lesson-info li { margin: 10px 0; color: #bcc2c6; line-height: 1.5; }
.pill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: #28221e; border: 1px solid #69402e; color: #f2c3aa; padding: 7px 10px; border-radius: 999px; font-size: 12px; }

.site-footer { border-top: 1px solid var(--line); padding: 42px 0; color: #747d83; font-size: 11px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; align-items: center; }

@media (min-width: 981px) and (max-width: 1180px) {
  .site-header { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); padding-inline: 20px; gap: 12px; }
  .main-nav .nav-button, .main-nav .home-link { padding-inline: 12px; }
  .lesson-count { display: none; }
}

@media (max-width: 980px) {
  .site-header { height: auto; min-height: 68px; grid-template-columns: 1fr auto; padding: 10px 15px; }
  .brand-copy small, .lesson-count, .main-nav { display: none; }
  .mobile-menu { display: block; border: 1px solid var(--line); background: #151c21; border-radius: 9px; padding: 9px 12px; }
  .mobile-nav { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
  .mobile-nav .nav-button { min-width: 0; padding-inline: 6px; }
  .mobile-nav[hidden] { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding: 54px 0; }
  .featured-card { min-height: 390px; }
  .category-strip { grid-template-columns: 1fr 1fr; }
  .category-link:nth-child(2) { border-right: 0; }
  .category-link { border-bottom: 1px solid var(--line); }
  .course-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lesson-head { grid-template-columns: 1fr; align-items: start; }
  .lesson-head-actions { justify-content: space-between; flex-wrap: wrap; }
  .lab-frame { height: calc(100vh - 190px); min-height: 720px; }
  .standard-player { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body.lesson-focus #edgy-pwa-install { display: none !important; }
  body.lesson-focus { overflow: hidden; }
  body.lesson-focus .site-header { display: none; }
  .site-header { height: 56px; min-height: 56px; padding: 6px 12px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 9px; }
  .brand-copy strong { font-size: 18px; }
  .mobile-menu { padding: 7px 10px; }
  .container { width: min(100% - 28px,1280px); }
  .hero h1 { font-size: clamp(50px,16vw,70px); }
  .hero-stats { gap: 12px; }
  .hero-stat { padding-right: 12px; }
  .featured-card { min-height: 330px; box-shadow: 8px 8px 0 #2b211d; }
  .featured-card img { height: 250px; }
  .category-strip { grid-template-columns: 1fr; }
  .category-link { border-right: 0; }
  .course-grid { grid-template-columns: 1fr; gap: 34px; }
  .section { margin-bottom: 58px; }
  .section-heading { align-items: start; }
  .library-tools { display: block; }
  .filters { margin-top: 12px; }
  .lesson-page {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 60px minmax(0, 1fr);
  }
  .lesson-head {
    min-height: 0;
    padding: 9px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
  .lesson-head > div:first-child { grid-column: 2; min-width: 0; }
  .lesson-head .eyebrow { font-size: 8px; letter-spacing: .11em; }
  .lesson-head h1 {
    margin-top: 2px;
    overflow: visible;
    white-space: nowrap;
    font-size: 15.2px;
    line-height: 1;
  }
  .lesson-head-actions { grid-column: 1; grid-row: 1; justify-content: flex-start; flex-wrap: nowrap; gap: 6px; }
  .back { min-height: 32px; padding: 0 9px; font-size: 11px; }
  .bookmark { font-size: 17px; }
  body.lesson-focus .lesson-head .bookmark { display: none; }
  .lab-frame { height: 100%; min-height: 0; }
  .footer-inner { align-items: start; flex-direction: column; }
}

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