:root {
  --ink: #111214;
  --muted: #6b6f76;
  --line: #e7e8eb;
  --chip: #f2f3f5;
  --chip-hover: #e6e8eb;
  --bg: #ffffff;
  --radius: 4px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
main { flex: 1; padding-bottom: 5rem; outline: none; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--muted); }

/* ---------- pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 38px; padding: 0 1.05rem; border-radius: 999px; border: 0;
  font: inherit; font-size: .9rem; font-weight: 400; text-decoration: none; white-space: nowrap;
  background: var(--chip); color: var(--ink); cursor: pointer; transition: background .15s;
}
.pill:hover { background: var(--chip-hover); }
.pill-dark { background: var(--ink); color: #fff; }
.pill-dark:hover { background: #2a2c30; }
.pill-sm { height: 28px; padding: 0 .8rem; font-size: .78rem; }
.pill.active { background: var(--ink); color: #fff; }

/* ---------- header ---------- */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; flex-wrap: wrap; }
.brand-group { display: flex; align-items: center; gap: .45rem; }
.brand { font-weight: 600; letter-spacing: -0.02em; }
.tag { width: 38px; padding: 0; font-size: .75rem; color: var(--muted); }
.nav { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }

/* ---------- section heads ---------- */
.section { margin-top: 3.2rem; }
.section:first-child { margin-top: 1.2rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.section-head h1, .section-head h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
.page-intro { color: var(--muted); margin: -.8rem 0 1.6rem; max-width: 60ch; }

/* ---------- horizontal rail ---------- */
.rail {
  display: flex; gap: 1.4rem; overflow-x: auto; scroll-snap-type: x proximity;
  margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); padding-bottom: .6rem;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 min(320px, 78vw); }
.rail > .featured { flex-basis: min(560px, 88vw); }

