:root {
  color-scheme: light;
  --paper: #e6d5b8;
  --paper-light: #f7ead4;
  --ink: #713e27;
  --muted: #9c6845;
  --line: #d3b58e;
  --red: #c4112e;
  --red-dark: #8d1022;
  --wood: #583116;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.site-header {
  position: relative;
  min-height: 142px;
  display: flex;
  align-items: stretch;
  background:
    linear-gradient(90deg, transparent, rgb(255 246 227 / 75%) 27%, #f8ecd8 100%),
    var(--paper-light);
  box-shadow: 0 3px 8px rgb(75 44 24 / 14%);
}

.brand {
  position: absolute;
  z-index: 2;
  inset: 0 auto 13px 0;
  width: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 22px 15px 48px;
  border: 5px ridge #a78050;
  background:
    radial-gradient(ellipse at 85% 20%, rgb(230 176 91 / 35%), transparent 32%),
    repeating-linear-gradient(0deg, #6d3d1c 0 5px, #7a4922 5px 9px, #5d3418 9px 13px);
  box-shadow: 3px 4px 8px rgb(45 27 13 / 32%);
  color: #f5dfb2;
  text-align: center;
  text-decoration: none;
  text-shadow: 1px 2px 2px #321b0d;
}

.brand::before,
.brand::after {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 14px;
  border: 2px solid #c6a575;
  content: "";
}

.brand::before {
  left: 12px;
}

.brand::after {
  right: 12px;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 1.9vw, 30px);
  font-weight: 700;
  letter-spacing: 0.045em;
}

.brand-subtitle {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0.06em;
}

.header-content {
  width: min(100% - 330px, 1220px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 auto 0 max(330px, calc((100% - 1220px) / 2 + 330px));
  padding: 8px 22px 26px 0;
}

.search-box {
  width: min(270px, 100%);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: flex-end;
  padding: 0 10px;
  border: 1px solid #d59a70;
  border-radius: 0 0 5px 5px;
  background: #fffdf9;
  box-shadow: 0 1px 3px rgb(80 48 27 / 10%);
}

.search-box:focus-within {
  border-color: var(--red);
  outline: 2px solid rgb(196 17 46 / 18%);
}

.search-box svg {
  width: 17px;
  flex: 0 0 17px;
  stroke: #b75a32;
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #9b806b;
}

.search-box kbd {
  padding: 2px 5px;
  border: 1px solid #e6d5c3;
  border-radius: 3px;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: clamp(12px, 2vw, 34px);
}

.nav-link {
  padding: 8px 0;
  color: #54301f;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--red);
}

.header-pattern {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 15px;
  border-top: 2px solid #fff4e2;
  background-color: #fff6e8;
  background-image:
    repeating-conic-gradient(from 45deg, var(--red) 0% 25%, transparent 0% 50%),
    repeating-linear-gradient(45deg, transparent 0 7px, var(--red-dark) 7px 9px, transparent 9px 14px);
  background-position: 0 0, 0 0;
  background-size: 22px 22px, 22px 22px;
  background-repeat: repeat-x;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 97% 70%, 95% 100%, 93% 70%, 90% 70%, 88% 100%, 86% 70%, 83% 70%, 81% 100%, 79% 70%, 76% 70%, 74% 100%, 72% 70%, 69% 70%, 67% 100%, 65% 70%, 62% 70%, 60% 100%, 58% 70%, 55% 70%, 53% 100%, 51% 70%, 48% 70%, 46% 100%, 44% 70%, 41% 70%, 39% 100%, 37% 70%, 34% 70%, 32% 100%, 30% 70%, 27% 70%, 25% 100%, 23% 70%, 20% 70%, 18% 100%, 16% 70%, 13% 70%, 11% 100%, 9% 70%, 6% 70%, 4% 100%, 2% 70%, 0 70%);
}

main,
footer {
  width: min(100% - 48px, 1060px);
  margin-inline: auto;
}

.breadcrumb {
  margin: 40px 0 30px;
  color: var(--ink);
  font-size: 12px;
}

.breadcrumb a {
  color: #c76b3d;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.library {
  padding: 0 0 76px;
}

.library-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
}

.category-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -24px 0 32px;
}

.category-button {
  min-width: 92px;
  padding: 8px 14px;
  border: 1px solid rgb(142 98 62 / 35%);
  border-radius: 999px;
  background: rgb(255 247 232 / 55%);
  color: #69402b;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.category-button:hover,
.category-button:focus-visible {
  border-color: var(--red);
  color: var(--red-dark);
}

.category-button.active {
  border-color: var(--red-dark);
  background: var(--red-dark);
  color: #fff8e8;
}

.library-heading h1,
.library-heading h2 {
  margin: 0;
  color: #713d27;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 500;
  letter-spacing: 0.025em;
  text-align: center;
}

.song-count {
  position: absolute;
  right: 0;
  bottom: 2px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.song-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  row-gap: 54px;
}

.song-card {
  min-width: 0;
}

.video-thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at center, rgb(187 104 54 / 60%), transparent 55%),
    linear-gradient(135deg, #60442f, #a77748 48%, #35291f);
  color: white;
  text-decoration: none;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 200ms ease, filter 200ms ease;
}

