/* Hallmark · redesign: full · genre: playful · theme: XTeamY pixel archive */
/* The terrain carries the world; square beveled plates give controls a visible resting and pressed state. */
:root {
  --archive-container: 1320px;
  --archive-gutter: clamp(14px, 3vw, 48px);
  --archive-fine: color-mix(in srgb, var(--line) 65%, var(--surface));
  --archive-seam: var(--edge);
  --archive-highlight: color-mix(in srgb, var(--rim) 78%, var(--raised));
  --archive-reveal: color-mix(in srgb, var(--line) 42%, var(--shade));
  --archive-control-shadow: inset 2px 2px var(--archive-highlight), inset -2px -5px var(--archive-reveal);
  --archive-pressed-shadow: inset 2px 3px var(--archive-reveal), inset -2px -2px var(--archive-highlight);
  --archive-plate-shadow: inset 2px 2px var(--archive-highlight), inset -2px -2px var(--archive-reveal), 0 4px var(--shade);
  --archive-motion: 180ms cubic-bezier(.2, .75, .25, 1);
  --archive-atlas: url("../assets/interface/atlas-grid.svg");
  --archive-picture-backing: color-mix(in srgb, var(--slot) 83%, var(--soft));
}

html,
body {
  overflow-x: clip;
}

body[data-page="home"] .home-main,
body:not([data-page="home"]) .page-main {
  width: min(var(--archive-container), calc(100% - 2 * var(--archive-gutter)));
}

body:not([data-page="home"]) .page-heading {
  text-wrap: pretty;
}

body:not([data-page="home"]) .heading-text p {
  max-width: 38em;
}

body:not([data-page="home"]) .heading-text h1 {
  font-size: clamp(29px, 3.4vw, 45px);
  line-height: 1.2;
}

.heading-text > p {
  text-wrap: pretty;
}

:is(.header-inner, .footer-inner, .footer-bottom) {
  width: min(var(--archive-container), calc(100% - 2 * var(--archive-gutter)));
}

.footer-inner {
  padding-block: clamp(20px, 3vw, 36px) 22px;
}

.site-footer .footer-slot {
  border-radius: 0;
  box-shadow: var(--archive-control-shadow);
}

.site-footer .footer-slot:active {
  box-shadow: var(--archive-pressed-shadow);
}

body[data-page="home"] .archive-hero {
  isolation: isolate;
  grid-template-columns: minmax(0, 540px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  row-gap: 12px;
  padding: 24px clamp(20px, 4vw, 48px) 20px;
  margin: 0 0 24px;
  border: 2px solid var(--archive-seam);
  border-bottom: 5px solid var(--shade);
  background: var(--texture), var(--scene-paper);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--shade);
}

body[data-page="home"] .archive-hero::before {
  position: absolute;
  inset: 0 0 0 40%;
  z-index: -1;
  content: "";
  background:
    var(--archive-atlas) right top / 128px 128px,
    var(--landscape) center 66% / cover no-repeat var(--sky);
  filter: var(--scene-filter);
  mask-image: linear-gradient(90deg, transparent, #000 32%);
  pointer-events: none;
}

body[data-page="home"] .archive-hero::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: 8px;
  content: "";
  background: var(--world-edge) left top / 80px 15px repeat-x;
  filter: var(--world-edge-lighting);
  pointer-events: none;
}

body[data-page="home"] .archive-hero:focus-within {
  z-index: 6;
}

body[data-page="home"] .archive-hero .home-team-copy::before {
  display: none;
}

body[data-page="home"] .archive-hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.7vw, 65px);
  font-weight: 900;
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

body[data-page="home"] .archive-hero .home-team-copy p {
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.5;
}

body[data-page="home"] .archive-hero .home-team-stats {
  color: var(--muted);
  gap: 4px 16px;
  margin-top: 12px;
  font-size: 12px;
}

