:root {
  --bg: #f5f5f4;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: #ffffff;
  --ink: #111111;
  --muted: #686868;
  --line: rgba(17, 17, 17, 0.08);
  --accent: #111111;
  --accent-deep: #111111;
  --gold: #8b8b8b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.035);
  --focus-ring: rgba(17, 17, 17, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(42rem 34rem at -10rem -12rem, rgba(255, 255, 255, 0.82), transparent 72%),
    radial-gradient(38rem 30rem at calc(100% + 8rem) -10rem, rgba(233, 233, 231, 0.52), transparent 74%),
    linear-gradient(180deg, #fbfbfa 0, var(--bg) 20rem, #f3f3f2 100%);
}

a,
button,
summary,
input,
select {
  -webkit-tap-highlight-color: rgba(17, 17, 17, 0.08);
  touch-action: manipulation;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 40;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(20, 18, 15, 0.92);
  color: #fff;
  text-decoration: none;
  font: 700 0.84rem/1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

.skip-link:focus-visible {
  top: 1rem;
}

.page-shell {
  min-height: 100vh;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

.app-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  flex: 1 1 auto;
}

.site-header {
  width: 100%;
  margin: 0;
  padding: 1.4rem max(1rem, calc((100% - 1240px) / 2)) 1rem;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1rem;
  align-items: start;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(245, 245, 244, 0.96), rgba(245, 245, 244, 0.88));
}

.browse-bar-row {
  grid-column: 1 / -1;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font: 700 0.75rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-block h1 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 700;
  color: var(--ink);
}

.home-link {
  color: inherit;
  text-decoration: none;
}

.lede {
  margin: 0.45rem 0 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.55;
}

.search-panel {
  display: grid;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.search-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.26rem;
  align-items: center;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.28rem;
  align-items: center;
  padding: 0.25rem 0 0.05rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  transition: max-height 180ms ease, opacity 180ms ease, transform 180ms ease;
  transform-origin: top;
}

.filter-row.is-collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.filter-row:not(.is-collapsed) {
  max-height: 6rem;
  opacity: 1;
  transform: translateY(0);
}

.field {
  display: grid;
  gap: 0;
  min-width: 0;
}

.field-small {
  padding: 0;
  position: relative;
}

.filter-row .field-small:not(:first-child)::before {
  content: none;
  position: absolute;
  left: -0.36rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(17, 17, 17, 0.06), transparent);
}

.field input,
.field select,
.ghost-button {
  min-height: 2.45rem;
  border-radius: 12px;
  border: 0;
  font: 500 0.88rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
}

.field input,
.field select {
  width: 100%;
  padding: 0.68rem 0.82rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.04), 0 10px 22px rgba(0, 0, 0, 0.03);
}

.filter-row .field select {
  min-height: 2.45rem;
  padding: 0.62rem 1.55rem 0.62rem 0.82rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.64);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17, 17, 17, 0.62) 50%),
    linear-gradient(135deg, rgba(17, 17, 17, 0.62) 50%, transparent 50%);
  background-position:
    calc(100% - 0.95rem) calc(50% + 0.05rem),
    calc(100% - 0.65rem) calc(50% + 0.05rem);
  background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
  background-repeat: no-repeat;
  font-weight: 600;
}

.search-field input {
  min-height: 2.6rem;
  padding-inline: 0.9rem;
  font-size: 0.94rem;
  border-radius: 14px;
}

.field input:focus-visible,
.field select:focus-visible,
.ghost-button:focus-visible,
.filter-toggle:focus-visible,
.browse-trigger:focus-visible,
.browse-link:focus-visible,
.home-link:focus-visible,
.card-tile:focus-visible,
.rail-card:focus-visible,
.latest-set-link:focus-visible,
.lightbox-close:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(17, 17, 17, 0.08),
    0 0 0 4px var(--focus-ring);
}

.filter-toggle {
  min-height: 2.6rem;
  padding: 0 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(14px) saturate(1.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
  color: var(--ink);
  font: 700 0.64rem/1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.04), 0 10px 22px rgba(0, 0, 0, 0.03);
}

