/* ==========================================================================
   LUMEN · app shell — backdrop, top bar, hero, filter rail, masonry, cards
   ========================================================================== */

/* --------------------------------------------------------------------------
   backdrop: the page itself is fully transparent; everything you see is the
   admin-chosen wallpaper with a gentle blur. No dark veil, no white haze —
   the user asked for a clean, see-through canvas.
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #07070b;
}
.backdrop__img {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  filter: blur(var(--bg-blur)) brightness(var(--bg-brightness))
    saturate(var(--bg-saturation));
  transform: scale(var(--bg-scale));
  transition: background-image var(--dur-4) var(--ease-out),
    filter var(--dur-3) var(--ease-out), transform var(--dur-4) var(--ease-out);
}
.backdrop__veil {
  position: absolute;
  inset: 0;
  /* accent wash only — no grey fog over the wallpaper */
  background: radial-gradient(
    80% 60% at 100% 100%,
    hsl(var(--accent-h) 90% 45% / 0.12),
    transparent 70%
  );
  transition: background var(--dur-4);
}
.backdrop__grain {
  display: none;
}
/* --------------------------------------------------------------------------
   top bar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  padding: 10px var(--page-pad) 0;
  transition: padding var(--dur-3) var(--ease-out);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 14px 0 12px;
  border-radius: var(--r-pill);
  corner-shape: squircle;
  transition: height var(--dur-3) var(--ease-out), background var(--dur-3),
    box-shadow var(--dur-3);
}
.topbar.is-scrolled .topbar__inner {
  height: 54px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
  box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.85), inset 0 1px 0 var(--glass-edge-hi);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 6px;
  flex: none;
}
.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  corner-shape: squircle;
  color: #fff;
  background: conic-gradient(
    from 210deg,
    hsl(var(--accent-h) 100% 68%),
    hsl(calc(var(--accent-h) + 50) 100% 70%),
    hsl(calc(var(--accent-h) - 40) 100% 66%),
    hsl(var(--accent-h) 100% 68%)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 6px rgba(0, 0, 0, 0.24), 0 8px 20px -8px var(--accent-glow);
  overflow: hidden;
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 46%);
  mix-blend-mode: overlay;
}
.brand__mark .icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__text strong {
  font-size: 15.5px;
  font-weight: 680;
  letter-spacing: 0.02em;
}
.brand__text em {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--text-4);
  margin-top: 2px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  max-width: 460px;
  height: 38px;
  padding: 0 12px 0 15px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
  transition: border-color var(--dur-2), box-shadow var(--dur-2), background var(--dur-2);
  color: var(--text-3);
}
.search:focus-within {
  border-color: hsl(var(--accent-h) 100% 70% / 0.5);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28), 0 0 0 3px hsl(var(--accent-h) 100% 62% / 0.14);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: var(--fs-sm);
  color: var(--text-1);
}
.search input::placeholder {
  color: var(--text-4);
}
.search input::-webkit-search-cancel-button {
  display: none;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
/* --------------------------------------------------------------------------
   page + hero
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px var(--page-pad) 60px;
  /* clear glass carries no body of its own, so a soft shadow keeps type legible
     on any wallpaper without adding a fog back in */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.42);
}
.view {
  animation: view-in var(--dur-4) var(--ease-out);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 6px 22px;
  flex-wrap: wrap;
}
/* display type sits straight on the wallpaper — no dark ground, the type is
   heavy enough (700 weight, 60px) to carry itself on any backdrop */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 10px 0 8px;
  margin-bottom: 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  font-weight: 620;
  letter-spacing: 0.06em;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.hero__eyebrow .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ee7a8;
  box-shadow: 0 0 0 0 rgba(110, 231, 168, 0.6);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(110, 231, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(110, 231, 168, 0);
  }
}
.hero__title {
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: 1.02;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.hero__title span {
  background: linear-gradient(
    100deg,
    hsl(var(--accent-h) 100% 78%),
    hsl(calc(var(--accent-h) + 52) 100% 80%) 55%,
    hsl(calc(var(--accent-h) - 46) 100% 78%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* keeps the gradient legible over busy wallpapers */
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}
.hero__sub {
  max-width: 46ch;
  margin-top: 12px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-2);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.hero__stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 104px;
  padding: 12px 20px 13px;
  border-radius: var(--r-pill);
  corner-shape: squircle;
  background: rgba(255, 255, 255, var(--glass-alpha, 0.05));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.stat strong {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: var(--fs-micro);
  font-weight: 560;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

/* --------------------------------------------------------------------------
   filter rail
   -------------------------------------------------------------------------- */
.filterbar {
  position: relative;
  z-index: var(--z-filter);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
  border-radius: clamp(24px, 2.6vw, 40px);
  corner-shape: squircle;
  margin-bottom: 18px;
}
.filterbar__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.filterbar__row--tags {
  padding-top: 2px;
}
.tagstrip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 3px 2px;
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
}
.tagstrip::-webkit-scrollbar {
  display: none;
}
.tagstrip .chip {
  flex: none;
}
.filterbar__tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-left: auto;
}
.tool {
  --rim-angle: -75deg;
  --sheen-angle: -45deg;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 540;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.13) 46%,
    rgba(255, 255, 255, 0.04)
  );
  -webkit-backdrop-filter: blur(3px) saturate(180%);
  backdrop-filter: blur(3px) saturate(180%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.14),
    inset 0 -1px 1px rgba(255, 255, 255, 0.05),
    0 3px 2px -1.6px rgba(0, 0, 0, 0.26),
    inset 0 0 1.5px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition:
    color var(--dur-2),
    transform var(--dur-2) var(--ease-spring),
    box-shadow var(--dur-2) var(--ease-out),
    --rim-angle 420ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--rim-angle) at 50% 50%,
    rgba(255, 255, 255, 0.48) 0%,
    transparent 6% 41%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 59% 94%,
    rgba(255, 255, 255, 0.48) 100%
  );
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.tool::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    var(--sheen-angle),
    transparent 0%,
    rgba(255, 255, 255, 0.28) 40% 50%,
    transparent 56%
  );
  background-size: 200% 200%;
  background-position: 0% 0%;
  mix-blend-mode: screen;
  pointer-events: none;
  transition:
    background-position 520ms var(--ease-out),
    --sheen-angle 520ms var(--ease-out);
}
.tool > * {
  position: relative;
  z-index: 3;
}
@media (hover: hover) {
  .tool:hover {
    color: var(--text-1);
    --rim-angle: -125deg;
  }
  .tool:hover::after {
    background-position: 25% 25%;
  }
}
.tool:active {
  transform: translateY(1px) scale(0.97);
  --rim-angle: -75deg;
}
.tool.is-set {
  color: #fff;
  background: linear-gradient(
    100deg,
    hsl(var(--accent-h) 96% 50% / 0.5),
    hsl(var(--accent-h) 100% 70% / 0.7) 50%,
    hsl(var(--accent-h) 96% 52% / 0.52)
  );
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.26);
}
.tool__value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-weight: 560;
}
.tool.is-set .tool__value {
  color: rgba(255, 255, 255, 0.92);
}
.tool .icon {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.tool .caret {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform var(--dur-2);
}
.tool[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: hsl(var(--accent-h) 100% 58%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* pixel editor inside the popover */
.pixel-panel {
  width: 292px;
  padding: 4px;
}
.pixel-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.pixel-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 11px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
  transition: background var(--dur-1), border-color var(--dur-1);
}
.pixel-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pixel-chip[aria-pressed="true"] {
  background: hsl(var(--accent-h) 100% 60% / 0.28);
  border-color: hsl(var(--accent-h) 100% 76% / 0.5);
}
.pixel-chip b {
  font-size: var(--fs-xs);
  font-weight: 620;
  color: var(--text-1);
}
.pixel-chip i {
  font-style: normal;
  font-size: 9.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.pixel-panel__custom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pixel-panel__custom input {
  width: 100%;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  outline: 0;
}
.pixel-panel__custom input:focus {
  border-color: hsl(var(--accent-h) 100% 70% / 0.55);
}
.pixel-panel__custom span {
  color: var(--text-4);
  font-size: 11px;
}
.pixel-panel__foot {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.pixel-panel__foot .btn {
  flex: 1;
  --btn-h: 30px;
  font-size: var(--fs-xs);
}

/* result line */
.resultbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 6px 14px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.resultbar strong {
  color: var(--text-1);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}
.resultbar__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-4);
}
.resultbar__active {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px 0 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.mini-tag button {
  display: inline-flex;
  color: var(--text-3);
}
.mini-tag button:hover {
  color: #fff;
}
.mini-tag .icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.6;
}

/* --------------------------------------------------------------------------
   masonry
   -------------------------------------------------------------------------- */
.masonry {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.masonry__col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}
.masonry[data-animate="off"] .card {
  transition: none;
}

.card {
  position: relative;
  border-radius: var(--r-card);
  corner-shape: squircle;
  /* clear glass card: no white wash, just a hairline rim so the wallpaper
     keeps showing through the gutters */
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transform: translateZ(0);
  transition: transform var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out), border-color var(--dur-3),
    opacity var(--dur-3) var(--ease-out), filter var(--dur-3);
  animation: card-in var(--dur-4) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
.card__media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar, 1.6);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}
.card__media img,
.card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out), filter var(--dur-3);
  will-change: transform;
}
.card:hover .card__media img,
.card:hover .card__media video {
  transform: scale(1.055);
  filter: saturate(1.06) brightness(1.03);
}
.card__media::after {
  /* bottom scrim for the meta that slides up */
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 10, 0.52) 55%, rgba(4, 5, 10, 0.82));
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  pointer-events: none;
}
.card:hover .card__media::after,
.card:focus-visible .card__media::after {
  opacity: 1;
}

