/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基本スタイル */
:root {
  --bg-color: #000000;
  --bg-secondary: #101010;
  --bg-footer: #0e0e0e;
  --text-color: #ffffff;
  --text-muted: #888888;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
}

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 100px;
  touch-action: manipulation;
}

/* ヘッダー */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-color);
  height: 100px;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.3s ease;
}

.header.static {
  position: static;
}

.header.scrolled {
  border-bottom-color: var(--text-color);
}

body.header-static {
  padding-top: 0;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 47px;
}

.logo-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo {
  line-height: 1;
}

.logo-svg {
  width: 140px;
  height: auto;
}

.tagline-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tagline {
  font-size: 11px;
  font-weight: 800;
}

.tagline-sub {
  font-size: 11px;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 8px 36px;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.2s;
  touch-action: manipulation;
}

.btn-outline:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

.btn-outline:hover .icon-x {
  filter: invert(1);
}

.icon-x {
  width: 18px;
  height: 18px;
  transition: filter 0.2s;
}

.header-logo {
  width: 40px;
  height: 40px;
  display: block;
}

/* ヒーローセクション */
.hero {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #000;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-video-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.hero-content {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.hero-text {
  max-width: 90%;
  height: auto;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 1));
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 36px;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  transition: all 0.2s;
  touch-action: manipulation;
}

.btn-download:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* フィルターセクション */
.filters-section {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.filter-block {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background-color: var(--bg-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  overflow: hidden;
}

.filter-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-color);
}

/* パッケージタグ */
.packages-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.package-item {
  width: 127px;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  opacity: 0.2;
  transition: opacity 0.2s;
  touch-action: manipulation;
}

.package-item:hover,
.package-item.active {
  opacity: 1;
}

.package-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.package-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  font-size: 14px;
  font-weight: 800;
}

/* クリエイタータグ */
.creators-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.creator-tag {
  background-color: var(--bg-color);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0.2;
  transition: opacity 0.2s;
  touch-action: manipulation;
}

.creator-tag:hover,
.creator-tag.active {
  opacity: 1;
}

/* メインコンテンツ */
.main {
  flex: 1;
  padding: 0 var(--spacing-md) var(--spacing-md);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* 動画グリッド */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 263px));
  gap: 15px;
  justify-content: center;
  padding: var(--spacing-md);
}

/* 動画カード */
.video-card {
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  box-shadow: 0 0 8px 0 rgba(255, 255, 255, 0.25);
  touch-action: manipulation;
}

.video-card:hover {
  transform: translateY(-2px);
}

.video-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 854 / 480;
  background-color: var(--bg-color);
  overflow: hidden;
}

.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.video-youtube {
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: calc(100% + 120px);
  border: none;
  clip-path: inset(60px 0 0 0);
  pointer-events: none;
}

.video-thumbnail[data-src] {
  opacity: 0;
}

.video-thumbnail.loaded {
  opacity: 1;
}

.video-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.video-name-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.video-name {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

/* ローディング・エラー */
.loading,
.no-results {
  text-align: center;
  padding: var(--spacing-lg);
  font-size: 14px;
  color: var(--text-muted);
}

/* モーダル */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-content {
  position: relative;
  width: 95vw;
  max-width: 1320px;
  max-height: 90vh;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--spacing-md);
  overflow: hidden;
  gap: var(--spacing-sm);
}

.modal-video-container {
  width: 100%;
  flex-shrink: 1;
  min-height: 0;
  aspect-ratio: 16 / 9;
  max-height: calc(90vh - 120px);
}

.modal-youtube {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-info {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.modal-info-left {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  gap: 2px;
}

.modal-video-name-wrap {
  display: flex;
  align-items: center;
}

.modal-video-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-color);
}

.modal-creator-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-creator-label {
  font-size: 8px;
  font-weight: 400;
  color: var(--text-muted);
}

.modal-creator-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-color);
}

.modal-creator-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-creator-x-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.modal-creator-x:hover .modal-creator-x-icon {
  opacity: 1;
}

.modal-package-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.modal-download-btn {
  padding: 8px 36px;
  border: 1px solid var(--text-color);
  border-radius: 4px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  transition: all 0.2s;
  touch-action: manipulation;
}

.modal-download-btn:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

/* フッター */
.footer {
  background-color: var(--bg-footer);
  height: 120px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.footer-note {
  font-size: 10px;
  font-weight: 300;
}

.footer-copyright {
  font-size: 11px;
  font-weight: 300;
}

/* レスポンシブ */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 var(--spacing-md);
  }

  .header-left {
    gap: 24px;
  }

  .tagline-group {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 110px;
  }

  .header {
    height: auto;
    padding: var(--spacing-md) 0;
  }

  .header-inner {
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: flex-start;
    position: relative;
  }

  .header-left {
    width: 100%;
    justify-content: flex-start;
  }

  .header-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-right a[href="https://a-zero.net"] {
    position: absolute;
    top: 0;
    right: var(--spacing-md);
  }

  .btn-outline {
    padding: 6px 16px;
    font-size: 12px;
  }

  .hero {
    height: 200px;
  }

  .hero-text {
    max-width: 95%;
  }

  .filters-section {
    padding: var(--spacing-md);
  }

  .filter-block {
    flex-direction: column;
  }

  .filter-title {
    min-width: auto;
    padding: var(--spacing-sm);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .package-item {
    width: 100px;
  }
}