.filter-count {
  min-width: 1.3rem;
  min-height: 1.3rem;
  padding: 0 0.24rem;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(17, 17, 17, 0.08);
  color: var(--ink);
  font: 700 0.58rem/1 system-ui, sans-serif;
}

.ghost-button {
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  cursor: pointer;
}

.app-shell {
  padding: 1rem 0 3rem;
  display: flex;
  flex-direction: column;
}

.loading-state,
.catalog-shell,
.detail-shell {
  padding: 0 0 6.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.loading-card,
.detail-content,
.card-tile {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.loading-card {
  padding: 2rem;
  border-radius: 24px;
}

.catalog-meta,
.detail-topbar,
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.catalog-meta {
  margin-bottom: 0.8rem;
}

.detail-topbar,
.page-footer {
  min-height: 3.5rem;
  margin-top: auto;
  padding: 0.6rem max(0.75rem, calc((100vw - 1240px) / 2)) 0.55rem;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: linear-gradient(180deg, rgba(245, 245, 244, 0.42), rgba(245, 245, 244, 0.78));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.catalog-meta-set {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}

.catalog-meta-set > div:first-child {
  display: none;
}

.set-page-branding {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  width: 100%;
}

.set-page-logo {
  display: block;
  width: min(100%, 440px);
  max-height: 112px;
  object-fit: contain;
}

.set-page-title {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.85rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.set-page-subtitle {
  margin: 0;
  color: var(--muted);
  font: 700 0.72rem/1.3 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.detail-nav {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.catalog-meta h2 {
  margin: 0.15rem 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.catalog-summary,
.detail-breadcrumb,
.page-footer-copy,
.empty-copy,
.stat-label,
.detail-copy {
  color: var(--muted);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.page-footer-copy,
.detail-breadcrumb {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
}

.results-grid-browse {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
}

.landing-shell {
  display: grid;
  gap: 1rem;
}

.browse-bar-shell {
  margin-top: 0.15rem;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.browse-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  width: 100%;
}

.browse-menu-mobile {
  display: none;
}

.browse-menu {
  position: relative;
}

.browse-trigger {
  min-height: 2.65rem;
  width: 100%;
  padding: 0.8rem 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  list-style: none;
  font: 700 0.66rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: normal;
}

.browse-trigger::-webkit-details-marker {
  display: none;
}

.browse-trigger::after {
  content: "";
  flex: 0 0 auto;
  width: 0.48rem;
  height: 0.48rem;
  margin-left: auto;
  border-right: 1.6px solid rgba(42, 32, 22, 0.72);
  border-bottom: 1.6px solid rgba(42, 32, 22, 0.72);
  transform: rotate(45deg);
}

.browse-menu[open] .browse-trigger::after {
  transform: rotate(225deg);
}

.browse-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  min-width: 0;
  z-index: 10;
  padding: 0.75rem;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
  max-height: min(68vh, calc(100vh - 10rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.browse-panel-mobile {
  display: grid;
  gap: 1rem;
}

.browse-mobile-section {
  display: grid;
  gap: 0.55rem;
}

.browse-mobile-heading {
  margin: 0;
  font: 700 0.68rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.browse-mobile-panel {
  display: grid;
  gap: 0.65rem;
}

.browse-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.browse-link-grid-tall {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.browse-link-grid-wide {
  grid-template-columns: 1fr;
  margin-bottom: 0.7rem;
}

.browse-link {
  min-height: 2.45rem;
  padding: 0.68rem 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: rgba(245, 245, 244, 0.96);
  color: inherit;
  text-align: center;
  font: 700 0.68rem/1.1 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.browse-link-primary {
  justify-content: flex-start;
  padding-inline: 1rem;
  background: rgba(240, 240, 239, 0.98);
}

.hidden-meta {
  display: none;
}

.landing-hero,
.landing-section {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  padding: 0.1rem 0 0;
  overflow: hidden;
}

.landing-copy h3,
.section-heading h3 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-side {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.hero-side-full {
  gap: 0.45rem;
}

.hero-side-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.hero-side-header h3 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.018em;
}

.latest-set-branding {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.08rem;
  margin: 0 auto;
}

.latest-set-logo {
  display: block;
  width: min(100%, 320px);
  max-height: 72px;
  object-fit: contain;
}

.latest-set-subtitle {
  margin: 0;
  color: var(--muted);
  font: 700 0.6rem/1.3 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.browse-link {
  cursor: pointer;
}

.browse-link:hover,
.rail-card:hover,
.browse-link:hover {
  transform: translateY(-3px);
}

.landing-section {
  padding: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.recent-rail-shell {
  position: relative;
  overflow: hidden;
  width: min(100%, 980px);
  margin: 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.recent-rail-shell::before,
.recent-rail-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.75rem;
  z-index: 1;
  pointer-events: none;
}

.recent-rail-shell::before {
  left: 0;
  background: linear-gradient(90deg, rgba(241, 239, 232, 1), rgba(241, 239, 232, 0));
}

.recent-rail-shell::after {
  right: 0;
  background: linear-gradient(270deg, rgba(241, 239, 232, 1), rgba(241, 239, 232, 0));
}

.recent-rail-track {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  padding: 0.35rem 0.15rem 0.45rem;
  animation: recent-rail-scroll 92s linear infinite;
  will-change: transform;
}

.rail-card {
  width: 92px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
  transition: transform 180ms ease;
}

.rail-card-image {
  aspect-ratio: 0.72;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 18px 32px rgba(53, 39, 20, 0.16));
}

.rail-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.latest-set-link {
  padding: 0.1rem 0 0;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font: 700 0.72rem/1.25 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.88;
  transition: color 180ms ease, opacity 180ms ease;
}

.latest-set-link:hover {
  color: var(--ink);
  opacity: 1;
}

@keyframes recent-rail-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 0.5rem));
  }
}

.rail-button {
  min-width: 4.5rem;
}

.card-tile {
  border-radius: 16px;
  overflow: visible;
  text-decoration: none;
  color: inherit;
  position: relative;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  transition: transform 180ms ease, background-color 180ms ease;
  padding: 0.45rem 0.45rem 0.5rem;
}

.card-tile-compact {
  background: transparent;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.card-tile:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.52);
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 0.72;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 18px 34px rgba(53, 39, 20, 0.16));
}

.card-image-wrap-compact {
  padding: 0;
  background: transparent;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alt-badge {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  background: rgba(17, 17, 17, 0.92);
  color: white;
  font: 700 0.72rem/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-grid-browse .alt-badge {
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.28rem 0.48rem;
  font-size: 0.63rem;
}

.card-body {
  padding: 0.65rem 0.08rem 0.08rem;
  background: transparent;
  text-align: left;
}

.card-body-compact {
  padding: 0.45rem 0.04rem 0.1rem;
  text-align: left;
}

.card-compact-code {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font: 700 0.66rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-meta-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font: 700 0.72rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  justify-content: space-between;
}

.card-title {
  margin: 0.35rem 0 0.28rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.94rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.card-body-compact .card-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.14;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-start;
}

.chip {
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  background: rgba(17, 17, 17, 0.05);
  border: 0;
  font: 700 0.68rem/1.2 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-content {
  padding: 0.5rem 0 0;
  border-radius: 0;
  background: transparent;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1.15rem;
  align-items: start;
}

.hero-gallery {
  display: grid;
  gap: 0.6rem;
}

.primary-art,
.gallery-card {
  border-radius: 0;
  background: transparent;
  overflow: visible;
  box-shadow: none;
}

.primary-art img,
.gallery-card img {
  width: 100%;
  display: block;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
}

.primary-art img {
  aspect-ratio: 0.72;
  padding: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.gallery-card img {
  aspect-ratio: 0.72;
  padding: 0;
}

.gallery-caption {
  padding: 0.42rem 0.08rem 0;
  text-align: left;
}

.gallery-caption strong,
.detail-main h2 {
  margin: 0;
}

.detail-main h2 {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.detail-keyline {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font: 700 0.72rem/1.35 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-subline {
  margin: 0.45rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.55rem;
  margin: 0.8rem 0 0.9rem;
}

.stat-card {
  padding: 0.72rem 0.78rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(16px) saturate(1.03);
  -webkit-backdrop-filter: blur(16px) saturate(1.03);
  box-shadow: none;
}

.stat-value {
  font-size: 1rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
}

.stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-copy-block {
  margin-top: 0.75rem;
  padding: 0.85rem 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.detail-copy-block h3,
.gallery-section h3,
.detail-section-summary {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.detail-section-summary::-webkit-details-marker {
  display: none;
}

.detail-section-summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.4px solid rgba(17, 17, 17, 0.62);
  border-bottom: 1.4px solid rgba(17, 17, 17, 0.62);
  transform: rotate(45deg);
}

.detail-section[open] .detail-section-summary::after {
  transform: rotate(225deg);
}

.detail-copy {
  line-height: 1.6;
  font-size: 0.95rem;
}

.detail-info-list {
  display: grid;
  gap: 0.55rem;
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.detail-info-label {
  color: var(--muted);
  font: 700 0.7rem/1.3 "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-info-value {
  text-align: right;
  font: 600 0.9rem/1.4 "Avenir Next", "Segoe UI", sans-serif;
}

.empty-state {
  padding: 2rem;
  border-radius: 24px;
  border: 0;
  background: rgba(255, 255, 255, 0.74);
}

.lightbox.hidden {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-figure {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: auto;
  max-width: 96vw;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.lightbox-figure img {
  display: block;
  width: auto;
  max-width: 96vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-figure figcaption {
  width: min(96vw, 960px);
  margin-top: 0.8rem;
  color: rgba(255, 255, 255, 0.88);
  font: 600 0.92rem/1.4 system-ui, sans-serif;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font: 700 0.9rem/1 system-ui, sans-serif;
  cursor: pointer;
}

@media (max-width: 980px) {
  .site-header,
  .detail-hero,
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .archive-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-side-header {
    flex-direction: column;
    align-items: center;
  }

  .rail-actions {
    position: static;
    transform: none;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 1rem, 1240px);
  }

  .site-header {
    gap: 0.65rem;
    padding: 0.75rem 0.5rem 0.55rem;
  }

  .detail-topbar,
  .page-footer {
    padding-inline: 0.5rem;
  }

  .brand-block h1 {
    font-size: clamp(1.45rem, 8vw, 1.85rem);
    line-height: 0.98;
  }

  .lede {
    margin-top: 0.22rem;
    max-width: none;
    font-size: 0.79rem;
    line-height: 1.35;
  }

  .search-panel {
    gap: 0.22rem;
  }

  .browse-bar-shell {
    margin-top: 0;
  }

  .search-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem;
  }

  .search-field input {
    min-height: 2.35rem;
    padding-inline: 0.82rem;
    font-size: 0.92rem;
    border-radius: 12px;
  }

  .filter-toggle {
    min-height: 2.35rem;
    width: auto;
    padding-inline: 0.72rem;
    border-radius: 12px;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.34rem;
    padding-top: 0.2rem;
  }

  .filter-row .field-small:last-child {
    grid-column: 1 / -1;
  }

  .filter-row .field select {
    min-height: 2.2rem;
    padding: 0.56rem 1.3rem 0.56rem 0.68rem;
    background-position:
      calc(100% - 0.82rem) calc(50% + 0.04rem),
      calc(100% - 0.56rem) calc(50% + 0.04rem);
    font-size: 0.84rem;
    letter-spacing: 0.01em;
  }

  .browse-bar {
    display: none;
  }

  .browse-menu-mobile {
    display: block;
    width: 100%;
  }

  .browse-menu-mobile .browse-trigger {
    min-height: 2.2rem;
    padding: 0.68rem 0.78rem;
    border-radius: 12px;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.62);
  }

  .browse-panel-mobile {
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 14px;
  }

  .browse-mobile-section {
    gap: 0.42rem;
  }

  .browse-mobile-heading {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }

  .field input,
  .field select {
    font-size: 0.95rem;
  }

  .catalog-meta {
    align-items: start;
    flex-direction: column;
  }

  .detail-topbar,
  .page-footer {
    min-height: 2.35rem;
    gap: 0.25rem;
    padding-top: 0.3rem;
    padding-bottom: calc(0.28rem + env(safe-area-inset-bottom, 0px));
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(245, 245, 244, 0.18), rgba(245, 245, 244, 0.5));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .detail-topbar {
    grid-template-columns: auto 1fr auto;
    display: grid;
  }

  .detail-content {
    padding-top: 0.2rem;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .hero-gallery {
    width: min(100%, 280px);
    margin: 0 auto;
  }

  .detail-main h2 {
    font-size: clamp(1.45rem, 8vw, 1.9rem);
    line-height: 1;
  }

  .detail-keyline {
    margin-top: 0.18rem;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .detail-subline {
    margin: 0.32rem 0 0.65rem;
    gap: 0.3rem;
  }

  .chip {
    padding: 0.38rem 0.56rem;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0.55rem 0 0.7rem;
  }

  .stat-card {
    padding: 0.55rem 0.58rem;
    border-radius: 12px;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .stat-label {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .detail-copy-block {
    margin-top: 0.5rem;
    padding: 0.55rem 0;
  }

  .detail-copy {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .detail-section-summary {
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .gallery-section .gallery-grid {
    margin-top: 0.2rem;
  }

  .detail-info-list {
    gap: 0.42rem;
  }

  .detail-info-row {
    gap: 0.65rem;
  }

  .detail-info-label {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .detail-info-value {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .results-grid,
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .results-grid {
    gap: 0.55rem;
  }

  .card-tile,
  .card-tile-compact {
    padding: 0.18rem 0.12rem 0.28rem;
  }

  .card-image-wrap,
  .card-image-wrap-compact {
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.09));
  }

  .card-body-compact {
    padding: 0.32rem 0 0.02rem;
  }

  .card-compact-code {
    margin-bottom: 0.18rem;
    font-size: 0.56rem;
    letter-spacing: 0.1em;
  }

  .card-body-compact .card-title {
    font-size: 0.78rem;
    line-height: 1.12;
    letter-spacing: -0.01em;
  }

  .alt-badge {
    top: 0.38rem;
    right: 0.38rem;
    padding: 0.22rem 0.34rem;
    font-size: 0.52rem;
    letter-spacing: 0.06em;
  }

  .archive-stats,
  .browse-link-grid {
    grid-template-columns: 1fr;
  }

  .browse-link-grid-tall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-side-header .ghost-button,
  .browse-menu,
  .browse-trigger,
  .browse-panel {
    width: 100%;
  }

  .browse-panel {
    position: static;
    min-width: 0;
    margin-top: 0.55rem;
    max-height: none;
  }

  .page-footer-copy,
  .detail-breadcrumb {
    font-size: 0.54rem;
    letter-spacing: 0.03em;
    opacity: 0.74;
  }

  .detail-breadcrumb {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-nav {
    gap: 0.24rem;
    flex: 0 0 auto;
    justify-self: end;
  }

  .detail-nav .ghost-button,
  #back-to-results {
    min-height: 1.78rem;
    padding: 0 0.42rem;
    border-radius: 8px;
    font-size: 0.54rem;
    letter-spacing: 0.05em;
  }

  #back-to-results {
    justify-self: start;
  }

  .rail-card {
    width: 132px;
  }

  .lightbox-figure {
    max-width: 98vw;
  }

  .lightbox-figure img,
  .lightbox-figure figcaption {
    max-width: 98vw;
  }
}
