/* The background and its lighting share one full-height canvas. */
.hero-backdrop {
  background: linear-gradient(90deg, #091116 1%, #091116ee 23%, #09111677 47%, transparent 77%),
    linear-gradient(0deg, #091116cc, transparent 25%),
    url('assets/hero-garden.webp') center 66% / cover no-repeat;
}
.year-strip { background: #101c21; }
.hero-actions .primary-button { background: #9ce0db; color: #102427; }
.hero-actions .ghost-button { background: #101c218c; border-color: #8ca6a780; }
.tabs {
  gap: 2px;
  padding: 3px;
  border: 1px solid #78989d43;
  border-radius: 9px;
  background: #0c171d;
}
.tabs button { border: 0; border-radius: 6px; background: transparent; }
.tabs button.active { background: #a1dfda; color: #102427; }
.genre { background: transparent; border-color: transparent; color: #b2c1c6; }
.genre:hover, .genre.active { border-color: #78c8c35c; background: #79c9c112; color: #c1ede8; }
.searchbox:focus-within { border-color: #9adbd6; box-shadow: 0 0 0 2px #99dcd425; }
.anime-card:focus-within .poster { outline: 1px solid #8dd6d0; }
@media (hover: hover) {
  .anime-card:hover .card-title { color: #b0e4dd; }
  .anime-card:hover .poster { box-shadow: 0 6px 20px #03090c80; }
}
@media (min-width: 1101px) {
  .hero-copy { align-self: center; padding-top: 0; padding-bottom: 1.6cqw; }
  .hero-intro { color: #c5d3d5; font-size: clamp(15px, 1.35cqw, 25px); }
  .genre-row { padding-left: 14px; }
  .genre { padding-inline: clamp(8px, .75vw, 16px); }
  .card-title { margin-top: 12px; }
}
@media (max-width: 700px) {
  .hero-backdrop {
    background: linear-gradient(0deg, #091116aa, transparent 34%, #091116a3 72%, #091116ed),
      linear-gradient(90deg, #091116cc, #09111620),
      url('assets/hero-garden.webp') 67% center / cover no-repeat;
  }
  .hero { padding-top: 19px; padding-bottom: 17px; }
  .hero-actions .ghost-button { background: #0e1b22d6; }
  .hero-stats { margin-top: 16px; }
  .hero-stats small { color: #d4dcda; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; min-width: 0; }
  .genre-row { margin-top: 3px; }
  .genre-row > div { padding-block: 2px; }
  .genre { padding-inline: 9px; }
  .searchbox input { font-size: 14px; min-width: 0; }
  .year-strip .more-years { margin-left: auto; min-width: 30px; }
}

.hero {
  grid-template-columns: 35% 65%;
  height: auto;
  aspect-ratio: auto;
  padding-block: 0;
}
.hero-backdrop {
  background: #0b1115 url('assets/featured-meadow.webp') left bottom / 40% auto no-repeat;
}
.hero-copy { position: relative; z-index: 1; }
.feature-triptych {
  position: relative;
  width: calc(100% + var(--gutter));
  align-self: end;
  isolation: isolate;
}
.feature-triptych img {
  display: block;
  width: 100%;
  height: auto;
  mask-image: linear-gradient(90deg, transparent, black 6%);
}
.feature-link {
  position: absolute;
  inset: var(--hit-top) auto auto var(--hit-left);
  width: var(--hit-width);
  height: var(--hit-height);
  border: 0;
  padding: 0;
  background: transparent;
  clip-path: var(--shape);
}
.feature-comet {
  --hit-left: 3.4%; --hit-top: 13%; --hit-width: 30%; --hit-height: 84%;
  --shape: polygon(15% 6%, 100% 0, 87% 100%, 0 95%);
}
.feature-neon {
  --hit-left: 66%; --hit-top: 12%; --hit-width: 28%; --hit-height: 85%;
  --shape: polygon(10% 0, 98% 9%, 98% 94%, 0 100%);
}
.feature-frieren {
  --hit-left: 29%; --hit-top: 2%; --hit-width: 40.5%; --hit-height: 97%;
  --shape: polygon(10% 4%, 100% 0, 92% 98%, 0 100%);
}
.feature-link:focus-visible {
  outline: none;
  background: #91e4db20;
}
.feature-link:focus-visible::after {
  content: '查看详情 ↗';
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%,-50%);
  padding: .45em .7em;
  border-radius: 4px;
  background: #102428;
  color: white;
  white-space: nowrap;
}
@media (hover: hover) {
  .feature-link:hover { background: #f9eacc0d; }
}
.catalog {
  background: linear-gradient(#142027, #101a20 65rem);
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
}
.cinema-mode .catalog { background: #080f13; }
.hero-actions .ghost-button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #d4dddc;
  text-decoration: underline;
  text-underline-offset: .35em;
  text-decoration-color: #8ba2a599;
}
@media (min-width: 1101px) {
  .hero h1 { font-size: clamp(42px, 4.2cqw, 88px); }
  .hero-copy { padding-bottom: 1.5cqw; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .hero { grid-template-columns: 40% 60%; min-height: 240px; }
  .hero-copy { padding-block: 18px; }
}
@media (max-width: 700px) {
  .hero { padding-top: 16px; }
  .hero-backdrop { background: #0b1115; }
  .hero-copy { display: flex; flex-direction: column; }
  .hero-copy h1 { order: 0; }
  .hero-intro { display: none; }
  .hero-stats {
    order: 1;
    width: auto;
    justify-content: flex-start;
    gap: 0;
    margin: 9px 0 8px;
  }
  .hero .hero-stats > div {
    flex: none;
    justify-content: flex-start;
    gap: .25em;
    border: 0;
    padding: 0;
  }
  .hero-stats > div + div::before { content: '·'; margin: 0 .5em; color: #8a9b9d; }
  .hero-stats strong, .hero-stats small { font-weight: 500; font-family: inherit; font-size: 13px; line-height: 1.5; color: #c6d4d5; }
  .hero-actions { order: 2; display: flex; align-items: center; gap: 8px; margin: 0; }
  .hero-actions .primary-button, .hero-actions .ghost-button { min-height: 42px; }
  .hero-actions .primary-button { padding-inline: 20px; }
  .feature-triptych { width: min(calc(100% + 2 * var(--gutter)), 530px); align-self: center; margin-top: 8px; }
  .feature-triptych img { mask-image: linear-gradient(0deg, black 88%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Keep artwork, title and metadata together when neighboring titles wrap. */
.anime-grid { align-items: stretch; }
.anime-card { display: flex; flex-direction: column; }
.anime-card .poster { flex: none; }
.anime-card .card-title {
  height: auto;
  min-height: 0;
  line-height: 1.45;
  margin-bottom: 4px;
  text-align: start;
}
.anime-card .card-tags { margin-top: auto; line-height: 1.65; color: #becdd0; }
.card-footer .portal-link { justify-content: flex-start; gap: .45em; }
@media (min-width: 701px) {
  .anime-grid { row-gap: clamp(28px, 2.5vw, 48px); }
  .card-footer .portal-link { min-height: 30px; font-size: clamp(13px, .95vw, 17px); }
}
@media (max-width: 700px) {
  .anime-grid { gap: 22px 12px; }
  .anime-card { background: #101b22; border-color: #829ba426; padding-bottom: 2px; }
  .anime-card .card-title, .anime-card .card-tags, .anime-card .card-footer { margin-inline: 9px; width: calc(100% - 18px); }
  .anime-card .card-title { margin-top: 10px; font-size: 16px; }
  .anime-card .card-tags { font-size: 12px; }
  .card-footer .portal-link { min-height: 34px; font-size: 12px; }
  .save-button::after { content: ''; position: absolute; inset: -4px -5px; }
  .mobile-dock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #back-top { display: none; }
}
