:root {
  color-scheme: dark;
  --ink: #f6f7fb;
  --muted: #a5aab6;
  --surface: #171b23;
  --surface-light: #202631;
  --line: rgba(255, 255, 255, 0.11);
  --yellow: #ffe11a;
  --orange: #ff7a1a;
  --blue: #4ca5ff;
  --page: #0d1016;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui,
    sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  background:
    radial-gradient(circle at 77% 48%, rgba(255, 225, 26, 0.2), transparent 28%),
    linear-gradient(135deg, #10141b 0%, #090b0f 70%);
}

.hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.hero::after {
  position: absolute;
  right: -10%;
  bottom: -30%;
  width: 65%;
  height: 70%;
  background: var(--yellow);
  content: "";
  clip-path: polygon(35% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.96;
}

.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-size: 1.1rem;
  font-style: italic;
  transform: skew(-8deg);
}

.install-button,
.primary-action {
  border: 0;
  background: var(--yellow);
  color: #0d1016;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.install-button {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 678px;
  align-items: center;
  grid-template-columns: 0.9fr 1.1fr;
}

.hero-copy {
  position: relative;
  z-index: 4;
  padding: 80px 0 120px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(4.2rem, 8vw, 7.4rem);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 0.88;
  text-transform: uppercase;
}

.hero h1 span {
  color: var(--yellow);
}

.hero-lede {
  max-width: 500px;
  margin: 34px 0 38px;
  color: #c8ccd4;
  font-size: 1.02rem;
}

.primary-action {
  display: inline-flex;
  min-height: 52px;
  padding: 0 26px;
  align-items: center;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.hero-visual {
  position: relative;
  z-index: 3;
  height: 640px;
}

.hero-visual > img {
  position: absolute;
  z-index: 3;
  top: 3%;
  left: 6%;
  width: 87%;
  height: 95%;
  object-fit: contain;
  filter: drop-shadow(0 35px 35px rgba(0, 0, 0, 0.45));
  transform: rotate(7deg);
}

.orbit {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
}

.orbit-one {
  width: 520px;
  height: 300px;
}

.orbit-two {
  width: 640px;
  height: 390px;
  border-color: rgba(255, 225, 26, 0.45);
}

.hero-rank {
  position: absolute;
  z-index: 0;
  top: 6%;
  right: -2%;
  color: rgba(255, 255, 255, 0.06);
  font-size: 18rem;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.1em;
  line-height: 1;
}

.hero-badge {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 15%;
  display: grid;
  min-width: 190px;
  padding: 16px 20px;
  background: rgba(13, 16, 22, 0.92);
  border-left: 4px solid var(--yellow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.hero-badge strong {
  font-size: 1rem;
}

.hero-badge span {
  color: var(--muted);
  font-size: 0.76rem;
}

.ranking {
  padding: 110px 0 130px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 42px;
}

.section-heading h2,
.notes h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-style: italic;
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-heading > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.search {
  display: flex;
  width: min(100%, 360px);
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.search svg {
  width: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search input::placeholder {
  color: #737988;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter:is(:hover, :focus-visible),
.filter.is-active {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #10131a;
}

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

.bey-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.bey-card:hover {
  border-color: rgba(255, 225, 26, 0.55);
  transform: translateY(-5px);
}

.bey-card[hidden] {
  display: none;
}

.rank-number {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 18px;
  color: rgba(255, 255, 255, 0.18);
  font-size: 2.4rem;
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.card-image {
  position: relative;
  height: 300px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 225, 26, 0.14), transparent 44%),
    #11151c;
}

.card-image::after {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(17, 21, 28, 0.8));
  content: "";
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: transform 250ms ease;
}

.bey-card:hover .card-image img {
  transform: scale(1.04) rotate(2deg);
}

.type-tag {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 16px;
  padding: 5px 9px;
  background: var(--yellow);
  color: #0c0f14;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.card-content {
  padding: 22px 24px 24px;
}

.model {
  margin: 0 0 8px;
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.card-content h3 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.english-name {
  margin: 2px 0 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.stars {
  color: var(--yellow);
  font-size: 0.9rem;
  letter-spacing: 0.07em;
}

.stars i {
  color: #4e5360;
  font-style: normal;
}

.card-footer a {
  color: #dfe2e8;
  font-size: 0.78rem;
  font-weight: 800;
  text-underline-offset: 4px;
}

.empty-state {
  padding: 80px 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.notes {
  padding: 100px 0;
  background:
    linear-gradient(120deg, rgba(255, 225, 26, 0.08), transparent 45%),
    var(--surface);
  border-block: 1px solid var(--line);
}

.notes-layout {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 90px;
}

.note-list {
  display: grid;
}

.note-list p {
  display: grid;
  margin: 0;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  color: #c4c8d0;
  grid-template-columns: 48px 1fr;
}

.note-list span {
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
}

.note-list strong {
  color: var(--ink);
}

footer {
  padding: 34px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: #737988;
  font-size: 0.76rem;
}

.footer-content p {
  margin: 0;
}

.offline-toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 13px 17px;
  border-left: 3px solid var(--yellow);
  background: #262c37;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
  transform: translateY(calc(100% + 30px));
  transition: transform 200ms ease;
}

.offline-toast.is-visible {
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }

  .hero::after {
    right: -25%;
    bottom: -10%;
    width: 110%;
    height: 40%;
  }

  .hero-content {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 75px 0 15px;
  }

  .hero-visual {
    height: 520px;
  }

  .hero-visual > img {
    left: 11%;
    width: 78%;
  }

  .hero-rank {
    right: 4%;
    font-size: 13rem;
  }

  .hero-badge {
    right: 5%;
    bottom: 12%;
  }

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

  .toolbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    justify-content: flex-start;
  }

  .notes-layout {
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .nav {
    min-height: 70px;
  }

  .hero-copy {
    padding-top: 56px;
  }

  .hero h1 {
    font-size: clamp(3.5rem, 19vw, 5.4rem);
  }

  .hero-lede {
    margin-block: 25px 30px;
    font-size: 0.93rem;
  }

  .hero-visual {
    height: 400px;
  }

  .hero-visual > img {
    top: 0;
    left: 1%;
    width: 98%;
  }

  .orbit-one {
    width: 350px;
    height: 205px;
  }

  .orbit-two {
    width: 430px;
    height: 250px;
  }

  .hero-rank {
    top: 9%;
    font-size: 8rem;
  }

  .hero-badge {
    right: 0;
    bottom: 4%;
    min-width: 160px;
  }

  .ranking {
    padding: 80px 0 90px;
  }

  .toolbar {
    gap: 16px;
  }

  .search {
    width: 100%;
  }

  .filters {
    width: 100%;
    flex-wrap: nowrap;
    padding-bottom: 5px;
    overflow-x: auto;
  }

  .filter {
    flex: 0 0 auto;
  }

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

  .card-image {
    height: 330px;
  }

  .notes {
    padding: 75px 0;
  }

  .note-list p {
    grid-template-columns: 40px 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 10px;
  }
}

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