/* cursor-tracked specular highlight */
.card__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0.06) 34%,
    transparent 62%
  );
  mix-blend-mode: soft-light;
  transition: opacity var(--dur-3) var(--ease-out);
}
.card:hover .card__glare {
  opacity: 1;
}
.card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity var(--dur-3);
}
.card:hover .card__sheen {
  opacity: 1;
}

.card__top {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.card__top-left,
.card__top-right {
  display: flex;
  gap: 5px;
  align-items: center;
}
.card__play {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 10, 16, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.8);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity var(--dur-3), transform var(--dur-3) var(--ease-spring);
  pointer-events: none;
}
.card:hover .card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.card__play .icon {
  width: 17px;
  height: 17px;
  margin-left: 2px;
  fill: currentColor;
  stroke: none;
}

/* bottom info — always faintly present, fully revealed on hover */
.card__body {
  position: absolute;
  inset: auto 0 0;
  padding: 12px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.card:hover .card__body,
.card:focus-visible .card__body {
  opacity: 1;
  transform: none;
}
.card__title {
  font-size: var(--fs-sm);
  font-weight: 620;
  letter-spacing: -0.005em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-micro);
  font-weight: 540;
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.card__meta .sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.card__actions {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.card__act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: background var(--dur-1), transform var(--dur-1), color var(--dur-1);
}
.card__act:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}
.card__act:active {
  transform: scale(0.94);
}
.card__act .icon {
  width: 12px;
  height: 12px;
}
.card__act--icon {
  padding: 0;
  width: 27px;
  justify-content: center;
}
.card.is-selected {
  border-color: hsl(var(--accent-h) 100% 76% / 0.7);
  box-shadow: 0 0 0 2px hsl(var(--accent-h) 100% 62% / 0.55),
    0 20px 44px -20px var(--accent-glow);
}
.card.is-selected .card__body,
.card.is-selected .card__media::after {
  opacity: 1;
  transform: none;
}

