:root {
  color-scheme: light;
  --ink: #11110f;
  --muted: #6f706a;
  --line: #dedfd8;
  --paper: #f4f4ef;
  --white: #ffffff;
  --acid: #dff4f8;
  --acid-strong: #42b9d0;
  --radius: 20px;
  --shadow: 0 18px 45px rgba(17, 17, 15, 0.13);
  font-family: "Helvetica Neue", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); }
body.player-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  padding: env(safe-area-inset-top) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-bottom: 1px solid rgba(17, 17, 15, 0.1);
}

.brand { display: inline-flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { width: 37px; height: 37px; display: block; object-fit: contain; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--ink); color: var(--acid); font-weight: 900; font-size: 1.05rem; letter-spacing: -0.08em; }
.brand-name { font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .27em; white-space: nowrap; }
.header-search { height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: .75rem; font-weight: 700; cursor: pointer; }
.header-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.header-search:focus-visible { outline: 3px solid rgba(66, 185, 208, .35); outline-offset: 2px; }
.search-wrap svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.intro { height: 570px; overflow: hidden; position: relative; color: var(--ink); background: var(--white); }
.hero-media { position: absolute; inset: 0; margin: 0; overflow: hidden; background: var(--white); }
.hero-media img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 52% center; }
.hero-copy { position: absolute; z-index: 2; left: 0; bottom: 0; width: min(82%, 330px); padding: 24px 20px 26px; background: var(--white); border-radius: 0 28px 0 0; }
.eyebrow, .section-label { margin: 0 0 11px; font-size: .7rem; font-weight: 800; letter-spacing: .19em; }
.eyebrow::before, .section-label::before { content: ""; display: inline-block; width: 24px; height: 2px; margin-right: 9px; vertical-align: middle; background: var(--ink); }
.intro .eyebrow { margin-bottom: 14px; color: var(--muted); }
.intro .eyebrow::before { content: none; }
.intro h1 { margin: 0; font-size: clamp(1.75rem, 8vw, 2rem); line-height: 1.24; letter-spacing: -.055em; font-weight: 900; }
.intro h1 span { display: block; white-space: nowrap; }

