:root {
  --bg: #fff8f0;
  --card: #ffffff;
  --ink: #1b2340;
  --muted: #5d6480;
  --line: #eddccb;
  --accent: #ff8a1e;
  --accent-ink: #1b2340;
  --accent-deep: #c9561c;
  --navy: #1b2340;
  --plum: #5b2a4e;
  --shadow: 0 1px 2px rgba(27, 35, 64, .08), 0 4px 14px rgba(27, 35, 64, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11162a;
    --card: #1b2340;
    --ink: #f4eee7;
    --muted: #a9afc6;
    --line: #2b3459;
    --accent-deep: #ffa04a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-deep); }
h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.05rem; font-weight: 800; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 900; font-size: 1.15rem; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #e9e6f2; text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800;
  padding: 10px 18px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
@media (max-width: 720px) {
  .top .wrap { padding-top: 8px; padding-bottom: 8px; gap: 8px; }
  .top .btn { margin-left: auto; padding: 8px 14px; }
  .nav { order: 3; width: 100%; margin: 0 -10px; gap: 0; }
  .nav a { padding: 6px 10px; }
}

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--plum); }
.hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(27, 35, 64, .82) 0%, rgba(27, 35, 64, .45) 50%, rgba(27, 35, 64, 0) 75%); }
.hero .wrap { position: relative; z-index: 1; display: flex; align-items: flex-end; min-height: 460px; gap: 24px; }
.hero-text { flex: 1 1 520px; padding: 56px 0; max-width: 600px; }
.hero-text p { font-size: 1.15rem; margin: 0 0 24px; }
.hero-text .btn.ghost { color: #fff; margin-left: 8px; }
.hero-avatar { flex: 0 0 auto; width: 200px; align-self: flex-end; margin-bottom: -4px; }
@media (max-width: 720px) {
  .hero .wrap { min-height: 0; }
  .hero::after { background: linear-gradient(180deg, rgba(27, 35, 64, .55) 0%, rgba(27, 35, 64, .85) 100%); }
  .hero-avatar { display: none; }
  .hero-text { padding: 40px 0; }
}

.page-head { padding: 40px 0 8px; }
.page-head p { max-width: 640px; margin: 0; }
section { padding: 32px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Video grid */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.vcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.vcard button { all: unset; cursor: pointer; display: block; }
.vcard button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.thumb { display: block; position: relative; aspect-ratio: 16 / 9; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s; background: rgba(0, 0, 0, .25); }
.thumb .play svg { width: 56px; height: 56px; }
.vcard:hover .play, .vchip:hover .play { opacity: 1; }
.badge { position: absolute; right: 8px; bottom: 8px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.vcard .meta { padding: 12px 14px 16px; }
.vcard h3 { margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard h3 a { color: inherit; text-decoration: none; }
.vcard h3 a:hover { color: var(--accent-deep); }
.vcard .meta p { margin: 0; font-size: .85rem; color: var(--muted); }

.search { display: block; width: 100%; max-width: 420px; font: inherit; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink); margin: 16px 0 24px; }
.search:focus { outline: none; border-color: var(--accent); }
.empty { background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }
[hidden] { display: none !important; }

/* Topic tiles */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-decoration: none; color: inherit; border-top: 5px solid var(--accent); }
.tile:hover { transform: translateY(-2px); }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Gear */
.gear { display: grid; gap: 20px; }
.gcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; grid-template-columns: 140px 1fr; gap: 20px; }
.gcard .pimg { width: 140px; height: 140px; background: #fff; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.gcard .pimg img { max-width: 92%; max-height: 92%; object-fit: contain; }
.gcard h3 { font-size: 1.2rem; margin: 0 0 4px; }
.gcard .note { margin: 0 0 12px; }
.gcard .src { font-size: .8rem; color: var(--muted); margin-left: 8px; }
.vchips { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.vchip { all: unset; display: block; cursor: pointer; width: 160px; font-size: .8rem; line-height: 1.3; }
.vchip .vt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 1000px) { .gear { grid-template-columns: 1fr 1fr; align-items: start; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 8px; }
.chip { font: inherit; font-weight: 700; font-size: .95rem; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ggroup { padding: 24px 0 8px; }
@media (max-width: 720px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
}
.vchip .thumb { border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.vchip .play svg { width: 36px; height: 36px; }
.vchip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
@media (max-width: 560px) {
  .gcard { grid-template-columns: 1fr; }
  .gcard .pimg { width: 100%; height: 180px; }
  .vchip { width: calc(50% - 6px); }
}

/* Links out */
.links { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.link { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; color: inherit; display: flex; gap: 16px; align-items: center; }
.link img { width: 56px; height: 56px; object-fit: contain; flex: 0 0 56px; }
.link strong { display: block; font-size: 1.05rem; }
.link span { color: var(--muted); font-size: .92rem; display: block; }
.link em { font-style: normal; color: var(--accent-deep); font-weight: 700; font-size: .9rem; }

/* About */
.about { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; padding: 40px 0; }
.about p { max-width: 640px; }
@media (max-width: 720px) { .about { grid-template-columns: 1fr; } .about img { max-width: 200px; } }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 20, .94); display: none; align-items: center; justify-content: center; padding: 64px 16px 16px; }
.lightbox.open { display: flex; }
.lb-body { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1160px; max-height: 100%; }
.lb-video { width: 100%; aspect-ratio: 16 / 9; flex-shrink: 0; }
.lb-video iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
.lightbox.short .lb-video { aspect-ratio: 9 / 16; width: auto; height: min(78vh, 720px); max-width: 100%; margin: 0 auto; }
.lb-desc { color: #dfe2ee; overflow-y: auto; min-height: 0; }
.lb-desc h2 { color: #fff; font-size: 1.3rem; }
.lb-desc p { white-space: pre-line; font-size: .95rem; margin: 0 0 16px; }
.lb-desc .btn { margin-right: 8px; margin-bottom: 8px; }
.lb-desc .btn.ghost { color: #fff; }
.lb-close { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-close:hover { background: rgba(255, 255, 255, .26); }
@media (min-width: 900px) {
  .lb-body { flex-direction: row; align-items: center; }
  .lb-video { flex: 1 1 64%; width: auto; }
  .lightbox.short .lb-video { flex: 0 0 auto; margin: 0; }
  .lb-desc { flex: 1 1 36%; max-height: 80vh; }
}

/* Footer */
footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; font-size: .9rem; color: var(--muted); }
footer .wrap { display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: inherit; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
