:root {
  --page-bg: #f5f6f4;
  --text: #101418;
  --muted: #2f3a45;
  --brand: #3157e8;
  --card-radius: 10px;
  --card-width: 430px;
  --card-height: 245px;
  --gap: 24px;
  --speed: 34s;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.hero {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 34px;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 560px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.explore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.explore-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.gallery {
  width: 100vw;
  padding: 22px 0 70px;
  overflow: hidden;
}

.marquee-row {
  width: 100%;
  overflow: hidden;
  margin-bottom: 28px;
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: var(--gap);
  will-change: transform;
}

.marquee-row.row-right .marquee-track {
  animation: scroll-right var(--speed) linear infinite;
}

.marquee-row.row-left .marquee-track {
  animation: scroll-left var(--speed) linear infinite;
}

.marquee-row:hover .marquee-track {
  animation-play-state: paused;
}

.theme-card {
  position: relative;
  flex: 0 0 auto;
  width: var(--card-width);
  height: var(--card-height);
  overflow: hidden;
  border-radius: var(--card-radius);
  background: #ddd;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.theme-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.theme-card:hover img {
  transform: scale(1.045);
}

.theme-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.theme-card:hover .theme-overlay,
.theme-card:focus-within .theme-overlay {
  opacity: 1;
}

.start-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 5px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.start-theme-btn:hover {
  transform: translateY(-1px);
  background: rgba(0, 0, 0, 0.98);
}

.theme-detail-link {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.theme-detail-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@keyframes scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - var(--gap) / 2));
  }
}

@keyframes scroll-right {
  from {
    transform: translateX(calc(-50% - var(--gap) / 2));
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 768px) {
  :root {
    --card-width: 320px;
    --card-height: 182px;
    --gap: 16px;
    --speed: 26s;
  }

  .hero {
    width: min(100% - 32px, 1200px);
    padding-top: 38px;
  }

  .hero p {
    font-size: 17px;
  }

  .start-theme-btn {
    min-height: 48px;
    padding: 0 22px;
    font-size: 16px;
  }

  .theme-detail-link {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-row .marquee-track {
    animation: none !important;
    transform: none !important;
  }

  .gallery {
    overflow-x: auto;
  }
}