.library { padding: 32px 16px 72px; background: var(--white); }
.library-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; scroll-margin-top: 70px; }
.library-head h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.library-head .section-label { margin-bottom: 7px; color: var(--muted); }
.library-head .section-label::before { background: var(--acid-strong); }
.result-count { margin: 0 2px 3px 0; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.result-count strong { color: var(--ink); font-size: 1.35rem; }

.search-wrap { position: relative; margin-top: 22px; }
.search-wrap svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #64655f; pointer-events: none; }
.search-wrap input { width: 100%; height: 54px; padding: 0 48px 0 49px; border: 1px solid #d6d7d0; border-radius: 15px; outline: none; background: #fafaf7; font-size: 1rem; }
.search-wrap input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(230, 255, 87, .55); }
#clear-search { position: absolute; right: 9px; top: 9px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e7e7e1; font-size: 1.35rem; cursor: pointer; }

.category-strip { display: flex; gap: 8px; margin: 16px -16px 24px 0; padding: 0 16px 4px 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.category-strip::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: .86rem; font-weight: 700; white-space: nowrap; cursor: pointer; scroll-snap-align: start; }
.category-chip[aria-pressed="true"] { border-color: #237f98; background: #237f98; color: var(--white); }
.category-chip[aria-pressed="true"] .chip-count { background: var(--acid); color: #176b80; }
.chip-count { display: inline-grid; min-width: 21px; height: 21px; margin-left: 6px; padding: 0 5px; place-items: center; border-radius: 999px; background: #efefe9; font-size: .7rem; }

.category-panel { display: none; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 11px; }
.video-card { min-width: 0; }
.video-open { display: block; width: 100%; padding: 0; border: 0; text-align: left; background: transparent; cursor: pointer; }
.thumbnail-wrap { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 14px; background: #deded8; }
.video-thumbnail { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s ease; }
.video-open:active .video-thumbnail { transform: scale(.98); }
.play-icon { position: absolute; left: 10px; bottom: 9px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(35, 127, 152, .22); border-radius: 50%; color: #176b80; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 16px rgba(0, 0, 0, .16); }
.play-icon svg { width: 19px; fill: currentColor; }
.duration { position: absolute; right: 8px; bottom: 8px; padding: 4px 7px; border-radius: 6px; color: white; background: rgba(0, 0, 0, .72); font-size: .67rem; font-weight: 700; }
.card-copy { display: block; padding: 10px 2px 0; }
.card-category { display: block; margin-bottom: 4px; color: #696a64; font-size: .67rem; font-weight: 700; }
.card-title { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: .9rem; line-height: 1.5; letter-spacing: -.015em; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-tags { display: block; min-height: 18px; margin-top: 6px; overflow: hidden; color: #81827c; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }

.load-more { width: 100%; height: 52px; margin-top: 30px; border: 1px solid var(--ink); border-radius: 13px; background: var(--white); font-weight: 800; cursor: pointer; }
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state > span { font-size: 3rem; color: #a3a49d; }
.empty-state h3 { margin: 13px 0 7px; font-size: 1.1rem; }
.empty-state p { margin: 0; color: var(--muted); font-size: .88rem; }
.empty-state button, .active-filter button { margin-top: 17px; padding: 10px 15px; border: 0; border-radius: 999px; background: var(--ink); color: var(--white); font-size: .8rem; font-weight: 700; cursor: pointer; }
.active-filter { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding: 12px 15px; border-radius: 12px; background: #f2f3e9; font-size: .83rem; }
.active-filter button { margin: 0; padding: 7px 10px; background: transparent; color: var(--ink); text-decoration: underline; }

footer { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); color: white; background: var(--ink); text-align: center; }
footer > small { color: #8f908a; font-size: .72rem; }

.player-dialog { width: 100%; max-width: none; margin: auto 0 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.player-dialog::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(3px); }
.player-sheet { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.player-bar { position: relative; height: 45px; }
.player-grip { position: absolute; left: 50%; top: 11px; width: 42px; height: 5px; border-radius: 99px; background: #d4d4ce; transform: translateX(-50%); }
.player-close { position: absolute; right: 9px; top: 5px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eeeeea; font-size: 1.4rem; cursor: pointer; }
.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame iframe { width: 100%; height: 100%; border: 0; }
.player-dialog.is-fullscreen-player,
.player-dialog:fullscreen,
.player-dialog:-webkit-full-screen { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; overflow: hidden; overscroll-behavior: none; border-radius: 0; background: #000; }
.player-dialog.is-fullscreen-player .player-sheet,
.player-dialog:fullscreen .player-sheet,
.player-dialog:-webkit-full-screen .player-sheet { height: 100%; padding: 0; }
.player-dialog.is-fullscreen-player .player-bar,
.player-dialog:fullscreen .player-bar,
.player-dialog:-webkit-full-screen .player-bar { position: absolute; z-index: 2; top: env(safe-area-inset-top); right: 0; width: 58px; height: 58px; }
.player-dialog.is-fullscreen-player .player-grip,
.player-dialog:fullscreen .player-grip,
.player-dialog:-webkit-full-screen .player-grip { display: none; }
.player-dialog.is-fullscreen-player .player-close,
.player-dialog:fullscreen .player-close,
.player-dialog:-webkit-full-screen .player-close { top: 10px; right: 10px; background: rgba(255, 255, 255, .9); }
.player-dialog.is-fullscreen-player .player-frame,
.player-dialog:fullscreen .player-frame,
.player-dialog:-webkit-full-screen .player-frame { width: 100%; height: 100%; aspect-ratio: auto; }
.player-dialog.is-fullscreen-player .player-copy,
.player-dialog:fullscreen .player-copy,
.player-dialog:-webkit-full-screen .player-copy { display: none; }
.player-copy { padding: 20px 20px 0; }
.player-copy > p { margin: 0 0 7px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.player-copy h2 { margin: 0; font-size: 1.25rem; line-height: 1.45; letter-spacing: -.02em; }
.player-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.player-tags span { padding: 6px 10px; border-radius: 999px; background: #f0f0ea; font-size: .72rem; }
#youtube-link { margin-top: 20px; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; color: var(--ink); background: var(--acid); font-size: .88rem; font-weight: 800; text-decoration: none; }
#youtube-link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

@media (min-width: 720px) {
  .site-header { height: 64px; padding-left: 34px; padding-right: 34px; }
  .brand-logo { width: 39px; height: 39px; }
  .intro { height: min(650px, calc(100vh - 64px)); min-height: 530px; }
  .hero-media { inset: 0; }
  .hero-media img { object-position: center 46%; }
  .hero-copy { width: min(50%, 544px); min-height: 0; padding: 24px max(3.5vw, 32px) 27px; border-radius: 0 38px 0 0; box-shadow: 18px -18px 45px rgba(17, 17, 15, .08); }
  .intro h1 { font-size: clamp(2.05rem, 4.7vw, 3.5rem); line-height: 1.28; }
  .library-head h2 { font-size: 1.75rem; }
  .library { padding: 48px max(5vw, 36px) 100px; }
  .library-head { scroll-margin-top: 76px; }
  .library-head, .search-wrap, .category-strip, .library-layout { max-width: 1240px; margin-left: auto; margin-right: auto; }
  .category-strip { margin-top: 18px; margin-bottom: 32px; padding-left: 0; padding-right: 0; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 20px; }
  .thumbnail-wrap { border-radius: 17px; }
  .card-title { font-size: 1rem; }
  .player-dialog { width: min(900px, calc(100% - 48px)); margin: auto; border-radius: 24px; }
  .player-sheet { padding-bottom: 24px; }
}

@media (min-width: 1024px) {
  .category-strip { display: none; }
  .library-layout { display: grid; grid-template-columns: 220px 1fr; gap: 42px; margin-top: 38px; }
  .category-panel { display: block; align-self: start; position: sticky; top: 110px; }
  .category-panel > p { margin: 0 0 13px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
  .category-panel nav { display: grid; gap: 4px; }
  .category-link { min-height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 10px; background: transparent; font-size: .86rem; text-align: left; cursor: pointer; }
  .category-link span { color: #8c8d87; font-size: .72rem; }
  .category-link[aria-pressed="true"] { background: #237f98; color: white; font-weight: 700; }
  .category-link[aria-pressed="true"] span { color: #dff4f8; }
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .video-open:hover .video-thumbnail { transform: scale(1.035); }
}

@media (min-width: 1320px) {
  .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
