:root {
  --ink: #102419;
  --muted: #5e6f65;
  --green: #176b43;
  --green-dark: #113f2b;
  --green-soft: #e9f3ed;
  --lime: #d7ef46;
  --paper: #f7f8f4;
  --white: #fff;
  --line: #dbe3dc;
  --shadow: 0 12px 30px rgba(16, 36, 25, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.site-header {
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--white);
  background: var(--green-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand strong { color: var(--lime); }

.brand-mark {
  width: 34px;
  height: 27px;
  position: relative;
  display: inline-block;
  border: 2px solid var(--lime);
  border-radius: 5px;
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--lime);
}

.brand-mark span {
  position: absolute;
  width: 8px;
  height: 2px;
  right: -7px;
  top: 4px;
  background: var(--lime);
  box-shadow: 0 7px 0 var(--lime), 0 14px 0 var(--lime);
}

.channel-link {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.55);
}

.hero {
  color: var(--white);
  background: var(--green-dark);
  padding: 42px clamp(16px, 4vw, 56px) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: clamp(30px, 7vw, 90px);
  align-items: end;
}

.hero-copy { max-width: 780px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero .eyebrow { color: var(--lime); }

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy > p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: #dce8e0;
  font-size: clamp(16px, 2vw, 19px);
}

.search label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.search-field {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px 1fr 38px;
  gap: 8px;
  align-items: center;
  padding: 0 8px 0 16px;
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 6px;
}

.search-field:focus-within { border-color: var(--lime); }

.search-field svg {
  width: 21px;
  fill: none;
  stroke: var(--green-dark);
  stroke-width: 2;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 50px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field button,
.dialog-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 25px;
}

.search-field button { color: var(--muted); background: transparent; visibility: hidden; }
.search-field button.is-visible { visibility: visible; }

.controls {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 13px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 244, .96);
  backdrop-filter: blur(8px);
}

.type-switch {
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 12px;
  padding: 3px;
  background: #e5ebe6;
  border-radius: 6px;
}

.type-switch button,
.theme-nav button,
.load-more,
.empty-state button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.type-switch button {
  padding: 8px 15px;
  color: var(--muted);
  background: transparent;
  border-radius: 4px;
}

.type-switch button.is-active { color: var(--green-dark); background: var(--white); box-shadow: 0 1px 4px rgba(16,36,25,.12); }

.theme-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.theme-nav button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  color: var(--green-dark);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.theme-nav button.is-active { color: var(--white); background: var(--green); border-color: var(--green); }

.catalog { padding: 38px clamp(16px, 4vw, 56px) 64px; }

.catalog-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 20px;
}

.catalog-heading h2,
.destinations h2,
.empty-state h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.12;
}

.result-count { margin-bottom: 4px; color: var(--muted); font-size: 14px; font-weight: 700; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px 18px;
}

.video-card { min-width: 0; }

.video-button {
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.thumbnail {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #cbd7ce;
  border-radius: 6px;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .25s ease;
}

.video-button:hover .thumbnail img,
.video-button:focus-visible .thumbnail img { transform: scale(1.035); }

.play {
  width: 46px;
  height: 34px;
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: var(--white);
  background: rgba(17, 63, 43, .92);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}

.play::after {
  content: "";
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--white);
}

.duration,
.format-badge {
  position: absolute;
  bottom: 7px;
  padding: 3px 6px;
  color: var(--white);
  background: rgba(0,0,0,.78);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 800;
}

.duration { right: 7px; }
.format-badge { left: 7px; }

.card-meta {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 10px 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-meta span + span::before { content: "•"; margin-right: 7px; color: #95a39a; }

.video-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.32;
  letter-spacing: 0;
}

.load-more,
.empty-state button {
  min-height: 48px;
  display: block;
  margin: 34px auto 0;
  padding: 11px 20px;
  color: var(--white);
  background: var(--green);
  border-radius: 6px;
}

.empty-state { padding: 60px 20px; text-align: center; }
.empty-state p { margin: 10px auto 0; color: var(--muted); }

.destinations {
  padding: 46px clamp(16px, 4vw, 56px);
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(28px, 6vw, 80px);
  color: var(--white);
  background: var(--green-dark);
}

.destinations .eyebrow { color: var(--lime); }

.destination-links { display: grid; }

.destination-links a {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,.24);
  font-weight: 800;
  text-decoration: none;
}

.destination-links a:first-child { border-top: 1px solid rgba(255,255,255,.24); }
.destination-links span { color: var(--lime); }