body[data-page="home"] .archive-hero .home-team-stats strong {
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

body[data-page="home"] .archive-hero .home-team-search {
  grid-column: 1;
}

body[data-page="home"] .archive-hero #home-search-form {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--line);
  min-height: 49px;
  padding-inline-start: 10px;
}

body[data-page="home"] .archive-hero #home-search-form:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  z-index: 2;
}

body[data-page="home"] .archive-hero #home-search-form input {
  min-width: 0;
  font-size: 15px;
}

body[data-page="home"] .archive-hero .home-team-actions {
  margin-top: 4px;
  gap: 16px;
}

body[data-page="home"] .archive-hero .home-team-actions .button {
  min-width: 0;
  flex: none;
  min-height: 44px;
  color: var(--ink);
  background: var(--raised);
  border: 2px solid var(--archive-seam);
  box-shadow: var(--archive-control-shadow);
  padding: 0 8px 4px;
}

body[data-page="home"] .archive-hero .home-team-actions .button:is(:hover, :focus-visible) {
  background: var(--soft);
}

body[data-page="home"] .archive-hero .home-team-actions .button:active {
  box-shadow: var(--archive-pressed-shadow);
}

body[data-page="home"] .archive-hero .home-frame-art {
  position: absolute;
  inset: auto 0 0 auto;
  translate: none;
  z-index: 0;
  width: 49%;
  height: 91%;
  padding: 0 3% 0 0;
  display: flex;
  flex-flow: row nowrap;
  align-items: end;
  gap: 0;
}

body[data-page="home"] .archive-hero .home-frame-person {
  position: static;
  height: clamp(105px, 15vw, 216px);
  max-width: 18%;
  width: 17%;
  object-position: center bottom;
  filter: drop-shadow(3px 4px color-mix(in srgb, var(--edge) 60%, transparent));
}

body[data-page="home"] .archive-hero :is(.home-person-pink, .home-person-blue, .home-person-yellow) {
  translate: 0 13%;
}

body[data-page="home"] .home-top-grid {
  column-gap: clamp(16px, 2vw, 28px);
}

body[data-page="home"] .home-recent .home-carousel-frame {
  padding: 0;
}

body[data-page="home"] .home-recent .home-carousel-frame::before {
  display: none;
}

body[data-page="home"] .home-recent .recent-carousel {
  border: 2px solid var(--archive-seam);
  box-shadow: 0 4px var(--shade);
  overflow: visible;
}

body[data-page="home"] .home-top-grid .carousel-slide {
  grid-template-columns: minmax(0, 1fr) minmax(240px, .45fr);
  min-height: clamp(270px, 26vw, 360px);
  color: var(--ink);
  background: var(--surface);
}

body[data-page="home"] .home-top-grid .carousel-cover {
  min-height: 0;
  background: var(--texture), var(--media-stage);
  border-inline-end: 2px solid var(--archive-seam);
}

body[data-page="home"] .home-recent .carousel-cover > img {
  width: 100%;
  object-fit: contain;
}

body[data-page="home"] .home-recent .carousel-summary {
  align-self: stretch;
  align-content: center;
  padding: clamp(16px, 2vw, 28px);
  background: var(--surface);
  border: 0;
}

body[data-page="home"] .home-recent .carousel-cover:focus-visible {
  outline-color: var(--accent);
  outline-offset: -4px;
}

body[data-page="home"] .home-top-grid .carousel-summary h3 {
  font-size: clamp(24px, 2.45vw, 35px);
  font-weight: 850;
  line-height: 1.26;
  overflow-wrap: break-word;
  min-width: 0;
  margin-block: 8px 12px;
  text-wrap: balance;
}

body[data-page="home"] .home-recent :is(.carousel-eyebrow, .carousel-credit-label, .carousel-facts) {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: normal;
}

body[data-page="home"] .home-recent .carousel-credit-label {
  display: none;
}

body[data-page="home"] .home-recent .carousel-genres > span {
  color: var(--genre);
  border: 1px solid var(--archive-fine);
  background: var(--raised);
  box-shadow: none;
}