/* ---------- product-style cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.2rem 1.4rem; }
.pcard { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; }
.pcard-media { display: block; position: relative; height: 300px; overflow: hidden; border-radius: var(--radius); margin-bottom: 1rem; text-decoration: none; background: var(--chip); }
.featured .pcard-media { height: 420px; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
a.pcard-media:hover img { transform: scale(1.03); }
.pcard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.pcard h3 { font-size: 1.08rem; font-weight: 500; letter-spacing: -0.01em; }
.pcard h3 a { text-decoration: none; }
.pcard-price { font-weight: 500; white-space: nowrap; }
.pcard-sub { margin: .1rem 0 .7rem; font-size: .85rem; }
.pcard .pill-sm { align-self: flex-start; }
.pcard-desc { margin: .9rem 0 0; color: var(--muted); font-size: .9rem; max-width: 52ch; }

/* placeholder art when no photo is set */
.ph { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 1.3rem; background: var(--ph, #e9e4dc); color: rgba(17,18,20,.85); }
.ph-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.ph-word { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 500; letter-spacing: -0.04em; line-height: .95; }
.ph-kicks { --ph: #f4a46c; }
.ph-flexibility { --ph: #ece2d3; }
.ph-fundamentals { --ph: #cfe0f3; }
.ph-forms-poomsae { --ph: #d6e6c6; }
.ph-sparring { --ph: #f3c2b4; }
.ph-self-defence { --ph: #dcd5f0; }
.ph-conditioning { --ph: #f2e1a2; }
.ph-post { --ph: #e3e7ee; }

/* ---------- advantages ---------- */
.adv { flex-basis: min(420px, 82vw) !important; }
.adv .pcard-media { height: 380px; }
.adv-text { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; align-items: start; }
.adv-text h3 { font-size: 1.3rem; }
.adv-text p { margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- filters ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 2rem; }
.filters input, .filters select {
  font: inherit; font-size: .9rem; height: 38px; padding: 0 1rem; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--ink); appearance: none;
}
.filters select { padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.filters input { flex: 1 1 240px; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- youtube lite embed ---------- */
.yt { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; }
.yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.yt:hover img { transform: scale(1.03); }
.yt-play { position: absolute; left: 1rem; bottom: 1rem; width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.yt-play::after { content: ""; position: absolute; left: 19px; top: 15px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent var(--ink); }
.yt-frame { width: 100%; height: 100%; border: 0; display: block; }
.detail-video { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; margin: 1.8rem 0; }

/* ---------- detail pages ---------- */
.detail { max-width: 820px; padding-top: 1.2rem; }
.detail h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 1.2rem 0 .8rem; }
.detail h2 { font-size: 1.6rem; margin: 2.4rem 0 1rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0; }
.detail-img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); margin: 1.8rem 0; }
.exercises { padding: 0; margin: 0; list-style: none; counter-reset: ex; border-top: 1px solid var(--line); }
.exercises li { counter-increment: ex; display: grid; grid-template-columns: 3rem 1fr auto; gap: 1rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.exercises li::before { content: counter(ex, decimal-leading-zero); color: var(--muted); font-size: .85rem; }
.exercises strong { font-weight: 500; }
.exercises span { color: var(--muted); font-size: .9rem; text-align: right; }
.prose { font-size: 1.05rem; color: #2a2c30; }
.prose h2, .prose h3 { margin: 2rem 0 .7rem; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); }
.prose blockquote { margin: 1.5rem 0; padding: 1.2rem 1.4rem; background: var(--chip); border-radius: var(--radius); font-size: 1.15rem; }
.prose blockquote p { margin: 0; }
.prose.small { font-size: .9rem; color: var(--muted); }

.empty { background: var(--chip); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; }
.empty p { margin: .2rem 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-block: 2rem; }
.footer-inner p { margin: 0; max-width: 62ch; }

@media (max-width: 640px) {
  .header-inner { min-height: 68px; padding-block: .6rem; }
  .nav .pill { height: 34px; padding: 0 .8rem; font-size: .85rem; }
  .pcard-media { height: 240px; }
  .featured .pcard-media, .adv .pcard-media { height: 300px; }
  .adv-text { grid-template-columns: 1fr; }
  .exercises li { grid-template-columns: 2.2rem 1fr; }
  .exercises span { grid-column: 2; text-align: left; }
}

/* =====================================================================
   Usability pass
   ===================================================================== */

/* ---------- focus + skip link + motion ---------- */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.pill:focus-visible, .belt-chip:focus-visible { outline-offset: 2px; border-radius: 999px; }
h1:focus { outline: none; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: .8rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- header: one row everywhere ---------- */
.header-inner { flex-wrap: nowrap; }
.nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.pill[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- belt dots ---------- */
.belt-label { display: inline-flex; align-items: center; gap: .35rem; }
.belt-dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); background: #ddd; }
.belt-white { background: #fff; }
.belt-yellow { background: #f7cf2e; }
.belt-green { background: #2e9e4f; }
.belt-blue { background: #1f5fbf; }
.belt-red { background: #c8102e; }
.belt-black { background: #111; }
.belt-all-levels { background: conic-gradient(#fff 0 17%, #f7cf2e 0 33%, #2e9e4f 0 50%, #1f5fbf 0 67%, #c8102e 0 83%, #111 0); }
.pcard-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .45rem; color: var(--ink); }
.pcard-sub .sep { color: var(--muted); }

/* ---------- intro + belt picker ---------- */
.intro h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); max-width: 22ch; margin-bottom: 1.2rem; }
.intro .page-intro { margin: 0 0 1.2rem; }
.belt-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
.belt-chip { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border-radius: 14px; background: var(--chip); text-decoration: none; transition: background .15s, transform .15s; }
.belt-chip:hover { background: var(--chip-hover); transform: translateY(-1px); }
.belt-chip .belt-dot { width: 1.1rem; height: 1.1rem; margin-bottom: .45rem; }
.belt-chip-name { font-weight: 500; }
.belt-chip-count { font-size: .8rem; color: var(--muted); }

/* ---------- rail arrows ---------- */
.head-actions { display: flex; align-items: center; gap: .6rem; }
.rail-arrows { display: flex; gap: .35rem; }
.rail-arrows[hidden] { display: none; }
.arrow { width: 38px; padding: 0; font-size: 1.3rem; line-height: 1; }
.arrow:disabled { opacity: .35; cursor: default; }

/* ---------- filter results ---------- */
.filters { margin-bottom: .8rem; }
.results-bar { display: flex; align-items: center; gap: .8rem; min-height: 28px; margin-bottom: 1.6rem; color: var(--muted); font-size: .9rem; }

/* ---------- workout page ---------- */
.detail .lead { margin-top: 1.2rem; }
.detail-meta a.pill { text-decoration: none; }
.meta-date { color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.session-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.4rem 0 1rem; }
.session-head h2 { margin: 0; }
.session-actions { display: flex; gap: .4rem; }
.progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.progress-track { flex: 1; height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress-fill { height: 100%; background: var(--ink); border-radius: inherit; transition: width .25s; }
.progress-text { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.checklist li { display: block; padding: 0; }
.checklist li::before { content: none; }
.checklist label { display: grid; grid-template-columns: 1.4rem 2.2rem 1fr auto; gap: .9rem; align-items: center; padding: 1rem .2rem; cursor: pointer; }
.checklist label:hover { background: #fafafb; }
.checklist input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--ink); cursor: pointer; }
.ex-num { color: var(--muted); font-size: .85rem; }
.ex-detail { color: var(--muted); font-size: .9rem; text-align: right; }
.checklist input:checked ~ strong { text-decoration: line-through; color: var(--muted); }
.complete { margin-top: 1rem; padding: 1rem 1.2rem; background: #eaf6ee; color: #1d5b31; border-radius: 10px; }
.complete[hidden] { display: none; }

/* ---------- credits ---------- */
.credits { list-style: none; padding: 0; margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.credits li { display: flex; justify-content: space-between; padding: .9rem 0; border-bottom: 1px solid var(--line); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .belt-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .header-inner { min-height: 60px; gap: .6rem; }
  .tag, .start-btn { display: none; }
  .brand { padding: 0 .85rem; }
  .nav { gap: .3rem; }
  .section { margin-top: 2.4rem; }
  .section-head h1, .section-head h2 { font-size: 1.75rem; }
  .intro h1 { font-size: 2rem; }
  .rail-arrows { display: none; }
  .belt-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist label { grid-template-columns: 1.4rem 1fr; row-gap: .2rem; }
  .ex-num { display: none; }
  .ex-detail { grid-column: 2; text-align: left; }
}

/* ---------- print: just the workout ---------- */
@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  main { padding: 0; }
  .detail { max-width: none; }
  .checklist label { padding: .55rem 0; }
  .checklist input { appearance: none; border: 1.5px solid #000; border-radius: 3px; }
  .checklist input:checked ~ strong { text-decoration: none; color: inherit; }
  a { text-decoration: none; }
}
.nav { min-width: 0; }
.brand-group { flex: none; }
@media (max-width: 640px) {
  .brand { padding: 0 .75rem; font-size: .85rem; height: 34px; }
  .nav .pill { padding: 0 .7rem; font-size: .82rem; height: 34px; }
  .header-inner { padding-inline: 1rem; }
}