/* card visibility switches — set by the admin panel, read from <html> attrs */
html[data-card-badge="off"] .card__top-right .badge:first-child,
html[data-card-badge="off"] .card__top-right .badge {
  display: none;
}
html[data-card-title="off"] .card__title {
  display: none;
}
html[data-card-meta="off"] .card__meta {
  display: none;
}
html[data-card-actions="off"] .card__actions {
  display: none;
}
/* when everything inside the body is hidden the body itself must not create
   an empty gradient bar */
html[data-card-title="off"][data-card-meta="off"][data-card-actions="off"] .card__body {
  display: none;
}
.card__check {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: hsl(var(--accent-h) 100% 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-spring);
  pointer-events: none;
}
.card.is-selected .card__check {
  opacity: 1;
  transform: none;
}
.card__check .icon {
  width: 13px;
  height: 13px;
  stroke-width: 3;
}

/* hover feedback ---------------------------------------------------------
   Never move the card itself: a translateY makes the hit-box slide out from
   under the cursor at the bottom edge, which ends :hover, snaps the card back,
   re-enters :hover — an infinite jitter loop. Everything here happens inside
   the card's own box (scale of the media, border, shadow, highlights). */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 26px 54px -24px rgba(0, 0, 0, 0.88),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  .card:hover .card__title {
    letter-spacing: 0.002em;
  }
  .card:hover .card__media img,
  .card:hover .card__media video {
    transform: scale(1.055);
    filter: saturate(1.06) brightness(1.03);
  }
}
.card:active {
  /* inset ring + slight media push instead of scaling the whole card */
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transition-duration: var(--dur-1);
}
.card:active .card__media img,
.card:active .card__media video {
  transform: scale(1.02);
}

