:root {
  color-scheme: dark;

  --bg: #0f1518;
  --surface: #131a1f;
  --surface-strong: #172128;
  --border: #2d3b45;
  --text: #f4f7f8;
  --muted: #9eb0bb;
  --accent: #8be0b5;
  --accent-strong: #4fd08f;
  --warning: #e0b667;
  --error: #e58f8f;
  --blue: #6eb6ff;
  --green: #40d69d;
  --gold: #e0b667;
  --red: #e58f8f;
  --violet: #b9a3ff;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f7f4;
  --surface: #fff;
  --surface-strong: #eef4f1;
  --border: #cbd8d2;
  --text: #1b2529;
  --muted: #52646d;
  --accent: #187850;
  --accent-strong: #12643f;
  --warning: #8b610d;
  --error: #a23a3a;
  --blue: #0c65b5;
  --green: #147d57;
  --gold: #94660e;
  --red: #a23a3a;
  --violet: #654cc5;
}

[x-cloak] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top, rgb(139 224 181 / 8%), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 24px;
}

.icon-link {
  display: inline-grid;
  width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.icon-link:hover,
.icon-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.75rem, 8vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.16rem;
}

.catalog-controls {
  display: grid;
  gap: 18px;
  justify-items: center;
  margin: 0 auto 30px;
}

.search-field {
  width: min(100%, 620px);
}

.search-field input {
  min-height: 68px;
  margin: 0;
  padding-inline: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.08rem;
}

.control-row {
  display: grid;
  width: min(100%, 620px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.control-row label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.control-row select {
  min-height: 52px;
  margin: 0;
  border-color: var(--border);
  background-color: var(--surface);
  color: var(--text);
}

.status-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  max-width: 640px;
  margin: 0 auto 26px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.status-banner[data-level="warning"] {
  border-left-color: var(--warning);
}

.status-banner[data-level="error"] {
  border-left-color: var(--error);
}

.status-banner strong {
  color: var(--text);
}

.catalog-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.catalog-summary div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-summary strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  color: var(--text);
  font-size: 1.24rem;
  overflow-wrap: anywhere;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.asset-card {
  min-width: 0;
  min-height: 292px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.asset-card-button {
  display: grid;
  width: 100%;
  min-height: 292px;
  grid-template-rows: 132px 1fr auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.asset-card-button:hover,
.asset-card-button:focus-visible {
  background: var(--surface-strong);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.asset-visual {
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  background: #607482;
}

.asset-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-initial {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 72%);
  border-radius: 8px;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 900;
}

.asset-body {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 18px 18px 16px;
}

.asset-title {
  min-height: 3.1em;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid currentcolor;
  border-radius: 6px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.badge[data-category="3D Model"] {
  color: var(--green);
}

.badge[data-category="Image"],
.badge[data-category="Infographic"] {
  color: var(--gold);
}

.badge[data-category="Audio"] {
  color: var(--red);
}

.badge[data-category="Reference"] {
  color: var(--violet);
}

.asset-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
}

.skeleton-card {
  background:
    linear-gradient(90deg, transparent, rgb(255 255 255 / 8%), transparent),
    var(--surface);
  background-size: 220% 100%;
  animation: shimmer 1.35s infinite;
}

dialog article.details-panel {
  width: min(680px, calc(100vw - 32px));
  max-width: 680px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.details-panel h2 {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.asset-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
}

.asset-metadata div {
  min-width: 0;
  padding: 12px;
  background: var(--surface-strong);
}

.asset-metadata dt {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.asset-metadata dd {
  min-width: 0;
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.download-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-strong);
  color: #07110d;
  font-weight: 800;
  text-decoration: none;
}

.download-button:hover,
.download-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #07110d;
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  max-width: 1px;
  max-height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes shimmer {
  from {
    background-position: 220% 0;
  }

  to {
    background-position: -220% 0;
  }
}

@media (width <= 720px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 22px;
  }

  .top-nav {
    justify-content: center;
  }

  .control-row,
  .catalog-summary,
  .asset-metadata {
    grid-template-columns: 1fr;
  }

  .search-field input {
    min-height: 58px;
  }
}