footer {
  padding: 22px clamp(16px, 4vw, 56px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #bfd0c4;
  background: #0b2b1d;
  font-size: 13px;
}

footer p { margin: 0; }

dialog {
  width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(4, 18, 11, .82); }

.dialog-close {
  position: absolute;
  z-index: 2;
  right: 10px;
  top: 10px;
  color: var(--white);
  background: rgba(0,0,0,.7);
}

.player-wrap { aspect-ratio: 16 / 9; background: #07110b; }
.player-wrap iframe { width: 100%; height: 100%; display: block; border: 0; }

.dialog-copy { padding: 20px 22px 24px; }
.dialog-copy h2 { margin-bottom: 12px; font-size: clamp(20px, 3vw, 30px); line-height: 1.18; }
.dialog-copy a { color: var(--green); font-weight: 800; text-decoration: none; }

@media (max-width: 1050px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { min-height: 60px; }
  .channel-link { font-size: 12px; }
  .hero { padding-top: 30px; grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: 38px; }
  .controls { padding-top: 10px; padding-bottom: 10px; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .catalog { padding-top: 28px; }
  .video-card h3 { font-size: 14px; }
  .card-meta { align-items: flex-start; flex-direction: column; gap: 1px; }
  .card-meta span + span::before { content: none; }
  .destinations { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand { font-size: 17px; }
  .brand-mark { width: 31px; height: 25px; }
  .channel-link { max-width: 104px; text-align: right; line-height: 1.2; }
  h1 { font-size: 34px; }
  .hero-copy > p:last-child { font-size: 16px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

[hidden] { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 10; padding: 12px; background: #fff; color: #113f2b; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #ad6a00; outline-offset: 4px; }
.compact-hero { padding-top: 24px; padding-bottom: 26px; }
.compact-hero h1 { font-size: clamp(27px,3.5vw,44px); line-height: 1.08; margin-bottom: 12px; }
.compact-hero p:last-child { max-width: 65ch; font-size: 17px; margin-bottom: 0; }
.search-field { grid-template-columns: minmax(0,1fr) 38px; }
.controls .type-switch { margin-bottom: 0; }
.theme-nav a { flex: 0 0 auto; text-decoration: none; padding: 10px 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--green-dark); background: #fff; font-size: 14px; font-weight: 700; }
.theme-nav a[aria-current] { background: var(--green); border-color: var(--green); color: #fff; }
.controls .type-switch { margin-top: 10px; }
.video-button { display: block; text-decoration: none; }
.thumbnail { display: block; }
.video-card h3 { overflow-wrap: anywhere; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 0 20px; font-size: 13px; color: #526156; overflow-wrap: anywhere; }
.breadcrumbs a:last-child { text-decoration: none; }
.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 30px; }
.pagination a { min-width: 44px; min-height: 44px; padding: 10px; background: #fff; border: 1px solid var(--line); text-align: center; text-decoration: none; border-radius: 5px; }
.pagination a[aria-current] { color: #fff; background: var(--green); }
.project-links { display: grid; gap: 12px; padding: 24px clamp(16px,4vw,56px); background: var(--green-soft); }
.project-links p { margin: 0; }
.primary-link { width: fit-content; max-width: 100%; background: var(--green); color: #fff; text-decoration: none; padding: 12px 18px; font-weight: 700; border-radius: 5px; }
.learning-paths { padding: 10px clamp(16px,4vw,56px) 35px; }
.learning-paths a { display: block; width: fit-content; padding: 12px 0; font-weight: 700; }
.watch-page > .breadcrumbs { padding: 18px clamp(16px,4vw,56px) 0; }
.watch-main, .related { padding: 24px clamp(16px,4vw,56px); max-width: 1320px; margin: auto; }
.watch-main h1 { max-width: 38ch; font-size: clamp(25px,3.4vw,42px); line-height: 1.12; margin: 0 0 18px; }
.watch-main .eyebrow { margin-bottom: 8px; }
.watch-player { width: min(100%,1000px); aspect-ratio: 16 / 9; background: #07110b; border-radius: 6px; overflow: hidden; }
.watch-player iframe { width: 100%; height: 100%; display: block; border: 0; }
.watch-player { background-position: center; background-size: cover; }
.portrait-player { width: min(100%,320px); aspect-ratio: 9 / 16; }
.watch-meta { font-size: 13px; color: #536258; margin: 12px 0; }
.video-summary { max-width: 78ch; font-size: 18px; }
.chapters { display: flex; flex-wrap: wrap; gap: 8px 16px; max-width: 80ch; margin: 20px 0; }
.chapters a { padding: 10px 0; }
.archive-note { max-width: 78ch; padding: 12px 15px; background: #fff3d9; font-size: 14px; border-left: 3px solid #946319; }
.about, .path-intro { padding: 30px clamp(16px,4vw,56px); max-width: 1100px; }
.about h1, .path-intro h1 { font-size: clamp(29px,4vw,44px); line-height: 1.12; }
.path-page > .breadcrumbs { padding: 18px clamp(16px,4vw,56px) 0; }
.path-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; padding: 10px clamp(32px,5vw,72px) 35px; }
.path-steps h2 { font-size: 22px; }
.path-steps li { min-width: 0; }
@media (max-width:760px) {
 .compact-hero { gap: 20px; }
 .compact-hero h1 { font-size: 30px; }
 .compact-hero p:last-child { font-size: 16px; }
 .controls { position: static; }
 .catalog { padding-bottom: 32px; }
 .video-summary { font-size: 16px; }
 .watch-main { padding-top: 16px; }
 .watch-main h1 { font-size: 27px; }
 .path-steps { grid-template-columns: 1fr; }
 .path-steps .video-card { max-width: 560px; }
}
