:root {
  --split: 55%;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #14212f;
  background: #f5f7fb;
  margin: 0;
}

a {
  color: #0f4c81;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer {
  background: #fff;
  border-bottom: 1px solid #d7dde6;
}

.site-footer {
  border-top: 1px solid #d7dde6;
}

.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: #0b2e4a;
}

.brand-mark {
  width: 44px;
  height: 44px;
  background: #0f4c81;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.main-nav a {
  color: #223248;
}

.split-layout {
  display: grid;
  grid-template-columns: var(--split) 1fr;
  min-height: calc(100vh - 180px);
  position: relative;
}

.panel {
  padding: 1.5rem 2rem 2.5rem;
  overflow-y: auto;
  background: #fff;
}

.panel--text {
  border-right: 1px solid #d7dde6;
}

.panel--video {
  background: #0f172a;
  color: #e2e8f0;
  position: relative;
}

.split-divider {
  position: absolute;
  top: 0;
  left: var(--split);
  width: 10px;
  transform: translateX(-5px);
  height: 100%;
  background: rgba(15, 76, 129, 0.15);
  cursor: col-resize;
  z-index: 20;
}

.split-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 64px;
  background: #0f4c81;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.section-card {
  border: 1px solid #d7dde6;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.section-card h2,
.section-card h3 {
  margin-top: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pill {
  background: #e7eef7;
  color: #0b2e4a;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.video-shell {
  position: sticky;
  top: 1.5rem;
}

.video-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.video-toggle,
.view-toggle button {
  background: #0f4c81;
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.video-toggle.secondary {
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.4);
}

.video-overlay {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: none;
  z-index: 10;
  max-height: 45%;
  overflow: auto;
}

.video-overlay.is-visible {
  display: block;
}

.overlay-links {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.overlay-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
}

.link-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f0b429;
  color: #1f2937;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.link-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.link-icon.anchor {
  background: rgba(59, 130, 246, 0.25);
}

.link-icon.site {
  background: rgba(16, 185, 129, 0.25);
}

.link-icon.download {
  background: rgba(234, 179, 8, 0.25);
}

.link-icon.external {
  background: rgba(248, 113, 113, 0.25);
}

.chapter-list {
  margin-top: 1.5rem;
}

.plyr__progress.has-chapter-markers {
  position: relative;
}

.plyr__progress .chapter-marker {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 10px;
  background: #f0b429;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  pointer-events: none;
}

.video-frame {
  aspect-ratio: 9 / 16;
  width: min(100%, 420px);
  margin: 0 auto;
}

.video-frame .plyr {
  height: 100%;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chapter-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(148, 163, 184, 0.2);
  border: none;
  color: #e2e8f0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.view-toggle {
  display: none;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.view-toggle button.is-active {
  background: #f0b429;
  color: #1f2937;
}

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

  .panel--text {
    border-right: none;
  }

  .split-divider {
    display: none;
  }

  .panel {
    display: none;
  }

  body[data-view="text"] .panel--text,
  body[data-view="video"] .panel--video {
    display: block;
  }

  .view-toggle {
    display: flex;
  }
}
