:root {
  color-scheme: dark;
  --bg: #050814;
  --bg-2: #08111f;
  --ink: #f2f7ff;
  --muted: #9fb2cc;
  --soft: #c8d8f3;
  --panel: rgba(9, 18, 34, 0.82);
  --panel-strong: rgba(12, 24, 44, 0.96);
  --line: rgba(160, 206, 255, 0.16);
  --line-strong: rgba(105, 231, 255, 0.42);
  --accent: #5eeaff;
  --accent-2: #78ffb9;
  --hot: #ff6fb7;
  --gold: #f5d06f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, #050814 0%, #0a1223 48%, #050814 100%);
  background-size: 42px 42px, 42px 42px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(94, 234, 255, 0.1), transparent 34%),
    linear-gradient(225deg, rgba(255, 111, 183, 0.08), transparent 38%),
    linear-gradient(180deg, transparent, rgba(3, 7, 18, 0.78));
  content: "";
  pointer-events: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 10px 0 20px;
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.95;
  overflow-wrap: anywhere;
  text-shadow: 0 0 34px rgba(94, 234, 255, 0.14);
}

.case-actions a,
.case-actions button,
.detail-actions a,
.detail-actions button,
.detail-close,
.category-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 24, 44, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.category-tabs button:hover,
.case-actions a:hover,
.case-actions button:hover,
.detail-actions a:hover,
.detail-actions button:hover,
.detail-close:hover {
  border-color: var(--line-strong);
  background: rgba(94, 234, 255, 0.12);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border: 1px solid rgba(160, 206, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(94, 234, 255, 0.16);
}

.summary-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: stretch;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(94, 234, 255, 0.11), transparent 42%),
    linear-gradient(145deg, rgba(11, 23, 45, 0.92), rgba(7, 12, 27, 0.88));
  box-shadow: var(--shadow);
}

.summary-panel::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 75%);
  pointer-events: none;
}

.summary-copy,
.controls,
.status-note,
.case-grid {
  min-width: 0;
}

.summary-copy {
  position: relative;
  z-index: 1;
}

.summary-copy h2 {
  margin-bottom: 12px;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.summary-copy p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stats div {
  display: grid;
  align-content: center;
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(160, 206, 255, 0.18);
  border-radius: 8px;
  background: rgba(3, 9, 20, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stats strong {
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.search-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 18, 34, 0.72);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.search-box span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.search-box input::placeholder {
  color: rgba(200, 216, 243, 0.62);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tabs button {
  min-height: 42px;
  padding: 0 13px;
  color: #d9e8ff;
}

.category-tabs button.active {
  border-color: rgba(120, 255, 185, 0.75);
  background: linear-gradient(135deg, rgba(94, 234, 255, 0.94), rgba(120, 255, 185, 0.94));
  color: #06111e;
  box-shadow: 0 16px 44px rgba(94, 234, 255, 0.18);
}

.status-note {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 208, 111, 0.24);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: rgba(16, 22, 38, 0.78);
  color: var(--soft);
  font-size: 14px;
  line-height: 1.6;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}

.case-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 24, 44, 0.92), rgba(7, 13, 27, 0.96));
  box-shadow: var(--shadow);
}

.case-card:hover {
  border-color: rgba(94, 234, 255, 0.42);
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(94, 234, 255, 0.08);
}

.media-frame {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(13, 30, 56, 0.72), rgba(3, 8, 18, 0.82)),
    repeating-linear-gradient(115deg, #13213c 0 18px, #0e1a31 18px 36px);
  cursor: pointer;
}

.media-frame:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.case-card:hover .cover-image {
  filter: saturate(1.08);
  transform: scale(1.035);
}

.cover-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 9, 18, 0.06), rgba(4, 9, 18, 0.72)),
    linear-gradient(90deg, rgba(94, 234, 255, 0.12), transparent 34%);
}

.play-mark {
  position: relative;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  background: rgba(242, 247, 255, 0.92);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(94, 234, 255, 0.28);
}

.play-mark::after {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 23px solid #06111e;
  content: "";
  transform: translate(-40%, -50%);
}

