:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #5d626b;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #dedbd2;
  --red: #b42318;
  --teal: #006d77;
  --gold: #b7791f;
  --green: #2f6f4e;
  --shadow: 0 18px 45px rgba(23, 23, 23, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-color: rgba(180, 35, 24, 0.45);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.site-nav nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 0.45rem;
}

.site-nav nav a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 27rem);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: stretch;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 5vw, 4rem);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.96), rgba(21, 21, 21, 0.8)),
    url("hero-action-anime.svg") center / cover no-repeat,
    #151515;
}

.hero-copy,
.rating-snapshot,
.content-section,
.stats-band,
.breadcrumbs,
.detail-page,
.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero-copy {
  width: 100%;
  max-width: 46rem;
  margin: 0 0 0 auto;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2.3rem, 2rem + 2.4vw, 4.8rem);
}

h2 {
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.55rem);
}

h3 {
  font-size: 1.08rem;
}

.hero-lede {
  max-width: 43rem;
  margin: 1.1rem 0 1.4rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.quick-search label,
.field label,
legend {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.quick-search label {
  color: rgba(255, 255, 255, 0.78);
}

.search-row {
  display: flex;
  gap: 0.65rem;
  max-width: 45rem;
}

input,
select,
button {
  min-height: 2.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font: inherit;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1rem;
  color: #fff;
  background: var(--red);
  border-radius: 0.5rem;
  font-weight: 900;
  text-decoration: none;
}

.button-link.secondary {
  min-height: 2.4rem;
  color: #fff;
  background: var(--teal);
}

.button-link.tertiary {
  color: var(--ink);
  background: #fff;
}

input,
select {
  width: 100%;
  padding: 0 0.9rem;
  background: #fff;
  color: var(--ink);
}

button {
  padding: 0 1rem;
  border-color: var(--red);
  color: #fff;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.rating-snapshot {
  width: 100%;
  margin: 0 auto 0 0;
  padding: 1.2rem;
  align-self: end;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
}

.not-found {
  min-height: 55vh;
}

.snapshot-title {
  margin: 0 0 0.9rem;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.rating-snapshot ol {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rating-snapshot li {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.rating-snapshot span {
  color: #ffd166;
  font-weight: 900;
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--line);
}

.stats-band div {
  padding: 1.1rem;
  background: var(--panel);
}

.stats-band strong {
  display: block;
  font-size: 1.55rem;
}

.stats-band span,
.card-meta,
.result-count,
.score-panel span,
.fact-grid span,
.related-card small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.content-section {
  padding: clamp(2.4rem, 6vw, 4.5rem) 0 0;
}

.section-heading {
  max-width: 45rem;
  margin-bottom: 1.5rem;
}

.section-heading p:not(.eyebrow) {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.top-grid,
.anime-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.top-card,
.anime-card,
.related-card,
details,
.score-panel,
.fact-grid div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.top-card,
.anime-card {
  display: grid;
  gap: 0.8rem;
  min-height: 15rem;
  padding: 1rem;
}

.top-card p,
.anime-card p {
  margin: 0;
  color: var(--muted);
}

.rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rank-row strong,
.top-card > strong {
  color: var(--teal);
  font-size: 1.35rem;
}

.top-cover,
.card-cover,
.detail-cover,
.related-cover {
  display: block;
  width: 100%;
  object-fit: cover;
  background: #151515;
  border-radius: 0.45rem;
}

.top-cover,
.card-cover {
  aspect-ratio: 2 / 3;
}

.detail-cover {
  aspect-ratio: 2 / 3;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.related-cover {
  aspect-ratio: 2 / 3;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(180, 35, 24, 0.88), rgba(0, 109, 119, 0.88)),
    #151515;
}

.cover-placeholder span {
  font-size: 3rem;
  font-weight: 900;
}

.alt-title,
.detail-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.detail-subtitle {
  margin: 0.55rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.anime-card {
  grid-template-columns: 7.2rem minmax(0, 1fr);
  min-height: 0;
}

.anime-card-body {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.mini-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.mini-facts div {
  min-width: 0;
}

.mini-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-facts dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.card-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.card-actions .button-link.secondary {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.rank-number {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 0.45rem;
  font-weight: 900;
}

.controls {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(13rem, 16rem);
  gap: 1rem;
  align-items: end;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

fieldset {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.chip-row,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-row label,
.tag-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.chip-row input {
  width: auto;
  min-height: 0;
}

.chip-row span {
  color: var(--teal);
}

.result-count {
  margin: 0 0 1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.card-meta strong {
  color: var(--green);
}

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

.faq-section {
  padding-bottom: 3rem;
}

.faq-preview-grid,
.faq-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.faq-card {
  padding: 1.2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.faq-card h3,
.faq-page-card h2 {
  font-size: 1.1rem;
  line-height: 1.2;
}

.faq-card p,
.faq-page-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.faq-cta {
  margin: 1.2rem 0 0;
}

.faq-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 5vw, 4rem);
  color: #fff;
  background:
    linear-gradient(105deg, rgba(21, 21, 21, 0.96), rgba(0, 109, 119, 0.74)),
    url("../assets/hero-action-anime.svg") center / cover no-repeat,
    #151515;
}

.faq-stats {
  width: 100%;
}

.faq-stat-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-stat-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.faq-stat-list strong {
  color: #ffd166;
  font-size: 1.35rem;
}

.faq-page-section {
  padding-bottom: 0.5rem;
}

.faq-page-card {
  min-height: 0;
}

.breadcrumbs {
  padding: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-page {
  padding: clamp(1.8rem, 5vw, 3.5rem) 0 3rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 1.5rem;
  align-items: start;
  padding: clamp(1.5rem, 4vw, 3rem);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(21, 21, 21, 0.96), rgba(21, 21, 21, 0.78)),
    url("hero-action-anime.svg") center / cover no-repeat,
    #151515;
  border-radius: 0.5rem;
}

.detail-hero h1 {
  max-width: 20ch;
}

.detail-hero .tag-list li {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.score-panel {
  padding: 1rem;
  color: var(--ink);
}

.score-panel strong {
  display: block;
  color: var(--red);
  font-size: 2.2rem;
  line-height: 1;
}

.score-panel p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.rich-facts {
  grid-template-columns: repeat(4, 1fr);
}

.fact-grid div {
  padding: 1rem;
}

.fact-grid strong {
  display: block;
  margin-top: 0.25rem;
}

.prose {
  max-width: 52rem;
  margin-top: 2rem;
}

.prose p {
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 2rem;
  align-items: start;
}

.review-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.review-list div,
.mal-panel {
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.review-list dt {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.review-list dd {
  margin: 0.35rem 0 0;
  color: var(--ink);
}

.mal-panel {
  position: sticky;
  top: 5rem;
  box-shadow: var(--shadow);
}

.mal-panel h2 {
  font-size: 1.2rem;
}

.mal-panel p,
.source-note {
  color: var(--muted);
}

.related-grid {
  max-width: 100%;
}

.related-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
  text-decoration: none;
}

.related-card span {
  color: var(--teal);
  font-weight: 900;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .hero,
  .faq-page-hero,
  .detail-hero,
  .detail-layout,
  .controls {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .rating-snapshot {
    margin-inline: auto;
  }

  .stats-band,
  .top-grid,
  .anime-grid,
  .related-grid,
  .fact-grid,
  .faq-preview-grid,
  .faq-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mal-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .site-nav,
  .search-row,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav nav {
    justify-content: space-between;
  }

  h1 {
    font-size: 2.35rem;
  }

  .stats-band,
  .top-grid,
  .anime-grid,
  .related-grid,
  .fact-grid,
  .faq-preview-grid,
  .faq-page-grid {
    grid-template-columns: 1fr;
  }

  .anime-card {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .hero {
    padding-top: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