.video-thumbnail:hover img {
  transform: scale(1.025);
  filter: brightness(0.82);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58px;
  height: 40px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 11px;
  background: #f00;
  color: white;
  font-size: 20px;
  padding-left: 3px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
  transition: background 150ms ease, transform 150ms ease;
}

.video-thumbnail:hover .play-button {
  transform: translate(-50%, -50%) scale(1.08);
  background: #d90000;
}

.song-title {
  display: inline-block;
  margin-top: 12px;
  color: #77442d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.song-title:hover {
  color: var(--red-dark);
  text-decoration: underline;
}

.dance-library {
  border-top: 1px solid rgb(123 79 48 / 25%);
  padding-top: 34px;
}

.dance-library .library-heading {
  margin-bottom: 27px;
}

.dance-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dance-item {
  min-width: 0;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid rgb(142 98 62 / 20%);
  background: rgb(255 247 232 / 38%);
  color: #69402b;
  font-size: 12px;
  line-height: 1.4;
}

.about-library {
  min-height: 430px;
}

.about-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 42px;
  border: 1px solid rgb(142 98 62 / 20%);
  background: rgb(255 247 232 / 38%);
  box-shadow: 0 4px 12px rgb(75 44 24 / 8%);
  color: #69402b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
}

.about-card p {
  margin: 0 0 18px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.alphabet-grid,
.region-grid {
  display: grid;
  gap: 18px;
}

.alphabet-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alphabet-grid section,
.region-card {
  padding: 18px;
  border: 1px solid rgb(142 98 62 / 20%);
  background: rgb(255 247 232 / 38%);
}

.alphabet-grid h2,
.region-card h2 {
  margin: 0 0 12px;
  color: var(--red-dark);
  font-family: Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.04em;
}

.alphabet-grid ul {
  margin: 0;
  padding-left: 18px;
  color: #69402b;
  font-size: 13px;
  line-height: 1.7;
}

.region-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.region-card table {
  width: 100%;
  border-collapse: collapse;
  color: #69402b;
  font-size: 13px;
}

.region-card th,
.region-card td {
  padding: 7px 8px;
  border-bottom: 1px solid rgb(142 98 62 / 16%);
  text-align: left;
}

.region-card th {
  color: var(--red-dark);
}

.dance-number {
  flex: 0 0 23px;
  color: #a56d46;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 30px 20px;
  border: 1px dashed #bb9973;
  color: #80543b;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgb(123 79 48 / 25%);
  color: #875b3d;
  font-size: 11px;
}

.footer-note span {
  padding-left: 4px;
  color: var(--red);
}

.brand:focus-visible,
.nav-link:focus-visible,
.breadcrumb a:focus-visible,
.video-thumbnail:focus-visible,
.song-title:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .brand {
    width: 240px;
  }

  .header-content {
    width: calc(100% - 255px);
    margin-left: 255px;
    padding-right: 16px;
  }

  .main-nav {
    justify-content: flex-start;
    gap: clamp(10px, 2vw, 20px);
  }

  .nav-link {
    font-size: 13px;
  }

  .song-list {
    column-gap: 28px;
  }
}

@media (max-width: 820px) {
  .alphabet-grid,
  .region-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .alphabet-grid,
  .region-grid {
    grid-template-columns: 1fr;
  }

  .about-card {
    padding: 24px 20px;
  }
  .site-header {
    min-height: 153px;
    display: block;
    padding-top: 92px;
  }

  .brand {
    right: auto;
    bottom: auto;
    width: min(100%, 260px);
    height: 82px;
    padding: 8px 18px;
  }

  .brand-title {
    font-size: 25px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .header-content {
    width: 100%;
    height: 61px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0 14px 13px;
  }

  .search-box {
    position: absolute;
    top: 10px;
    right: 12px;
    width: min(180px, calc(100% - 278px));
  }

  .search-box kbd {
    display: none;
  }

  .main-nav {
    justify-content: space-between;
    gap: 8px;
  }

  .nav-link {
    font-size: 12px;
  }

  main,
  footer {
    width: min(100% - 32px, 1060px);
  }

  .breadcrumb {
    margin: 25px 0 24px;
  }

  .library {
    padding-bottom: 52px;
  }

  .library-heading {
    margin-bottom: 29px;
  }

  .library-heading h1,
  .library-heading h2 {
    font-size: 32px;
  }

  .song-count {
    right: 0;
    bottom: -19px;
  }

  .song-list {
    grid-template-columns: 1fr;
    row-gap: 30px;
  }

  .song-title {
    margin-top: 9px;
    font-size: 15px;
  }

  .dance-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .search-box {
    width: 42%;
  }

  .nav-link {
    font-size: 10px;
  }

  .dance-list {
    grid-template-columns: 1fr;
  }
}

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