.media-meta {
  position: absolute;
  inset: auto 12px 12px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.media-meta span,
.platform-badge {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(2, 7, 17, 0.55);
  padding: 5px 8px;
  backdrop-filter: blur(10px);
}

.platform-badge {
  position: absolute;
  inset: 12px 12px auto auto;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.case-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.case-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.category,
.detail-category {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(94, 234, 255, 0.16);
  border-radius: 6px;
  background: rgba(94, 234, 255, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.case-heading h3 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dependency-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.dependency-chip {
  border: 1px solid rgba(160, 206, 255, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #d8e8ff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dependency-chip.direct {
  border-color: rgba(120, 255, 185, 0.42);
  background: rgba(120, 255, 185, 0.12);
  color: #9cffd0;
}

.dependency-chip.ready {
  border-color: rgba(245, 208, 111, 0.46);
  background: rgba(245, 208, 111, 0.13);
  color: #ffe69a;
}

.dependency-chip.image,
.dependency-chip.video,
.dependency-chip.mixed {
  border-color: rgba(94, 234, 255, 0.28);
  color: #b8f3ff;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-row span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.cover-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
}

.prompt {
  margin-bottom: 0;
  color: var(--soft);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tag-chip {
  border: 1px solid rgba(94, 234, 255, 0.18);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(94, 234, 255, 0.07);
  color: #9eeeff;
  font-size: 12px;
  font-weight: 900;
}

details {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 900;
  overflow-wrap: anywhere;
}

pre {
  overflow: auto;
  max-height: 260px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid rgba(160, 206, 255, 0.12);
  border-radius: 8px;
  background: rgba(2, 7, 17, 0.72);
  color: #dfeaff;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.asset-list,
.detail-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.asset-chip {
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px dashed rgba(160, 206, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.asset-chip.pending {
  border-color: rgba(245, 208, 111, 0.36);
}

.asset-chip.collected {
  border-color: rgba(120, 255, 185, 0.42);
}

.caution {
  margin-bottom: 0;
  border-left: 3px solid var(--hot);
  padding: 8px 10px;
  background: rgba(255, 111, 183, 0.08);
  color: #ffc2df;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.case-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.case-actions button,
.case-actions a,
.detail-actions button,
.detail-actions a {
  padding: 9px 12px;
}

.case-actions button,
.detail-actions button {
  color: #06111e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.case-actions .detail-button,
.detail-actions button {
  border-color: rgba(120, 255, 185, 0.62);
}

body.modal-open {
  overflow: hidden;
}

.detail-modal[hidden] {
  display: none;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 17, 0.78);
  backdrop-filter: blur(12px);
}

.detail-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 0;
  overflow: hidden;
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  border: 1px solid rgba(160, 206, 255, 0.24);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 8px 10px;
  background: rgba(9, 18, 34, 0.9);
}

.detail-media {
  display: grid;
  min-width: 0;
  min-height: 360px;
  place-items: center;
  background: #020711;
}

.detail-media video,
.detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(860px, calc(100vh - 48px));
  object-fit: contain;
}

.detail-content {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  overflow: auto;
  padding: 24px;
}

.detail-heading {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-right: 80px;
}

.detail-heading h2 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.detail-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.detail-prompt {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.detail-prompt h3 {
  margin-bottom: 0;
  color: #ffffff;
  font-size: 16px;
}

.detail-prompt pre {
  max-height: none;
  margin-top: 0;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(720px, calc(100% - 24px));
    padding-top: 16px;
  }

  .topbar,
  .summary-panel,
  .controls {
    grid-template-columns: 1fr;
  }

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

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .summary-panel {
    padding: 20px 16px;
  }

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

  .stats div {
    min-height: 90px;
  }

  .detail-modal {
    padding: 12px;
  }

  .detail-panel {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 24px);
  }

  .detail-media {
    min-height: 220px;
    aspect-ratio: 16 / 9;
  }

  .detail-content {
    padding: 18px;
  }

  .detail-heading {
    padding-right: 0;
  }
}