body[data-page="home"] .home-recent .carousel-author {
  color: var(--ink);
  border: 0;
  background: none;
}

body[data-page="home"] .home-recent .carousel-author:is(:hover, :focus-visible) {
  color: var(--accent);
  background: var(--soft);
}

body[data-page="home"] .home-recent .carousel-facts {
  gap: 8px 12px;
  font-variant-numeric: tabular-nums;
}

body[data-page="home"] .home-recent .carousel-facts > span {
  padding: 0;
  color: inherit;
  border: 0;
  background: none;
  box-shadow: none;
}

body[data-page="home"] .home-recent .carousel-detail {
  width: fit-content;
  min-width: 0;
  min-height: 44px;
}

body[data-page="home"] .home-recent .carousel-controls {
  background: var(--texture), var(--surface);
  border-top: 2px solid var(--archive-seam);
  box-shadow: inset 0 2px var(--archive-highlight);
}

body[data-page="home"] .home-recent .carousel-thumbs {
  background: var(--slot);
  border-top: 2px solid var(--archive-seam);
  padding: 8px;
  gap: 8px;
}

body[data-page="home"] .home-recent .carousel-thumb {
  border: 2px solid var(--archive-seam);
  background: var(--surface);
  text-align: start;
  box-shadow: var(--archive-control-shadow);
}

body[data-page="home"] .home-recent .carousel-thumb[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: var(--archive-pressed-shadow);
}

body[data-page="home"] .home-recent .carousel-thumb-image {
  aspect-ratio: 16 / 9;
  max-height: none;
}

body[data-page="home"] .home-recent .carousel-thumb-image > img {
  object-fit: cover;
}

body[data-page="home"] .home-ranking-panel {
  margin-top: 0;
  border-width: 4px 2px 2px;
  border-inline-color: var(--archive-seam);
  border-bottom-color: var(--archive-seam);
  padding: 16px 20px;
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="home"] .home-ranking-place {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

body[data-page="home"] .home-ranking-map {
  grid-template-columns: 21px minmax(0, 1fr) auto;
}

body[data-page="home"] .home-ranking-name {
  font-size: 14px;
}

.library-workspace {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  margin-top: 24px;
}

.library-toolbar {
  border: 2px solid var(--archive-seam);
  border-top: 3px solid var(--accent);
  background: var(--texture), var(--surface);
  box-shadow: var(--archive-plate-shadow);
}

.library-index {
  border: 2px solid var(--archive-seam);
  border-top: 3px solid var(--accent);
  padding: 12px 8px 8px;
  background: var(--texture), var(--slot);
  box-shadow: var(--archive-plate-shadow);
}

.library-index-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.library-index h2 {
  font-size: 17px;
  padding-inline: 8px;
  margin: 0 0 8px;
}

.library-index .categories {
  margin: 0;
  padding: 0;
  border: 0;
}

.library-index #category-options:not([hidden]) {
  display: contents;
}

.library-index .category-toggle {
  min-height: 44px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--ink);
  box-shadow: var(--archive-control-shadow);
}

.category-toggle .icon {
  width: 14px;
  height: 14px;
  rotate: 90deg;
}

.category-toggle[aria-expanded="true"] .icon {
  rotate: -90deg;
}

.library-index .category-button {
  min-height: 44px;
  justify-content: flex-start;
  background: var(--raised);
  border: 2px solid var(--archive-seam);
  border-radius: 0;
  box-shadow: var(--archive-control-shadow);
  color: var(--ink);
  font-size: 14px;
  text-align: start;
  white-space: normal;
  line-height: 1.3;
}

.library-index .category-button:is(:hover, :focus-visible) {
  background: var(--soft);
}

.library-index .category-button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--soft);
  border-color: var(--accent);
  box-shadow: inset 3px 0 var(--accent), var(--archive-pressed-shadow);
}

