@font-face {
  font-family: "Shippori Mincho";
  src: url("./fonts/ShipporiMincho-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "ZCOOL XiaoWei";
  src: url("./fonts/ZCOOLXiaoWei-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page-background: #0b0e11;
  --text-primary: rgba(255, 255, 255, 0.96);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --cyan: #0ff2dc;
  --gold: #d4be91;
  --purple: #b282ff;
  --pink: #f282b4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-background);
}

body {
  min-width: 320px;
  overflow: hidden;
  color: var(--text-primary);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
a {
  font: inherit;
}

.musegate-page {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: var(--page-background);
}

.wave-background,
.wave-background canvas,
.wave-vignette {
  position: absolute;
  inset: 0;
}

.wave-background {
  z-index: -1;
  overflow: hidden;
  background: var(--page-background);
}

.wave-background canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.95;
}

.wave-vignette {
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 25%, rgba(11, 14, 17, 0.14) 68%, rgba(11, 14, 17, 0.72) 100%),
    linear-gradient(180deg, rgba(11, 14, 17, 0.1), transparent 35%, rgba(11, 14, 17, 0.22));
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(72px, 12.2vh, 110px) 24px 72px;
  text-align: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: clamp(48px, 7.1vw, 64px);
  object-fit: contain;
  user-select: none;
}

.hero-content h1 {
  position: relative;
  z-index: 2;
  margin: 24px 0 0;
  color: #fff;
  font-family: "Shippori Mincho", "Noto Serif SC", serif;
  font-size: clamp(30px, 3.35vw, 48px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  width: min(85vw, 1240px);
  margin-top: clamp(40px, 15.5vh, 140px);
  gap: clamp(24px, 2.8vw, 44px);
  transition: grid-template-columns 580ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.product-card {
  --accent: #fff;
  --accent-soft: rgba(255, 255, 255, 0.18);
  --accent-border: rgba(255, 255, 255, 0.36);
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  aspect-ratio: 210 / 290;
  transform: rotate(var(--rest-rotation));
  animation: card-float var(--float-duration) ease-in-out var(--float-delay) infinite;
  transition:
    aspect-ratio 580ms cubic-bezier(0.22, 0.8, 0.24, 1),
    transform 580ms cubic-bezier(0.22, 0.8, 0.24, 1),
    filter 300ms ease;
}

.product-card--cyan {
  --accent: var(--cyan);
  --accent-soft: rgba(15, 242, 220, 0.18);
  --accent-border: rgba(15, 242, 220, 0.42);
  --rest-rotation: -4deg;
  --float-delay: 0s;
  --float-duration: 6.5s;
}

.product-card--gold {
  --accent: var(--gold);
  --accent-soft: rgba(212, 190, 145, 0.18);
  --accent-border: rgba(212, 190, 145, 0.44);
  --rest-rotation: 3deg;
  --float-delay: 1.2s;
  --float-duration: 7.2s;
}

.product-card--purple {
  --accent: var(--purple);
  --accent-soft: rgba(178, 130, 255, 0.2);
  --accent-border: rgba(178, 130, 255, 0.46);
  --rest-rotation: -2deg;
  --float-delay: 0.6s;
  --float-duration: 6s;
}

.product-card--pink {
  --accent: var(--pink);
  --accent-soft: rgba(242, 130, 180, 0.18);
  --accent-border: rgba(242, 130, 180, 0.44);
  --rest-rotation: 5deg;
  --float-delay: 1.8s;
  --float-duration: 7.8s;
}

.card-frame,
.card-surface,
.expanded-panel {
  position: absolute;
  inset: 0;
  border-radius: 20px;
}

.card-frame {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 22, 30, 0.64);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 20px var(--accent-soft);
  transition:
    border-radius 580ms cubic-bezier(0.22, 0.8, 0.24, 1),
    box-shadow 300ms ease;
}

.card-surface,
.expanded-panel {
  overflow: hidden;
  background: rgba(14, 16, 22, 0.5);
  transition: opacity 320ms ease;
}

.card-image,
.expanded-panel > img,
.expanded-panel > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: center;
  user-select: none;
}

.card-shade,
.expanded-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.56) 0%,
    rgba(0, 0, 0, 0.12) 24%,
    rgba(0, 0, 0, 0) 46%,
    rgba(0, 0, 0, 0.16) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

.expanded-shade {
  background: linear-gradient(
    to top,
    rgba(8, 10, 14, 0.9) 0%,
    rgba(8, 10, 14, 0.7) 22%,
    rgba(8, 10, 14, 0.18) 55%,
    rgba(8, 10, 14, 0) 100%
  );
}

.card-caption {
  position: absolute;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  white-space: nowrap;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.36));
  transition: transform 320ms ease, opacity 320ms ease;
}

.card-caption--top {
  top: 12px;
}

.card-caption--bottom {
  bottom: 12px;
}

.caption-pill {
  display: inline-flex;
  align-items: center;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  overflow: hidden;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.97);
  background: rgba(0, 0, 0, 0.66);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.5),
    0 0 10px var(--accent-soft),
    inset 0 0 8px rgba(255, 255, 255, 0.035);
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: clamp(14px, 1.55vw, 24px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
}

.caption-pill--subtitle {
  padding: 7px 13px;
  color: rgba(255, 255, 255, 0.86);
  font-family: "Inter", "PingFang SC", sans-serif;
  font-size: clamp(10px, 0.95vw, 14px);
  letter-spacing: 0.04em;
}

.card-hover-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(200px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), var(--accent-soft), transparent 62%);
  transition: opacity 300ms ease;
}

