:root {
  --bg-ink: #0d1628;
  --bg-ink-soft: #16253f;
  --bg-paper: #f7f1e2;
  --card: #fffdf8;
  --line: #d9d0c2;
  --ink: #1d2836;
  --ink-soft: #596475;
  --accent: #c64b2c;
  --accent-deep: #8f2e14;
  --mint: #2f6f66;
  --shadow: 0 18px 38px rgba(10, 14, 24, 0.2);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, sans-serif;
  background:
    radial-gradient(circle at 8% 16%, rgba(198, 75, 44, 0.18), transparent 33%),
    radial-gradient(circle at 86% 12%, rgba(47, 111, 102, 0.19), transparent 33%),
    linear-gradient(165deg, #f2e9d7 0%, var(--bg-paper) 44%, #fbf8f0 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(45deg, transparent 40%, rgba(0, 0, 0, 0.2) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, rgba(0, 0, 0, 0.18) 50%, transparent 60%);
  background-size: 4px 4px, 6px 6px;
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

.wrap {
  width: min(1180px, calc(100% - 42px));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  color: #f7f4ee;
  margin-top: 26px;
  padding: 30px;
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(13, 22, 40, 0.96) 0%, rgba(22, 37, 63, 0.92) 64%, rgba(33, 58, 97, 0.88) 100%),
    radial-gradient(circle at 82% 16%, rgba(198, 75, 44, 0.3), transparent 42%);
  border: 1px solid rgba(241, 230, 213, 0.22);
  box-shadow: var(--shadow);
}

.back-link {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(247, 244, 238, 0.45);
  padding: 6px 12px;
  color: #f7f4ee;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 18px 0 0;
  color: #f8cc89;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

h1 {
  margin: 8px 0 12px;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.05rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.hero-copy {
  margin: 0;
  max-width: 72ch;
  color: rgba(247, 244, 238, 0.92);
  line-height: 1.58;
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 13px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.btn-primary {
  border-color: #a33b1d;
  color: #fff;
  background: linear-gradient(120deg, #d56f34 0%, #b93f20 100%);
}

.btn-ghost {
  border-color: rgba(247, 244, 238, 0.45);
  color: #f7f4ee;
  background: rgba(247, 244, 238, 0.08);
}

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

.hero-stats li {
  border: 1px solid rgba(247, 244, 238, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.86rem;
  color: rgba(247, 244, 238, 0.95);
}

.hero-stats strong {
  font-family: "Sora", sans-serif;
  color: #fff;
}

.section-stack {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  padding-bottom: 90px;
}

.asset-group {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 12px 28px rgba(53, 38, 17, 0.12);
  overflow: hidden;
}

.asset-group summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 17px 42px;
  background: linear-gradient(145deg, rgba(255, 251, 242, 0.93) 0%, rgba(246, 238, 223, 0.84) 100%);
}

.asset-group summary::marker {
  content: "";
}

.asset-group summary::-webkit-details-marker {
  display: none;
}

.asset-group summary::before {
  content: "▸";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #46566d;
  line-height: 1;
}

.asset-group[open] summary::before {
  content: "▾";
}

.group-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.06rem, 2.1vw, 1.46rem);
  line-height: 1.14;
}

.group-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.group-count {
  justify-self: end;
  border-radius: 999px;
  border: 1px solid #ccbda6;
  background: #fffaf1;
  color: #5d4f3d;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 6px 9px;
}

.asset-grid {
  padding: 0 14px 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.asset-card {
  border: 1px solid #d8ccb9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  display: grid;
  grid-template-rows: auto auto;
  align-self: stretch;
  height: 100%;
}

.asset-preview {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  background: #ece2d4;
  color: inherit;
  cursor: pointer;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-preview video {
  background: #0f1115;
}

.asset-preview:disabled {
  cursor: not-allowed;
}

.preview-overlay {
  position: absolute;
  right: 8px;
  top: 8px;
  border-radius: 999px;
  background: rgba(13, 22, 40, 0.7);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
}

.doc-preview,
.placeholder-preview {
  min-height: 0;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 18px;
}

.doc-preview {
  color: #5c3124;
  background:
    linear-gradient(150deg, rgba(255, 248, 240, 0.95) 0%, rgba(248, 231, 215, 0.95) 100%),
    repeating-linear-gradient(180deg, transparent 0, transparent 9px, rgba(91, 50, 30, 0.06) 10px);
}

.doc-preview strong {
  font-family: "Sora", sans-serif;
  font-size: 2.3rem;
  line-height: 1;
}

.doc-preview span,
.placeholder-preview span {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.placeholder-preview {
  background:
    linear-gradient(165deg, rgba(243, 237, 224, 0.95) 0%, rgba(233, 224, 207, 0.95) 100%),
    repeating-linear-gradient(45deg, rgba(153, 141, 118, 0.12) 0, rgba(153, 141, 118, 0.12) 10px, transparent 10px, transparent 20px);
  color: #605641;
}

.asset-meta {
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 194px;
}

.asset-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.asset-kind {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #44635f;
}

.asset-kind-dim {
  margin: 0;
  color: #5d6778;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.asset-kind-dim-empty {
  visibility: hidden;
}

.asset-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
  line-height: 1.24;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.asset-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
  min-height: calc(1em * 1.45 * 2);
  max-height: calc(1em * 1.45 * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.asset-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 25px;
  overflow: hidden;
  margin-top: auto;
}

.asset-tag {
  border-radius: 999px;
  border: 1px solid #d7ccb7;
  background: #fffcf5;
  color: #625749;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-actions {
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.asset-actions .btn {
  padding: 8px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.asset-actions .btn-preview {
  border-color: #cabca7;
  color: #2a3342;
  background: #fffef9;
}

.asset-actions .btn-download {
  border-color: #95624f;
  color: #fff;
  background: linear-gradient(120deg, #915f4d 0%, #6d4437 100%);
}

.asset-actions .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.kit-error {
  margin: 12px 0 0;
  border: 1px dashed #d3c6b2;
  border-radius: 12px;
  background: rgba(255, 251, 243, 0.9);
  color: #5f6875;
  padding: 12px;
}

.footer-note {
  margin-top: 14px;
  padding-bottom: 26px;
  color: #5b6677;
  font-size: 0.9rem;
}

.footer-note p {
  margin: 4px 0;
}

.footer-note a {
  color: #235b84;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(8, 14, 24, 0.8);
  z-index: 45;
  padding: 20px;
}

.lightbox.is-open {
  display: grid;
}

.lightbox-shell {
  width: min(1120px, calc(100vw - 22px));
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  border: 1px solid rgba(247, 244, 238, 0.2);
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(13, 22, 40, 0.97) 0%, rgba(22, 37, 63, 0.95) 100%);
  padding: 14px;
  position: relative;
}

.lightbox-media {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(247, 244, 238, 0.22);
  border-radius: 12px;
  background: rgba(4, 8, 14, 0.64);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media img,
.lightbox-media video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.lightbox-media iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox-meta {
  color: #f2eee7;
  display: grid;
  align-content: start;
  gap: 10px;
}

.lightbox-kind {
  margin: 0;
  color: #f8cc89;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lightbox-meta h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.4rem;
  line-height: 1.12;
}

.lightbox-meta p {
  margin: 0;
  color: rgba(242, 238, 231, 0.86);
  line-height: 1.45;
}

.lightbox-dimensions {
  color: rgba(248, 204, 137, 0.96);
  font-size: 0.83rem;
  font-weight: 700;
  min-height: calc(1em * 1.45);
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(247, 244, 238, 0.45);
  background: rgba(247, 244, 238, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 1px solid rgba(247, 244, 238, 0.5);
  border-radius: 50%;
  background: rgba(10, 16, 27, 0.64);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

#lightboxPrev {
  left: 18px;
}

#lightboxNext {
  right: 332px;
}

.lightbox-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.hidden {
  display: none !important;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 1080px) {
  .asset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lightbox-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  #lightboxPrev,
  #lightboxNext {
    top: auto;
    bottom: 14px;
    transform: none;
  }

  #lightboxPrev {
    left: 14px;
  }

  #lightboxNext {
    right: 14px;
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 24px 20px;
  }

  .back-link {
    top: 12px;
    right: 12px;
  }

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

@media (max-width: 620px) {
  .wrap {
    width: calc(100% - 24px);
  }

  .hero-stats {
    display: grid;
    gap: 6px;
  }

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

  .group-count {
    justify-self: start;
  }

  .asset-group summary {
    grid-template-columns: 1fr;
  }
}