/* skeletons ------------------------------------------------------------- */
.skeleton {
  border-radius: var(--r-card);
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 70%
  );
  background-size: 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

/* empty state ----------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 70px 24px 90px;
  text-align: center;
  animation: view-in var(--dur-4) var(--ease-out);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  corner-shape: squircle;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.empty__icon .icon {
  width: 26px;
  height: 26px;
}
.empty h3 {
  font-size: var(--fs-h3);
  font-weight: 640;
}
.empty p {
  max-width: 34ch;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

/* footer ---------------------------------------------------------------- */
.pagefoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  font-size: var(--fs-xs);
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.pagefoot__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
}
.pagefoot__brand .icon {
  width: 14px;
  height: 14px;
  color: hsl(var(--accent-h) 100% 74%);
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  :root {
    --cols: 3;
  }
}
@media (max-width: 860px) {
  :root {
    --cols: 2;
    --gap: 14px;
    --card-ratio: 1.2;
    --page-pad: 14px;
  }
  .hero {
    padding: 18px 4px 16px;
    gap: 18px;
  }
  .hero__stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stat {
    min-width: 0;
    align-items: flex-start;
    padding: 10px 16px 11px;
    border-radius: clamp(18px, 5vw, 26px);
  }
  .stat span {
    white-space: nowrap;
  }
  .filterbar {
    padding: 12px;
    gap: 10px;
  }
  .filterbar__row {
    flex-wrap: wrap;
  }
  .search {
    max-width: none;
  }
  .brand__text {
    display: none;
  }
  .seg label {
    min-width: 66px;
    padding: 0 10px;
  }
}
@media (max-width: 620px) {
  :root {
    --cols: 2;
    --fs-body: 14px;
  }
  .topbar__inner {
    height: 56px;
    gap: 8px;
    padding: 0 8px;
  }
  /* keep the bar on one line: icon-only secondary actions, shrunken search */
  .brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
  .search {
    height: 36px;
    padding: 0 10px;
  }
  .search input {
    font-size: var(--fs-xs);
  }
  #uploadNav span {
    display: none;
  }
  #uploadNav {
    --btn-h: 34px;
    width: 34px;
    padding: 0;
  }
  #adminNav span {
    display: none;
  }
  #adminNav {
    --btn-h: 34px;
    width: 34px;
    padding: 0;
  }
  .topbar__actions {
    gap: 6px;
  }
  .search .kbd {
    display: none;
  }
  .filterbar__tools {
    width: 100%;
    margin-left: 0;
  }
  .tool {
    flex: 1;
    justify-content: center;
  }
  .hero__title {
    font-size: 32px;
  }
  .card__body {
    opacity: 1;
    transform: none;
    padding: 8px 9px 9px;
    gap: 4px;
  }
  .card__media::after {
    opacity: 0.9;
  }
  /* the mobile card is ~170px wide: the hover toolbar does not fit */
  .card__actions {
    display: none;
  }
  .card__title {
    font-size: var(--fs-xs);
  }
  .card__meta {
    font-size: 9.5px;
    gap: 4px;
  }
  .card__meta span:nth-last-child(-n + 1) {
    display: none;
  }
  .card__top {
    inset: 7px 7px auto;
  }
  .card__top .badge {
    font-size: 9px;
    padding: 2px 6px;
  }
}