.category-tally {
  color: var(--muted);
  margin-inline-start: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.library-results {
  min-width: 0;
  border-top: 1px solid var(--archive-fine);
}

.library-results .results-bar {
  margin-top: 8px;
}

.library-results #result-count {
  font-weight: 700;
}

body .library-workspace .map-grid {
  gap: 20px;
}

.library-results .map-card {
  border: 2px solid var(--archive-seam);
  border-bottom-width: 3px;
  box-shadow: 0 3px var(--shade);
}

.library-results .map-card:is(:hover, :focus-within) {
  border-color: var(--genre);
  box-shadow: 0 3px var(--shade);
}

.library-results .card-content {
  box-shadow: inset 0 2px var(--archive-highlight);
}

.library-results .card-content h2 {
  margin-top: 0;
  min-width: 0;
  font-size: 19px;
  line-height: 1.45;
}

.library-results .card-title {
  min-height: 0;
}

.library-results .card-author {
  margin: 4px 0 12px;
}

.library-results .card-topline {
  align-items: baseline;
  margin-bottom: 12px;
}

.library-results .card-category {
  background: transparent;
  padding: 0;
}

.library-results .card-category .icon {
  width: 16px;
  height: 16px;
}

.library-results .watch-link {
  padding: 4px 8px;
  border: 2px solid var(--archive-seam);
  background: var(--raised);
  box-shadow: var(--archive-control-shadow);
}

.library-results .empty-state {
  border: 2px solid var(--archive-seam);
  border-top: 4px solid var(--accent);
  box-shadow: var(--archive-plate-shadow);
  background: var(--texture), var(--surface);
}

.library-workspace[data-empty-collection="true"] {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

.library-workspace[data-empty-collection="true"] .library-results {
  border-top: 0;
}

body[data-page="favorites"] .favorite-empty-scene {
  background: var(--archive-atlas) right center / 96px 96px, var(--soft);
}

body[data-page="detail"] .map-intro {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--archive-seam);
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="detail"] .detail-cover {
  background: var(--texture), var(--media-stage);
  height: 100%;
  padding: 0;
  border: 0;
  box-shadow: none;
}

body[data-page="detail"] .detail-summary {
  border: 0;
  border-top: 4px solid var(--genre);
  align-self: stretch;
  align-content: center;
  padding: clamp(20px, 3vw, 40px);
}

