/* ----- Tokens ---------------------------------------------------------- */
:root {
  /* Brand */
  --brand: hsl(40 95% 55%);
  --brand-soft: hsl(40 95% 55% / 0.12);

  /* Light surface (main panel) */
  --bg: hsl(0 0% 100%);
  --bg-soft: hsl(40 20% 96%);
  --fg: hsl(0 0% 10%);
  --fg-muted: hsl(0 0% 42%);
  --border: hsl(40 15% 88%);

  /* Dark surface (sidebar) */
  --side-bg: hsl(40 6% 17%);
  --side-bg-hover: hsl(40 6% 23%);
  --side-fg: hsl(40 8% 88%);
  --side-fg-muted: hsl(40 6% 60%);
  --side-border: hsl(40 6% 26%);

  /* Geometry */
  --sidebar-w: 220px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 999px;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ----- Reset ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* ----- Sidebar ---------------------------------------------------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--side-bg);
  color: var(--side-fg);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 0.5px solid var(--side-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-logo {
  height: 28px;
  width: auto;
}

.menu-toggle {
  display: none;
  width: 28px;
  height: 28px;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--side-fg);
  border-radius: 1px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 0 24px;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--side-fg-muted);
  padding: 0 20px;
  margin: 0 0 6px;
}

.nav-item {
  display: block;
  padding: 8px 18px 8px 20px;
  color: var(--side-fg);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}
.nav-item:hover {
  background: var(--side-bg-hover);
}
.nav-item .nav-item-duration {
  display: block;
  font-size: 11px;
  color: var(--side-fg-muted);
  margin-top: 2px;
}
.nav-item.is-active {
  background: var(--bg);
  color: var(--fg);
  border-left-color: var(--brand);
  font-weight: 500;
}
.nav-item.is-active .nav-item-duration {
  color: var(--fg-muted);
}

.sidebar-footer {
  padding: 14px 20px 18px;
  border-top: 0.5px solid var(--side-border);
  font-size: 11px;
  color: var(--side-fg-muted);
  line-height: 1.45;
}
.sidebar-footer a {
  color: var(--side-fg);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2px;
}

/* ----- Main panel ------------------------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  padding: 28px 32px 56px;
  min-height: 100vh;
  background: var(--bg);
}

.video-page {
  max-width: 960px;
}

.breadcrumb {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0 0 10px;
}
.breadcrumb-sep {
  margin: 0 6px;
  color: var(--border);
}

.video-title {
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--fg);
  line-height: 1.25;
}

.video-description {
  font-size: 14px;
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 0 16px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--fg-muted);
}
.meta-pill {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}
.meta-dot {
  width: 3px;
  height: 3px;
  background: var(--border);
  border-radius: 50%;
  display: inline-block;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: hsl(0 0% 96%);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(0 0% 100%);
  background: hsl(0 0% 0% / 0.55);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.expand-btn:hover {
  background: hsl(0 0% 0% / 0.75);
}
.expand-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--fg);
}

/* ----- Text page -------------------------------------------------------- */
.text-page {
  max-width: 640px;
}

.text-body p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 18px;
}
.text-body p:last-child {
  margin-bottom: 0;
}

.text-mission {
  margin: 28px 0 0;
  padding: 8px 0 8px 20px;
  border-left: 3px solid var(--brand);
  font-size: 17px;
  font-style: italic;
  line-height: 1.65;
  color: var(--fg);
}

/* ----- Empty / fallback ------------------------------------------------- */
.video-empty {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  font-size: 14px;
  max-width: 560px;
}

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar {
    inset: 0 0 auto 0;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
  }
  .menu-toggle {
    display: flex;
  }
  .sidebar-body {
    display: none;
  }
  .sidebar.is-open .sidebar-body {
    display: flex;
  }
  .sidebar-nav {
    padding: 8px 0 18px;
  }
  .main {
    margin-left: 0;
    margin-top: 64px;
    padding: 20px 18px 48px;
  }
}

/* ----- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
