/* Your Paint Expert brand tokens (from system.yourpaintexpert.com) */
:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --text: #f8f8f8;
  --muted: #a0a0a0;
  --line: rgba(152, 136, 120, .32);
  --line-strong: rgba(152, 136, 120, .6);
  --accent: #988878;
  --accent-dark: #857458;
  --accent-soft: rgba(152, 136, 120, .14);
  --sidebar-w: 300px; --topbar-h: 64px; --radius: 12px;
  --video-w: 720px;
  color-scheme: dark;
}
/* The brand is always dark; these keep the theme identical under either OS setting. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0a0a0a; } }
:root[data-theme="dark"] { --bg: #0a0a0a; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
svg { width: 1em; height: 1em; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 16px; background: rgba(10,10,10,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.brand img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
.menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; padding: 0 10px; }
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
@media (min-width: 841px) { .menu-toggle { display: none; } }

.crumbs { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span:not(.sep) { color: var(--text); font-weight: 500; }
.crumbs .sep { color: var(--accent); opacity: .7; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.sidebar-inner { padding: 20px 16px; }
.sidebar-track { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 600; }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: 14px; line-height: 1.4; color: var(--muted); }
.lesson-list a:hover { background: var(--surface-2); color: var(--text); }
.lesson-list a[aria-current="true"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.lesson-list .num { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-size: 11px; display: grid; place-items: center; color: var(--muted); }
.lesson-list a[aria-current="true"] .num { border-color: var(--accent); color: var(--accent); }

.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; }

/* Content */
.content { flex: 1; min-width: 0; padding: 44px 16px 80px; }
.page, .lesson { max-width: 960px; margin: 0 auto; }
.page.home { max-width: 880px; text-align: center; }
h1 { margin: 0 0 12px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.lesson h1 { margin-bottom: 20px; font-size: clamp(22px, 3vw, 30px); }
.eyebrow { margin: 0 0 8px; font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.lede { margin: 0 0 28px; color: var(--muted); font-size: 17px; max-width: 64ch; }
.home .lede { margin-left: auto; margin-right: auto; }
.section-heading { margin: 40px 0 16px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.section-heading.spaced { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.intro-title { margin: 24px 0 12px; font-size: 16px; font-weight: 600; color: var(--text); }
.notes { margin: 16px auto 0; color: var(--muted); font-size: 15px; max-width: var(--video-w); }
.empty { color: var(--muted); font-size: 15px; }

/* Video */
.video-frame { position: relative; width: 100%; max-width: var(--video-w); aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.6); margin: 0 auto; }
.page:not(.home) .video-frame, .lesson .video-frame { margin-left: 0; }
.page:not(.home) .notes, .lesson .notes { margin-left: 0; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame.portrait { aspect-ratio: 9 / 16; max-width: 360px; }
.video-frame .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 15px; }
.video-frame .placeholder svg { width: 44px; height: 44px; color: var(--accent); opacity: .7; }

/* Cards */
.card-grid { display: grid; gap: 14px; text-align: left; }
.card-grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card-grid.three { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .18s, transform .18s, background .18s; }
.card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }
.card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.card-icon svg { width: 22px; height: 22px; }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: 14px; line-height: 1.45; }
.card-meta { margin-top: auto; font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.card.empty { opacity: .5; }
.home .card-grid.two .card { padding: 28px; }
.home .card-grid.two .card-title { font-size: 22px; }

/* Featured folder (sits right under a platform's intro video) */
.card.featured { flex-direction: row; align-items: center; gap: 18px; max-width: var(--video-w); margin-top: 14px; padding: 18px 22px; border-color: var(--line-strong); }
.card.featured .card-body { flex: 1; }
.card.featured .card-meta { margin-top: 0; white-space: nowrap; }

/* Video list (inside a folder) */
.video-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.video-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .18s, background .18s; }
.video-list a:hover { border-color: var(--accent); background: var(--surface-2); }
.video-list .num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); font-size: 12px; display: grid; place-items: center; color: var(--muted); }
.video-list .play { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.video-list .play svg { width: 18px; height: 18px; }
.video-list .vtitle { font-weight: 500; font-size: 15px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 28px; padding: 10px 16px 10px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-weight: 500; font-size: 14px; color: var(--text); }
.back-link:hover { border-color: var(--accent); color: var(--accent); }
.back-link svg { width: 16px; height: 16px; }

/* Mobile */
@media (max-width: 840px) {
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); z-index: 25; transform: translateX(-100%); transition: transform .2s ease; width: min(85vw, var(--sidebar-w)); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; }
  .content { padding: 28px 16px 64px; }
  .crumbs { font-size: 12px; }
  .crumbs a:first-child, .crumbs a:first-child + .sep { display: none; }
  .brand span { display: none; }
  .card.featured { flex-direction: column; align-items: flex-start; }
  .section-heading.spaced { margin-top: 48px; padding-top: 24px; }
}