body[data-page="detail"] .detail-summary h1 {
  font-size: clamp(26px, 3.05vw, 45px);
  line-height: 1.18;
  margin: 0 0 12px;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

body[data-page="detail"] .detail-facts {
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

body[data-page="detail"] .detail-tags .icon,
body[data-page="detail"] .detail-categories .icon {
  width: 16px;
  height: 16px;
  margin-inline-end: 4px;
}

.detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, .43fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  margin-top: clamp(28px, 4vw, 52px);
}

body[data-page="detail"] .detail-workspace .episodes,
body[data-page="detail"] .detail-workspace .detail-more {
  margin: 0;
  padding-top: 0;
  min-width: 0;
  scroll-margin-top: 108px;
}

.detail-workspace .episode-row {
  border: 2px solid var(--archive-seam);
  box-shadow: var(--archive-plate-shadow);
  margin: 0;
  border-bottom: 1px solid var(--archive-fine);
}

.detail-workspace .episode:focus-visible {
  outline-offset: -3px;
}

.detail-workspace .episode-meta {
  margin-top: 4px;
  font-size: 13px;
}

body[data-page="detail"] .detail-workspace :is(.episodes, .detail-more, #map-downloads) {
  scroll-margin-top: 8px;
}

.detail-workspace [data-episode-views],
.ranking-score strong,
.author-totals strong,
.setting-row kbd {
  font-variant-numeric: tabular-nums;
}

body[data-page="detail"] .detail-workspace .detail-more {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 20px 24px 24px;
  border: 0;
  border-top: 4px solid var(--accent);
  box-shadow: none;
}

.detail-workspace .detail-tools {
  flex-flow: row wrap;
  align-items: center;
  gap: 8px;
  border: 0;
  border-top: 1px solid var(--archive-fine);
  padding: 12px 0 0;
  background: none;
}

.detail-workspace .record-fields > div {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

body[data-page="authors"] .author-grid .author-card {
  background: var(--texture), var(--surface);
  border: 2px solid var(--archive-seam);
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="authors"] .author-workbench {
  background: var(--archive-picture-backing);
  border-block: 2px solid var(--archive-seam);
  box-shadow: inset 0 2px var(--archive-reveal);
  padding: 12px 8px 8px;
}

body[data-page="authors"] .author-card:is(:hover, :focus-visible) .author-open {
  text-decoration: underline;
  text-underline-offset: 4px;
}

body[data-page="author"] .author-profile-landscape {
  background-image: var(--archive-atlas), var(--landscape);
  background-repeat: repeat, no-repeat;
  background-size: 128px 128px, cover;
}

body[data-page="author"] .author-profile-toolbar {
  border-top: 3px solid var(--accent);
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="rankings"] .ranking-toolbar,
body[data-page="rankings"] .ranking-row {
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="rankings"] .ranking-score {
  background: var(--archive-picture-backing);
  border: 1px solid var(--archive-fine);
  padding: 12px;
}

body[data-page="rankings"] .ranking-refresh {
  box-shadow: var(--archive-control-shadow);
  min-height: 32px;
}

body[data-page="settings"] .settings-list {
  border-width: 3px 2px 2px;
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="settings"] .settings-board-header {
  background: var(--archive-atlas) right top / 128px 128px, var(--soft);
}

body[data-page="settings"] .settings-group .setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 12px;
  padding-block: clamp(14px, 2vw, 26px);
}

.settings-data {
  background: var(--scene-paper);
}

body[data-page="settings"] .setting-row :is(.biome-option, .button) {
  box-shadow: var(--archive-control-shadow);
}

body[data-page="settings"] .setting-row .biome-option[aria-pressed="true"] {
  box-shadow: var(--archive-pressed-shadow);
}

body[data-page="about"] .about-intro {
  background:
    linear-gradient(90deg, var(--surface) 26%, color-mix(in srgb, var(--surface) 84%, transparent) 79%),
    var(--archive-atlas) right top / 128px 128px var(--surface);
  box-shadow: var(--archive-plate-shadow);
}

body[data-page="about"] .about-story > p {
  max-width: 38em;
  text-wrap: pretty;
}

body[data-page="about"] .maintainer-card {
  border-color: var(--archive-seam);
  box-shadow: var(--archive-plate-shadow);
}

.archive-hero #home-search-form .search-submit,
.library-toolbar .search-submit,
.home-recent .carousel-detail,
.home-recent :is([data-carousel-prev], [data-carousel-next], [data-carousel-toggle]),
.detail-workspace .episode-watched,
body[data-page="detail"] .detail-actions .button {
  border: 2px solid var(--archive-seam);
  border-radius: 0;
  box-shadow: var(--archive-control-shadow);
}

:is(.archive-hero, .library-workspace, .library-toolbar, .home-recent, .detail-workspace, .detail-actions)
  :is(button, .button, .watch-link):active:not(:disabled) {
  box-shadow: var(--archive-pressed-shadow);
}

@media (min-width: 975px) {
  body[data-page="settings"] .settings-list {
    display: grid;
    grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);
  }
  .settings-board-header {
    grid-column: 1 / -1;
  }
  .settings-data {
    border-inline-start: 1px solid var(--line);
  }
  .library-index .categories {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  body[data-page="author"] .author-profile-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 24px;
    justify-items: start;
    text-align: start;
    padding: 20px 32px 24px;
  }
  body[data-page="author"] .author-profile-portrait {
    grid-column: 1;
    grid-row: 1 / span 3;
  }
  body[data-page="author"] .author-profile-identity h1,
  body[data-page="author"] .author-profile-id,
  body[data-page="author"] .author-profile-description {
    grid-column: 2;
    margin: 0;
  }
  body[data-page="author"] .author-profile-stats,
  body[data-page="author"] .author-profile-actions {
    grid-column: 3;
    justify-content: flex-end;
    justify-self: end;
    margin: 0;
  }
  body[data-page="author"] .author-profile-stats {
    grid-row: 1;
  }
  body[data-page="author"] .author-profile-actions {
    grid-row: 2;
  }
}