.expanded-panel {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.expanded-copy {
  position: absolute;
  right: 24px;
  bottom: 20px;
  left: 24px;
  z-index: 2;
  text-align: left;
  transform: translateZ(20px);
}

.expanded-copy h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expanded-copy p {
  margin: 7px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) and (min-width: 768px) {
  .product-grid:has(.product-card:nth-child(1):hover) {
    grid-template-columns: 2.5fr 0.9fr 0.9fr 0.9fr;
  }

  .product-grid:has(.product-card:nth-child(2):hover) {
    grid-template-columns: 0.9fr 2.5fr 0.9fr 0.9fr;
  }

  .product-grid:has(.product-card:nth-child(3):hover) {
    grid-template-columns: 0.9fr 0.9fr 2.5fr 0.9fr;
  }

  .product-grid:has(.product-card:nth-child(4):hover) {
    grid-template-columns: 0.9fr 0.9fr 0.9fr 2.5fr;
  }

  .product-card:hover {
    z-index: 4;
    aspect-ratio: 5 / 3;
    transform: none;
    animation: none;
    filter: drop-shadow(0 0 25px var(--accent-soft));
  }

  .product-card:hover .card-frame {
    border-radius: 28px;
    border-color: var(--accent-border);
    box-shadow:
      0 12px 42px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 34px var(--accent-soft);
  }

  .product-card:hover .card-surface {
    opacity: 0;
  }

  .product-card:hover .expanded-panel {
    opacity: 1;
  }

  .product-card:hover .card-hover-glow {
    opacity: 1;
  }

  .product-card:hover .card-caption {
    opacity: 0;
  }
}

.product-card.is-expanded {
  z-index: 4;
  aspect-ratio: 5 / 3;
  transform: none;
  animation: none;
}

.product-card.is-expanded .card-frame {
  border-radius: 28px;
  border-color: var(--accent-border);
}

.product-card.is-expanded .card-surface {
  opacity: 0;
}

.product-card.is-expanded .expanded-panel {
  opacity: 1;
}

.product-card.is-expanded .card-caption {
  opacity: 0;
}

.compliance {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px 16px;
  background: linear-gradient(180deg, rgba(11, 14, 17, 0), rgba(11, 14, 17, 0.58));
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  letter-spacing: 0.035em;
  line-height: 1.5;
  pointer-events: none;
}

.compliance a {
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  pointer-events: auto;
  transition: color 180ms ease;
}

.compliance a:hover,
.compliance a:focus-visible {
  color: rgba(255, 255, 255, 0.72);
}

.compliance a:focus-visible {
  outline: 1px solid rgba(15, 242, 220, 0.48);
  outline-offset: 4px;
  border-radius: 2px;
}

.compliance span {
  width: 28px;
  height: 1px;
  margin: 0 14px;
  background: linear-gradient(90deg, rgba(15, 242, 220, 0.3), rgba(212, 190, 145, 0.3));
}

@keyframes card-float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rest-rotation));
  }

  25% {
    transform: translateY(-8px) rotate(calc(var(--rest-rotation) + 1.2deg));
  }

  50% {
    transform: translateY(0) rotate(var(--rest-rotation));
  }

  75% {
    transform: translateY(5px) rotate(calc(var(--rest-rotation) - 1deg));
  }
}

@media (max-width: 767px) {
  body {
    overflow: hidden;
  }

  .musegate-page {
    min-height: 560px;
  }

  .hero-content {
    padding: clamp(56px, 10vh, 78px) 24px 58px;
  }

  .brand-logo {
    height: clamp(42px, 14vw, 56px);
  }

  .hero-content h1 {
    margin-top: 14px;
    font-size: clamp(28px, 7.5vw, 36px);
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: clamp(42px, 14vh, 116px);
    gap: clamp(16px, 5vw, 28px);
  }

  .product-grid:has(.product-card.is-expanded:nth-child(1)),
  .product-grid:has(.product-card.is-expanded:nth-child(2)) {
    grid-template-columns: 1.8fr 0.7fr;
  }

  .product-grid:has(.product-card.is-expanded:nth-child(3)),
  .product-grid:has(.product-card.is-expanded:nth-child(4)) {
    grid-template-columns: 0.7fr 1.8fr;
  }

  .caption-pill {
    padding: 8px 11px;
    font-size: clamp(12px, 3.2vw, 16px);
  }

  .caption-pill--subtitle {
    padding: 6px 8px;
    font-size: clamp(9px, 2.2vw, 11px);
  }

  .card-caption--top {
    top: 8px;
  }

  .card-caption--bottom {
    bottom: 8px;
  }

  .expanded-copy {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .expanded-copy h2 {
    font-size: clamp(15px, 4.5vw, 20px);
  }

  .expanded-copy p {
    margin-top: 4px;
    font-size: clamp(9px, 2.8vw, 12px);
  }

  .compliance {
    padding: 24px 12px 10px;
    font-size: 9px;
  }

  .compliance span {
    display: none;
  }

  .compliance {
    flex-direction: column;
    gap: 1px;
  }
}

@media (max-height: 700px) {
  .hero-content {
    padding-top: clamp(56px, 10vh, 92px);
  }

  .brand-logo {
    height: clamp(42px, 8vh, 58px);
  }

  .hero-content h1 {
    margin-top: 14px;
    font-size: clamp(28px, 3.2vw, 42px);
  }

  .product-grid {
    margin-top: clamp(28px, 6vh, 64px);
  }
}

@media (max-width: 767px) and (max-height: 700px) {
  .hero-content {
    padding-top: 56px;
  }

  .product-grid {
    margin-top: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-grid,
  .product-card,
  .card-frame,
  .card-surface,
  .expanded-panel,
  .card-caption {
    animation: none;
    transition: none;
  }
}
