/* ==========================================================================
   MASTAD0NT MEDIA ARCHIVE — Dark Cinema Design System
   100% local CSS, zero external requests, responsive desktop & mobile
   ========================================================================== */

:root {
  --bg: #090a0d;
  --bg-elevated: #101217;
  --bg-card: #13161d;
  --bg-panel: #171b24;
  --bg-hover: #1c212c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-accent: rgba(224, 164, 88, 0.42);
  --text: #f3f4f6;
  --text-secondary: #9ca3b0;
  --text-muted: #6c7382;
  --accent: #e0a458;
  --accent-hover: #efb972;
  --accent-soft: rgba(224, 164, 88, 0.12);
  --signal-green: #38c996;
  --signal-green-soft: rgba(56, 201, 150, 0.14);
  --signal-blue: #6aa9ff;
  --signal-blue-soft: rgba(106, 169, 255, 0.14);
  --signal-red: #e05d5d;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.68);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --header-h: 64px;
  --max-w: 1400px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 540px at 14% -10%, rgba(224, 164, 88, 0.065), transparent 60%),
    radial-gradient(900px 460px at 88% -8%, rgba(84, 132, 204, 0.055), transparent 62%),
    var(--bg);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(9, 10, 13, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.09em;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  position: relative;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 8px rgba(56, 201, 150, 0.65);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 55;
  background: rgba(9, 10, 13, 0.96);
  backdrop-filter: blur(20px);
  padding: 20px 24px 32px;
  border-top: 1px solid var(--border);
}

.mobile-drawer.open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer .nav-link {
  padding: 13px 16px;
  font-size: 1rem;
  border: 1px solid transparent;
}