@media (min-width: 1161px) {
  body[data-page="home"] .archive-hero {
    grid-template-columns: minmax(0, 628px) minmax(0, 1fr);
  }
  body[data-page="home"] .archive-hero .home-frame-art {
    width: 48%;
  }
  body[data-page="home"] .archive-hero .home-team-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  body[data-page="home"] .archive-hero .home-team-actions {
    margin: 0;
    gap: 8px;
  }
}

@media (max-width: 974px) {
  .settings-data {
    border-block-start: 2px solid var(--line);
  }
  .library-workspace,
  .detail-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-index .categories {
    gap: 8px;
  }
  .library-index .category-button {
    background: var(--raised);
  }
  .category-tally {
    display: none;
  }
}

@media (max-width: 790px) {
  html {
    scroll-padding-top: 92px;
  }
  body[data-page="home"] .archive-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    padding: 18px 16px 0;
    row-gap: 8px;
  }
  body[data-page="home"] .archive-hero::before {
    inset: auto 0 0;
    height: clamp(84px, 30vw, 152px);
    background-position: right bottom, center bottom;
    mask-image: linear-gradient(180deg, transparent, #000 55%);
  }
  body[data-page="home"] .archive-hero .home-frame-art {
    position: static;
    width: 100%;
    padding: 0;
    height: clamp(65px, 13vw, 106px);
  }
  body[data-page="home"] .archive-hero .home-frame-person {
    height: 100%;
  }
  body[data-page="home"] .home-top-grid .carousel-cover {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-inline-end: 0;
    border-block-end: 2px solid var(--archive-seam);
  }
  body[data-page="home"] .home-recent .carousel-summary {
    grid-row: 2;
    align-self: stretch;
    max-width: none;
    padding: 16px;
  }
  body[data-page="home"] .home-top-grid .carousel-slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 0;
  }
  body[data-page="home"] .home-recent .carousel-facts {
    margin-bottom: 8px;
  }
  body[data-page="detail"] .map-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  body[data-page="detail"] .detail-cover {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  body[data-page="detail"] .detail-cover > img {
    height: 100%;
  }
  body[data-page="detail"] .detail-summary {
    padding: 16px;
  }
}

@media (max-width: 850px) {
  .library-workspace {
    margin-top: 16px;
    gap: 16px;
  }
  .library-index-heading h2 {
    margin-bottom: 0;
    padding-inline: 0;
  }
  .library-index-heading {
    align-items: center;
    margin-bottom: 8px;
  }
  .library-index .categories {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .library-index .categories:has(#category-options[hidden]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .library-index .category-button {
    width: 100%;
    font-size: 12px;
    padding-inline: 4px;
  }
  .library-index .category-button .icon {
    width: 16px;
    height: 16px;
  }
  .library-index .category-button[data-category="event"] {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .library-index .categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  body[data-page="home"] .archive-hero .home-team-actions {
    gap: 12px;
  }
  body[data-page="home"] .home-recent .carousel-controls {
    min-height: 44px;
  }
  .library-index h2 {
    padding-inline: 0;
  }
  .library-results .card-topline {
    align-items: flex-start;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .library-results .card-image img {
    transition: scale var(--archive-motion);
  }
  :root:not([data-motion="reduced"]) .library-results .map-card:is(:hover, :focus-within) .card-image img {
    scale: 1.035;
  }
  :root:not([data-motion="reduced"]) .archive-hero .search-submit:active {
    transform: translateY(1px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .mobile-menu:not([hidden]) {
    animation: panel-open 140ms ease-out;
  }
}
