:root {
  color-scheme: light;
  --main: rgb(83, 181, 245);
  --accent: rgb(255, 128, 184);
  --violet: rgb(181, 138, 228);
  --ink: #293c50;
  --muted: #526779;
  --blue: #176c9e;
  --line: #d4e1e8;
  --paper: #fffefa;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #eff8ff;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  line-height: 1.6;
}
.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

.hero, .about-header {
  position: relative;
  overflow: hidden;
  background: #c9ebff;
  border-bottom: 4px solid #53b5f5;
}
.hero { padding: 90px 0 48px; }
.hero > .shell, .about-header > .shell { position: relative; z-index: 1; }
.header-nav { position: absolute; top: -65px; right: 0; font-size: .84rem; }
.header-nav a, .back-link, .site-footer a { color: #153f6a; font-weight: 700; text-underline-offset: 4px; }
.header-nav a:hover, .back-link:hover, .site-footer a:hover { color: #994d82; }

h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); }
.brand-title {
  display: flex;
  align-items: flex-start;
  color: #194b83;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic UI", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1;
}
.brand-title.small { font-size: clamp(1.8rem, 4vw, 3rem); }
.brand-phrase { display: inline-block; white-space: nowrap; }
.brand-anone { position: relative; z-index: 1; }
.brand-mokkai { margin-left: .16em; transform: translateY(.24em); }
.brand-nemo-letter { color: #073c83; font-weight: 900; text-shadow: 0 2px 0 #fff; }
.lead { margin: 24px 0 28px; color: #163d68; font-size: .95rem; font-weight: 700; }
.last-update { margin: -17px 0 18px; color: #315b77; font-size: .75rem; }
.last-update a { color: #155b9b; text-underline-offset: 3px; overflow-wrap: anywhere; }

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(140px, .8fr) auto;
  gap: 14px;
  align-items: end;
  padding: 20px;
  border: 2px solid #256ab6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 6px 6px 0 rgba(38, 91, 158, .28);
}
label { display: grid; min-width: 0; gap: 6px; color: #526779; font-size: .78rem; font-weight: 700; }
input, select, button {
  min-width: 0;
  min-height: 46px;
  border: 1px solid #b8cdd9;
  border-radius: 8px;
  padding: 0 13px;
  font: inherit;
}
input, select { width: 100%; color: var(--ink); background: white; }
button { padding: 0 28px; border: 0; color: white; background: #d93686; font-weight: 800; cursor: pointer; }
button:hover { background: #ad2469; }
:focus-visible { outline: 3px solid #6d4ca4; outline-offset: 3px; }

.settings-panel { grid-column: 1 / -1; border-top: 1px solid #e0e9ed; }
.settings-panel > summary { padding: 13px 0 3px; color: var(--blue); cursor: pointer; font-size: .82rem; font-weight: 700; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 14px; padding: 12px 0 0; }

.results { min-height: 120px; padding: 30px 0 72px; }
.summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); font-size: .9rem; }
.summary strong { color: var(--blue); font-size: 1.3rem; }
.card-grid { display: grid; gap: 24px; }
.video-card {
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  border: 2px solid #72b9e8;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 5px 5px 0 #c3e6fa;
}
.thumbnail-frame {
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 9px 20px;
  border: 2px solid #d7e9f4;
  background: white;
  box-shadow: 0 4px 12px rgba(50, 74, 89, .09);
}
.thumbnail { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #f5f8fa; }
.card-body { min-width: 0; }
.metadata { margin: 0 0 7px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.5rem); line-height: 1.5; overflow-wrap: anywhere; }
.groups { display: grid; gap: 10px; margin-top: 18px; }
.topic-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 5px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid #b5d7ec;
  border-left: 5px solid #ed62a6;
  border-radius: 4px 10px 10px 4px;
  color: inherit;
  background: #f0f8ff;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color .15s, border-color .15s;
}
.topic-group:hover { border-color: #dc438d; background: #e5f2ff; }
.group-stats { grid-column: 1; color: #155b9b; font-size: .78rem; font-weight: 800; }
.representative { grid-column: 1; line-height: 1.65; }
.play-icon { grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; padding-left: 2px; border-radius: 50%; color: white; background: #c52f7c; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.compact { margin-top: 8px; }
summary { cursor: pointer; color: var(--blue); font-weight: 700; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.pagination a, .current-page { min-width: 42px; padding: 9px 13px; border: 1px solid #cbdde7; border-radius: 8px; text-align: center; text-decoration: none; }
.pagination a { color: #174f83; background: white; border-color: #6ab3e1; }
.pagination a:hover { background: #e7f5fc; }
.page-numbers { display: flex; gap: 6px; }
.current-page { border-color: #c52f7c; color: white; background: #c52f7c; font-weight: 800; }
.empty { padding: 38px 20px; border: 1px dashed #c5d8e1; border-radius: 12px; text-align: center; color: var(--muted); background: rgba(255, 254, 250, .75); }

.about-header { padding: 32px 0 42px; }
.back-link { display: inline-block; margin-bottom: 25px; }
.about-content { max-width: 760px; margin-top: 36px; margin-bottom: 50px; padding: 36px; border: 1px solid #e4e9e9; border-radius: 12px; background: var(--paper); box-shadow: 0 10px 28px rgba(56, 78, 91, .07); line-height: 1.9; }
.about-content h2 { font-size: 1.7rem; }
.about-content section { margin-top: 34px; }
.about-content h3 { color: #6f518c; }
.about-content a { color: #155b9b; text-underline-offset: 3px; }
.site-footer { padding: 0 0 30px; font-size: .85rem; text-align: right; }

@media (max-width: 820px) {
  .video-card { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .thumbnail-frame { width: min(100%, 500px); }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 32px); }
  .hero { padding: 76px 0 32px; }
  .header-nav { top: -51px; }
  .search-form { grid-template-columns: 1fr; padding: 16px; }
  .settings-fields { grid-template-columns: 1fr; }
  .video-card { padding: 16px; }
  .brand-mokkai { margin-left: .08em; transform: translateY(.16em); }
  .about-content { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { .topic-group { transition: none; } }