.mobile-drawer .nav-link.active {
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.mobile-drawer .nav-link.active::after {
  display: none;
}

/* ==========================================================================
   Main Content & Page Intro Bands
   ========================================================================== */

main {
  flex: 1 0 auto;
  padding-bottom: 72px;
}

.page-intro {
  padding: 36px 0 26px;
  border-bottom: 1px solid var(--border);
}

.page-intro-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.eyebrow-bar {
  width: 18px;
  height: 1.5px;
  background: var(--accent);
}

.page-title {
  margin: 0;
  font-size: clamp(1.75rem, 3.1vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.14;
  color: var(--text);
}

.page-lead {
  margin: 12px 0 0;
  max-width: 680px;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.archive-metrics {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-chip {
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  min-width: 118px;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.metric-lbl {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==========================================================================
   Catalog Toolbar: Search, Type Tabs, Category Chips, Sort & View Toggle
   ========================================================================== */

.catalog-section {
  padding-top: 26px;
}

.toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}

.type-tab:hover {
  color: var(--text);
}

.type-tab.active {
  background: var(--bg-hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.type-tab .tab-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.type-tab.active .tab-count {
  color: var(--accent);
  background: var(--accent-soft);
}

.search-sort-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 360px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 440px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 58px 0 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.89rem;
  color: var(--text);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-accent);
  background: var(--bg-card);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
}

.search-clear.visible {
  display: inline-flex;
}

.search-clear.visible + .search-kbd {
  display: none;
}

.select-wrap {
  position: relative;
}

.sort-select {
  height: 40px;
  padding: 0 34px 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.85rem;
  color: var(--text);
  appearance: none;
  cursor: pointer;
}

.sort-select:hover,
.sort-select:focus {
  border-color: var(--border-strong);
  outline: none;
}

.select-chevron {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  height: 40px;
}

.view-btn {
  width: 34px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.16s, background-color 0.16s;
}

.view-btn:hover {
  color: var(--text);
}

.view-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.toolbar-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.16s var(--ease);
}

.filter-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-chip.active {
  border-color: var(--border-accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.reset-btn {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.reset-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ==========================================================================
   Media Card Grid & Compact Bin List View
   ========================================================================== */

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.media-grid.list-view {
  grid-template-columns: 1fr;
  gap: 10px;
}

.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
  cursor: pointer;
}

.media-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

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

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0c10;
  overflow: hidden;
}

.card-thumb img,
.card-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb img {
  transition: transform 0.45s var(--ease), opacity 0.25s ease;
}

.media-card:hover .card-thumb img {
  transform: scale(1.035);
}

.card-thumb video {
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.media-card.is-playing .card-thumb video {
  opacity: 1;
}

.thumb-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(9, 10, 13, 0.56) 0%,
    rgba(9, 10, 13, 0.04) 36%,
    rgba(9, 10, 13, 0.06) 66%,
    rgba(9, 10, 13, 0.72) 100%
  );
  pointer-events: none;
}

.thumb-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.badge-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-res {
  background: rgba(9, 10, 13, 0.78);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.badge-codec {
  background: rgba(9, 10, 13, 0.68);
  color: var(--accent);
  border: 1px solid rgba(224, 164, 88, 0.34);
}

.badge-live {
  background: rgba(12, 24, 21, 0.84);
  color: var(--signal-green);
  border: 1px solid rgba(56, 201, 150, 0.36);
}

.badge-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal-green);
}

.thumb-bottom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.thumb-type-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(243, 244, 246, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.duration-pill {
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(9, 10, 13, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
}

.thumb-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.media-card:hover .thumb-play-overlay {
  opacity: 1;
}

.media-card.is-playing .thumb-play-overlay {
  opacity: 0;
}

.play-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(15, 17, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-card.is-playing .card-progress {
  opacity: 1;
}

.card-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.card-body {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
  color: var(--text);
}

.card-gear {
  font-size: 0.81rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-bottom {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-cat {
  color: var(--text-secondary);
  font-weight: 500;
}

.card-specs-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* Compact List / Bin View */
.media-grid.list-view .media-card {
  flex-direction: row;
  align-items: center;
  padding: 10px 14px;
  gap: 16px;
}

.media-grid.list-view .media-card:hover {
  transform: none;
  background: var(--bg-hover);
}

.media-grid.list-view .card-thumb {
  width: 164px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.media-grid.list-view .thumb-top .badge-codec,
.media-grid.list-view .thumb-bottom .thumb-type-tag {
  display: none;
}

.media-grid.list-view .card-body {
  padding: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.media-grid.list-view .card-list-main {
  min-width: 0;
  flex: 1 1 auto;
}

.media-grid.list-view .card-meta-bottom {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
  gap: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 56px 24px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 600;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0b0c10;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.26);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   Interactive Cinema Lightbox / Player Modal
   ========================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 9, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-shell {
  width: 100%;
  max-width: 1320px;
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.lb-stage-col {
  display: flex;
  flex-direction: column;
  background: #06070a;
  min-width: 0;
  border-right: 1px solid var(--border);
}

.lb-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #0c0e13;
  flex-wrap: wrap;
}

.lb-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-stage-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-pill {
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.tool-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.tool-pill.active {
  color: var(--accent);
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.lb-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050608;
}

.lb-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  overflow: hidden;
  background: #000;
}

.lb-media-wrap video,
.lb-media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.25s ease, transform 0.28s var(--ease);
}

.lb-media-wrap.lut-log video,
.lb-media-wrap.lut-log img {
  filter: contrast(0.74) saturate(0.56) brightness(1.09);
}

.lb-media-wrap.lut-mono video,
.lb-media-wrap.lut-mono img {
  filter: grayscale(1) contrast(1.12);
}

.lb-media-wrap.zoomed img {
  transform: scale(1.95);
  cursor: zoom-out;
}

.lb-media-wrap.zoomable img {
  cursor: zoom-in;
}

/* Cinema Frame Guides Overlay */
.guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.guide-overlay.guide-239::before,
.guide-overlay.guide-239::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12.8%;
  background: rgba(0, 0, 0, 0.54);
  border-color: rgba(224, 164, 88, 0.55);
  border-style: solid;
  border-width: 0;
}

.guide-overlay.guide-239::before {
  top: 0;
  border-bottom-width: 1px;
}

.guide-overlay.guide-239::after {
  bottom: 0;
  border-top-width: 1px;
}

.guide-overlay.guide-185::before,
.guide-overlay.guide-185::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2.6%;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(224, 164, 88, 0.5);
  border-style: solid;
  border-width: 0;
}

.guide-overlay.guide-185::before {
  top: 0;
  border-bottom-width: 1px;
}

.guide-overlay.guide-185::after {
  bottom: 0;
  border-top-width: 1px;
}

.guide-overlay.guide-safe::before {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px dashed rgba(224, 164, 88, 0.55);
}

.guide-overlay.guide-safe::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(12, 14, 19, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s;
}

.lb-nav-arrow:hover {
  background: rgba(24, 28, 38, 0.96);
  border-color: var(--border-accent);
  color: var(--accent);
}

.lb-nav-prev { left: 12px; }
.lb-nav-next { right: 12px; }

.lb-transport {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #0c0e13;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.transport-play {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #090a0d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transport-play:hover {
  background: var(--accent-hover);
}

.transport-scrubber {
  flex: 1 1 160px;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}

.transport-tc {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.still-bar-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

/* Right Technical Inspector Sidebar */
.lb-inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg-elevated);
}

.lb-inspector-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 3;
}

.lb-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-close:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.lb-inspector-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lb-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.lb-desc {
  margin: 8px 0 0;
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.spec-heading {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.spec-cell {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.spec-cell.full {
  grid-column: 1 / -1;
}

.spec-key {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.spec-val {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

.lb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.tag-pill:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

.lb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

.lb-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   Video Page: Featured Showreel Deck
   ========================================================================== */

.reel-section {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--border);
}

.reel-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: stretch;
}

.reel-monitor {
  background: #06070a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.reel-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.reel-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.reel-controls {
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reel-playlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reel-playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-bottom: 4px;
}

.reel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: left;
  transition: all 0.18s var(--ease);
}

.reel-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.reel-item.active {
  border-color: var(--border-accent);
  background: linear-gradient(90deg, rgba(224, 164, 88, 0.11), var(--bg-card));
}

.reel-item-thumb {
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.reel-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-item-info {
  min-width: 0;
  flex: 1 1 auto;
}

.reel-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.reel-item-meta {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
}

.reel-spec-summary {
  margin-top: auto;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   Collections Page
   ========================================================================== */

.collections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.collection-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.collection-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.collection-mosaic {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  aspect-ratio: 16 / 8.6;
  background: #090a0d;
}

.collection-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-mosaic img:first-child {
  grid-row: 1 / span 2;
}

.collection-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.collection-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--accent);
}

.collection-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.collection-desc {
  margin: 0;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.collection-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.collection-assets-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.col-asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  text-align: left;
  transition: all 0.15s;
}

.col-asset-row:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}

.col-asset-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.col-asset-mini {
  width: 48px;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.col-asset-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-weight: 500;
}

.col-asset-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   Prose, Standards & Legal Pages (about.html, license.html, 404.html)
   ========================================================================== */

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.info-card {
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.info-card-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 600;
}

.info-card p {
  margin: 0;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.section-block {
  margin-top: 42px;
}

.section-heading {
  margin: 0 0 16px;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.spec-table th,
.spec-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.spec-table th {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table td {
  color: var(--text-secondary);
}

.spec-table td:first-child {
  color: var(--text);
  font-weight: 600;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  margin-top: 30px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-toc-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-inline: 8px;
}

.legal-toc a {
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.legal-toc a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.legal-article {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.legal-card {
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.legal-card h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  font-weight: 700;
}

.legal-card p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.91rem;
  line-height: 1.65;
}

.legal-list li {
  margin-bottom: 6px;
}

/* 404 Page */
.error-stage {
  min-height: calc(100vh - var(--header-h) - 210px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.error-frame {
  position: relative;
  max-width: 640px;
  width: 100%;
  padding: 44px 36px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(3.2rem, 8vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.error-frame h1 {
  margin: 0 0 12px;
  font-size: 1.55rem;
}

.error-frame p {
  margin: 0 auto 26px;
  max-width: 480px;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: #191e28;
  border: 1px solid var(--border-accent);
  color: var(--text);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 36px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.footer-desc {
  margin: 12px 0 0;
  max-width: 420px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.86rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-secondary);
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

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

  .reel-deck {
    grid-template-columns: 1fr;
  }

  .lightbox-shell {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  .lb-stage-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .lb-inspector {
    max-height: none;
    overflow-y: visible;
  }

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

@media (max-width: 860px) {
  .main-nav,
  .archive-status {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

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

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 660px) {
  .container {
    padding-inline: 16px;
  }

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

  .media-grid.list-view .media-card {
    flex-direction: column;
    align-items: stretch;
  }

  .media-grid.list-view .card-thumb {
    width: 100%;
  }

  .media-grid.list-view .card-body {
    flex-direction: column;
    align-items: stretch;
  }

  .type-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .search-sort-group {
    justify-content: stretch;
  }

  .search-box {
    max-width: none;
  }

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

  .lightbox-backdrop {
    padding: 8px;
  }

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