:root {
  --ink: #f7f7fb;
  --muted: #a8a8b5;
  --paper: #0b0b12;
  --card: #171720;
  --accent: #ff476f;
  --accent-dark: #ff7896;
  --line: #30303c;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 11, 18, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  color: white;
  background: linear-gradient(135deg, #ff3868, #ff7849);
  border-radius: 50%;
  place-items: center;
  font-size: 11px;
  padding-left: 2px;
}

.hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  padding: 95px max(24px, calc((100vw - 1120px) / 2));
  color: white;
  cursor: pointer;
  background: #17121f;
}

.hero.slide-1 {
  --slide-accent: #1ac6c2;
}

.hero.slide-2 {
  --slide-accent: #e84d8d;
}

.hero-thumbnail {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(11,11,18,.98) 0%, rgba(11,11,18,.88) 42%, rgba(11,11,18,.3) 78%, rgba(11,11,18,.2) 100%),
    linear-gradient(0deg, rgba(11,11,18,.35), transparent 50%);
}

.hero::after {
  position: absolute;
  z-index: 1;
  right: -8%;
  bottom: -55%;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.025);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 650px;
  height: 2.4em;
  overflow: hidden;
  margin: 10px 0 18px;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.hero-content > p:not(.eyebrow) {
  max-width: 520px;
  min-height: 3.4em;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.75);
}

.carousel-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  color: white;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  cursor: pointer;
  background: rgba(0,0,0,.28);
  place-items: center;
  transform: translateY(-50%);
  transition: background 150ms ease, transform 150ms ease;
}

.carousel-arrow:hover {
  background: rgba(255,255,255,.2);
  transform: translateY(-50%) scale(1.06);
}

.carousel-prev {
  left: 16px;
}

.carousel-next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  z-index: 5;
  right: max(24px, calc((100vw - 1120px) / 2));
  bottom: 28px;
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 24px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  background: rgba(255,255,255,.35);
  transition: width 160ms ease, background 160ms ease;
}

.carousel-dot.active {
  width: 46px;
  background: white;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.watch-button,
.sub-button {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 750;
}

.watch-button {
  color: #121218;
  background: white;
}

.sub-button {
  color: white;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
}

.hero-number {
  position: absolute;
  z-index: 1;
  right: max(24px, calc((100vw - 1120px) / 2));
  bottom: -30px;
  margin: 0;
  color: rgba(255,255,255,.13) !important;
  font-size: clamp(160px, 24vw, 310px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.1em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.library,
.top-sections,
.detail-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 100px;
}

.top-sections {
  display: grid;
  gap: 76px;
  padding-bottom: 0;
}

.shelf {
  min-width: 0;
}

.shelf .section-heading {
  margin-bottom: 24px;
}

.section-link {
  color: var(--muted);
  font-size: 13px;
  transition: color 150ms ease;
}

.section-link:hover {
  color: var(--ink);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 36px;
  font-weight: 500;
}

.sort-control {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

.sort-control select {
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--card);
}

.filter-row,
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-row {
  margin: 30px 0 12px;
}

.filter-label {
  margin-right: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tag-button {
  padding: 7px 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
}

.tag-button.active {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.result-count {
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.video-card {
  overflow: hidden;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.05);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.card-visual {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #ff3f72, #ff9f43);
  place-items: center;
}

.video-card:nth-child(2) .card-visual {
  background: linear-gradient(145deg, #13b7c8, #a2ea80);
}

.video-card:nth-child(3) .card-visual {
  background: linear-gradient(145deg, #7857f5, #ef59b3);
}

.card-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(125deg, transparent 0 36px, rgba(255,255,255,.16) 37px 38px);
}

.card-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.video-card:hover .card-thumbnail {
  transform: scale(1.04);
}

.card-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.32));
}

.play-mark {
  z-index: 2;
  display: grid;
  width: 54px;
  height: 54px;
  padding-left: 4px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  place-items: center;
}

.card-body {
  padding: 20px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.card-title {
  margin: 8px 0 4px;
  font-family: inherit;
  font-weight: 750;
  font-size: 21px;
  line-height: 1.5;
}

.card-date,
.detail-date {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 60px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.back-link {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--muted);
}

.player {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #050507;
  box-shadow: var(--shadow);
}

.player video,
.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  padding-top: 42px;
}

.detail-layout h1 {
  margin: 8px 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 500;
  line-height: 1.35;
}

.detail-description {
  max-width: 700px;
  color: var(--muted);
}

footer {
  padding: 28px 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
}

@media (max-width: 780px) {
  .hero {
    height: 500px;
    padding: 72px 54px;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 50px);
  }

  .carousel-arrow {
    width: 36px;
    height: 36px;
  }

  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .top-sections {
    width: 100%;
    padding-left: 24px;
  }

  .shelf {
    overflow: hidden;
  }

  .shelf .section-heading {
    padding-right: 24px;
  }

  .shelf-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 24px 24px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .shelf-grid::-webkit-scrollbar {
    display: none;
  }

  .shelf-grid .video-card {
    flex: 0 0 min(82vw, 330px);
    scroll-snap-align: start;
  }

  .section-heading,
  .detail-layout {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .detail-layout {
    gap: 28px;
  }
}
