/* =============================================================
   WALLPAPER VAULT — page styles for /wallpapers
   Extends the site language in css/cyberpunk-theme.css: Orbitron
   for display, Share Tech Mono for data readouts, neon pink/cyan,
   corner cuts via clip-path instead of border-radius.
   ============================================================= */

:root {
  /* Overwritten at runtime by wallpapers.js, which measures the fixed
     site header so the sticky filter bar parks directly beneath it. */
  --wp-header-h: 76px;
  --wp-cut: 16px;
  --wp-ink: #05050c;

  /* Driven by the density toggle in the command bar */
  --wp-col-min: 270px;
  --wp-row-h: 180px;

  /* Ambient wash colour — JS samples the artwork you're looking at and
     writes the dominant hue here, so the whole page glows to match. */
  --wp-ambient: 0, 255, 255;
}

/* =============================================================
   AMBIENT WASH
   Sits above the site's .animated-bg (also z-index -1, earlier in the
   DOM) and below all content.
   ============================================================= */

.wp-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(var(--wp-ambient), 0.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 15% 100%, rgba(var(--wp-ambient), 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 1.1s var(--ease-out), background 1.4s var(--ease-out);
}

.wp-ambient.is-lit { opacity: 1; }

/* =============================================================
   SCROLL PROGRESS — hairline under the fixed header
   ============================================================= */

.wp-progress {
  position: fixed;
  top: var(--wp-header-h);
  left: 0;
  z-index: 999;
  width: 100%;
  height: 2px;
  background: transparent;
  pointer-events: none;
}

.wp-progress__fill {
  height: 100%;
  width: 0;
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.7);
  transition: width 0.1s linear;
}

/* =============================================================
   HERO
   ============================================================= */

.wp-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--wp-header-h) + 4.5rem) 5% 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-soft);
}

.wp-hero__fx {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Perspective grid floor receding to the horizon */
.wp-hero__fx::before {
  content: '';
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -32%;
  height: 72%;
  background-image:
    linear-gradient(rgba(0, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(300px) rotateX(60deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 72%);
  mask-image: linear-gradient(to top, #000 0%, transparent 72%);
  animation: wpFloor 7s linear infinite;
}

/* Slow CRT sweep across the whole hero */
.wp-hero__fx::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 240px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 255, 255, 0.07) 45%,
    rgba(255, 0, 255, 0.05) 55%,
    transparent
  );
  animation: wpSweep 9s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes wpFloor {
  to { background-position: 0 64px, 64px 0; }
}

@keyframes wpSweep {
  0%   { transform: translateY(-260px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(120%); opacity: 0; }
}

.wp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.45;
  animation: wpDrift 18s ease-in-out infinite alternate;
}

.wp-orb--a {
  width: 340px;
  height: 340px;
  top: -110px;
  left: 6%;
  background: var(--neon-pink);
}

.wp-orb--b {
  width: 300px;
  height: 300px;
  right: 8%;
  bottom: -130px;
  background: var(--neon-cyan);
  animation-delay: -8s;
}

@keyframes wpDrift {
  to { transform: translate3d(46px, 28px, 0) scale(1.16); }
}

/* --- Kicker ------------------------------------------------- */

.wp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  padding: 0.45rem 1.05rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.28);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.wp-kicker__dot {
  width: 7px;
  height: 7px;
  background: var(--neon-green);
  box-shadow: 0 0 9px var(--neon-green);
  animation: wpPulse 1.8s ease-in-out infinite;
}

@keyframes wpPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.75); }
}

/* --- Glitch title ------------------------------------------- */

.wp-glitch {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(2.4rem, 9vw, 6rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 26px rgba(0, 255, 255, 0.35);
}

/* Chromatic-aberration layers: same glyphs, offset and tinted, each
   clipped to half the text so the split reads as signal tearing. */
.wp-glitch::before,
.wp-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.wp-glitch::before {
  color: var(--neon-pink);
  clip-path: inset(0 0 52% 0);
  animation: wpTearTop 5s steps(1, end) infinite;
}

.wp-glitch::after {
  color: var(--neon-cyan);
  clip-path: inset(52% 0 0 0);
  animation: wpTearBot 5s steps(1, end) infinite;
}

@keyframes wpTearTop {
  0%, 84%, 100% { transform: translate(0, 0); opacity: 0; }
  85%           { transform: translate(-4px, -3px); opacity: 0.9; }
  88%           { transform: translate(3px, 1px); opacity: 0.7; }
  92%           { transform: translate(-2px, 2px); opacity: 0.9; }
}

@keyframes wpTearBot {
  0%, 84%, 100% { transform: translate(0, 0); opacity: 0; }
  85%           { transform: translate(4px, 3px); opacity: 0.9; }
  88%           { transform: translate(-3px, -1px); opacity: 0.7; }
  92%           { transform: translate(2px, -2px); opacity: 0.9; }
}

/* --- Terminal readout --------------------------------------- */

.wp-term {
  margin: 1.25rem auto 0;
  max-width: 640px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--neon-green);
}

.wp-term::before {
  content: '> ';
  opacity: 0.65;
}

.wp-term__caret {
  animation: wpBlink 1s step-end infinite;
}

@keyframes wpBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* --- Stat tiles --------------------------------------------- */

.wp-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.4rem;
}

.wp-stat {
  position: relative;
  min-width: 138px;
  padding: 1.05rem 1.5rem;
  background: rgba(10, 10, 20, 0.72);
  border: 1px solid var(--border-soft);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.wp-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.wp-stat__num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wp-stat__label {
  margin-top: 0.4rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* =============================================================
   STICKY COMMAND BAR
   ============================================================= */

.wp-command {
  position: sticky;
  top: var(--wp-header-h);
  z-index: 60;
  padding: 0.85rem 5%;
  background: rgba(8, 8, 14, 0.9);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--border-soft);
}

.wp-command__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.wp-command__row + .wp-command__row {
  margin-top: 0.7rem;
}

/* --- Search ------------------------------------------------- */

.wp-search {
  position: relative;
  flex: 1 1 250px;
  min-width: 0;
}

.wp-search__icon {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: var(--neon-cyan);
  opacity: 0.7;
  pointer-events: none;
}

.wp-search input {
  width: 100%;
  padding: 0.72rem 2.4rem 0.72rem 2.6rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-soft);
  outline: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

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

.wp-search input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 1px var(--neon-cyan), 0 0 20px rgba(0, 255, 255, 0.22);
}

.wp-search__clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  display: none;
  padding: 0.3rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
}

.wp-search__clear:hover { color: var(--neon-pink); }
.wp-search.has-value .wp-search__clear { display: block; }

/* --- Filter chips ------------------------------------------- */

.wp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.wp-chips__legend {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.wp-chip {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.48rem 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: color var(--transition-normal), border-color var(--transition-normal),
              background var(--transition-normal);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}

.wp-chip:hover {
  color: #fff;
  border-color: var(--border-strong);
}

.wp-chip[aria-pressed="true"] {
  color: var(--wp-ink);
  font-weight: 700;
  background: var(--gradient-primary);
  border-color: transparent;
}

.wp-chip__n {
  margin-left: 0.35rem;
  opacity: 0.55;
}

/* --- Sort + counter ----------------------------------------- */

.wp-sort {
  padding: 0.62rem 2.2rem 0.62rem 0.8rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  border: 1px solid var(--border-soft);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.wp-sort:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 1px var(--neon-cyan);
}

.wp-sort option {
  background-color: #12121e;
  color: #fff;
}

.wp-count {
  margin-left: auto;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  white-space: nowrap;
}

.wp-count b {
  color: var(--neon-cyan);
  font-weight: 400;
}

/* =============================================================
   MOSAIC GALLERY
   ============================================================= */

.wp-stage {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 5% 3rem;
}

.wp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--wp-col-min), 1fr));
  grid-auto-rows: var(--wp-row-h);
  grid-auto-flow: dense;
  gap: 1rem;
  /* Shared vanishing point so tile tilt reads as one plane, not 500 */
  perspective: 1400px;
  transition: grid-template-columns 0.4s var(--ease-out);
}

.wp-tile {
  /* --rx/--ry: cursor tilt, --mx/--my: cursor position for the sheen,
     --lift: hover rise, --glow: colour sampled from this tile's artwork. */
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;
  --lift: 0px;
  --glow: 0, 255, 255;

  position: relative;
  overflow: hidden;
  background: var(--surface-solid-1);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transform-style: preserve-3d;
  /* Keeps offscreen tiles out of layout/paint work — this gallery runs to
     several hundred items. */
  content-visibility: auto;
  contain-intrinsic-size: auto 200px;
  clip-path: polygon(0 0, calc(100% - var(--wp-cut)) 0, 100% var(--wp-cut),
                     100% 100%, var(--wp-cut) 100%, 0 calc(100% - var(--wp-cut)));
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  transition: border-color 0.35s var(--ease-out), box-shadow 0.4s var(--ease-out),
              transform 0.45s var(--ease-spring);
}

/* Staggered rise as tiles cross into view. --d is set per tile in JS. */
.wp-tile.wp-reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.97);
}

.wp-tile.wp-reveal.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.6s var(--ease-out) var(--d, 0s),
              transform 0.7s var(--ease-spring) var(--d, 0s);
}

/* While the pointer is on a tile, kill the spring so tilt tracks 1:1 */
.wp-tile.is-tilting {
  transition: border-color 0.35s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

/* Cursor-tracking sheen, tinted by the artwork's own colour */
.wp-tile__sheen {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(300px circle at var(--mx) var(--my),
              rgba(255, 255, 255, 0.16), rgba(var(--glow), 0.1) 40%, transparent 65%);
  transition: opacity 0.35s var(--ease-out);
}

.wp-tile:hover .wp-tile__sheen { opacity: 1; }

/* Every seventh tile goes double-wide and double-tall. `dense` flow backfills
   the holes this leaves, so the mosaic stays gapless. */
@media (min-width: 900px) {
  .wp-tile--feature {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* Glow via drop-shadow, not box-shadow: the clip-path above would crop a
   box-shadow away. Same trick the card surfaces use in cyberpunk-theme.css. */
.wp-tile:hover {
  --lift: -6px;
  z-index: 2;
  border-color: rgba(var(--glow), 0.85);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 26px rgba(var(--glow), 0.45));
}

.wp-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
}

.wp-tile__img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.wp-tile:hover .wp-tile__img {
  transform: scale(1.08);
}

/* Full-tile click target. Sits above the image but below the actions. */
.wp-tile__hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  /* Label only — the visible text lives in .wp-tile__meta */
  font-size: 0;
  color: transparent;
}

.wp-tile__hit:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: -4px;
}

/* Neon sweep on hover */
.wp-tile__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(4, 4, 12, 0.92) 0%,
              rgba(4, 4, 12, 0.45) 32%, transparent 62%);
}

.wp-tile__veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(0, 255, 255, 0.22) 50%,
              transparent 58%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease-out);
}

.wp-tile:hover .wp-tile__veil::after {
  transform: translateX(130%);
}

/* Corner brackets draw in on hover */
.wp-tile__brackets {
  position: absolute;
  inset: 8px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.wp-tile:hover .wp-tile__brackets { opacity: 1; }

.wp-tile__brackets::before,
.wp-tile__brackets::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
}

.wp-tile__brackets::before {
  top: 0;
  left: 0;
  border-top: 2px solid var(--neon-cyan);
  border-left: 2px solid var(--neon-cyan);
}

.wp-tile__brackets::after {
  right: 0;
  bottom: 0;
  border-right: 2px solid var(--neon-pink);
  border-bottom: 2px solid var(--neon-pink);
}

/* --- Tile caption ------------------------------------------- */

.wp-tile__meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  padding: 0.85rem 1rem;
  pointer-events: none;
}

.wp-tile__title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  /* Two lines max, then ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wp-tile__data {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.wp-tile:hover .wp-tile__data {
  opacity: 1;
  transform: translateY(0);
}

.wp-tile__data span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 0.4rem;
  vertical-align: 2px;
  background: currentColor;
}

/* --- Badges + actions --------------------------------------- */

.wp-tile__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.6rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #17120a;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  box-shadow: 0 2px 14px rgba(255, 184, 0, 0.45);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.wp-tile__acts {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}

.wp-tile:hover .wp-tile__acts,
.wp-tile:focus-within .wp-tile__acts {
  opacity: 1;
  transform: translateY(0);
}

.wp-act {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--neon-cyan);
  background: rgba(4, 4, 12, 0.82);
  border: 1px solid rgba(0, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.wp-act:hover {
  color: var(--wp-ink);
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.6);
}

/* Touch devices get no hover, so keep the affordances visible */
@media (hover: none) {
  .wp-tile__acts,
  .wp-tile__data {
    opacity: 1;
    transform: none;
  }
}

/* --- Skeletons ---------------------------------------------- */

.wp-skel {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.03) 28%,
    rgba(0, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 72%);
  background-size: 220% 100%;
  border: 1px solid var(--border-subtle);
  animation: wpShimmer 1.4s linear infinite;
  clip-path: polygon(0 0, calc(100% - var(--wp-cut)) 0, 100% var(--wp-cut),
                     100% 100%, var(--wp-cut) 100%, 0 calc(100% - var(--wp-cut)));
}

@keyframes wpShimmer {
  to { background-position: -220% 0; }
}

/* --- Sentinel / empty state --------------------------------- */

.wp-more {
  display: grid;
  place-items: center;
  min-height: 90px;
  margin-top: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* display:grid above would otherwise beat the hidden attribute */
.wp-more[hidden] { display: none; }

.wp-spinner {
  width: 26px;
  height: 26px;
  margin-bottom: 0.6rem;
  border: 2px solid rgba(0, 255, 255, 0.2);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: wpSpin 0.8s linear infinite;
}

@keyframes wpSpin {
  to { transform: rotate(360deg); }
}

.wp-empty {
  padding: 4rem 1rem;
  text-align: center;
}

.wp-empty__icon {
  font-size: 2.6rem;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 0 14px rgba(255, 0, 255, 0.5));
}

.wp-empty h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon-pink);
  margin-bottom: 0.5rem;
}

.wp-empty p {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
}

/* =============================================================
   SUPPORT STRIP
   ============================================================= */

.wp-support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto 2.5rem;
  padding: 1.4rem 1.5rem;
  text-align: center;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--border-subtle);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.wp-support p {
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.cyber-btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #17120a;
  background: linear-gradient(135deg, #ffb800, #ff8c00);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 184, 0, 0.4);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out),
              background 0.3s var(--ease-out);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.cyber-btn-gold:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ffc933, #ffa033);
  box-shadow: 0 0 25px rgba(255, 184, 0, 0.6), 0 0 40px rgba(255, 140, 0, 0.3);
}

.cyber-btn-gold svg { flex-shrink: 0; }

/* =============================================================
   LIGHTBOX
   ============================================================= */

.wp-lb {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  grid-template-rows: auto 1fr auto;
  background: rgba(2, 2, 8, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.wp-lb.is-open { display: grid; }

.wp-lb__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.wp-lb__index {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--neon-cyan);
  white-space: nowrap;
}

.wp-lb__name {
  flex: 1;
  min-width: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wp-lb__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.wp-lb__close:hover {
  color: var(--wp-ink);
  background: var(--neon-pink);
  border-color: var(--neon-pink);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

/* --- Stage -------------------------------------------------- */

.wp-lb__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 1.2rem;
}

.wp-lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 255, 255, 0.18);
}

.wp-lb__img.is-loaded { opacity: 1; }

.wp-lb__loader {
  position: absolute;
  display: grid;
  place-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wp-lb__loader[hidden] { display: none; }

.wp-lb__nav {
  position: absolute;
  top: 50%;
  /* Above the scanline/vignette overlay so the arrows stay crisp */
  z-index: 4;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  color: var(--neon-cyan);
  background: rgba(4, 4, 12, 0.7);
  border: 1px solid rgba(0, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.wp-lb__nav:hover {
  color: var(--wp-ink);
  background: var(--neon-cyan);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.6);
}

.wp-lb__nav--prev { left: 1rem; }
.wp-lb__nav--next { right: 1rem; }

/* --- Footer bar --------------------------------------------- */

.wp-lb__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.2rem;
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--border-subtle);
}

.wp-lb__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wp-lb__facts b {
  font-weight: 400;
  color: var(--neon-cyan);
}

.wp-lb__actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.wp-lb__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--wp-ink);
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px));
}

.wp-lb__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.45);
}

.wp-lb__btn--ghost {
  color: var(--neon-cyan);
  background: transparent;
  border: 1px solid rgba(0, 255, 255, 0.35);
}

.wp-lb__btn--ghost:hover {
  color: var(--wp-ink);
  background: rgba(0, 255, 255, 0.9);
}

/* =============================================================
   TOAST
   ============================================================= */

.wp-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.3rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(6, 6, 14, 0.95);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 24px rgba(0, 255, 0, 0.3);
  transform: translate(-50%, 140%);
  transition: transform 0.45s var(--ease-spring);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.wp-toast.is-up { transform: translate(-50%, 0); }
.wp-toast__tick { color: var(--neon-green); }

/* =============================================================
   ICON BUTTONS + DENSITY CONTROL
   ============================================================= */

.wp-iconbtn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  color: var(--neon-cyan);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.wp-iconbtn:hover {
  color: var(--wp-ink);
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.55);
}

.wp-iconbtn--pink:hover {
  background: var(--neon-pink);
  border-color: var(--neon-pink);
  box-shadow: 0 0 18px rgba(255, 0, 255, 0.55);
}

.wp-density {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.5);
}

.wp-density button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
}

.wp-density button + button { border-left: 1px solid var(--border-subtle); }
.wp-density button:hover { color: #fff; }

.wp-density button[aria-pressed="true"] {
  color: var(--wp-ink);
  background: var(--gradient-primary);
}

/* =============================================================
   SHORTCUTS OVERLAY  (press ?)
   ============================================================= */

.wp-keys {
  position: fixed;
  inset: 0;
  z-index: 10003;
  display: none;
  place-items: center;
  padding: 1.5rem;
  background: rgba(2, 2, 8, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wp-keys.is-open { display: grid; }

.wp-keys__panel {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  padding: 2rem;
  background: rgba(10, 10, 20, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 60px rgba(0, 255, 255, 0.18);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.wp-keys__panel h2 {
  margin: 0 0 1.4rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wp-keys__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.wp-keys__row:last-of-type { border-bottom: none; }

.wp-keys kbd {
  display: inline-block;
  min-width: 26px;
  padding: 0.22rem 0.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  text-align: center;
  color: var(--neon-cyan);
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.wp-keys__hint {
  margin-top: 1.4rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
}

/* =============================================================
   LIGHTBOX — CINEMA LAYER
   ============================================================= */

/* Blurred copy of the current image behind everything. Reuses the cached
   file, so it costs no extra bytes. */
.wp-lb__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.wp-lb__ambient img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.25);
  filter: blur(64px) saturate(1.7);
  transition: opacity 0.8s var(--ease-out);
}

.wp-lb__ambient img.is-loaded { opacity: 0.34; }

.wp-lb__bar,
.wp-lb__stage,
.wp-lb__foot {
  position: relative;
  z-index: 1;
}

/* Scanlines + vignette over the stage */
.wp-lb__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 80% 70% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.55;
}

/* --- Zoom + pan --------------------------------------------- */

.wp-lb__img {
  --z: 1;
  --tx: 0px;
  --ty: 0px;
  transform: scale(var(--z)) translate(var(--tx), var(--ty));
  cursor: zoom-in;
  transition: opacity 0.35s var(--ease-out), transform 0.4s var(--ease-out);
}

.wp-lb__img.is-zoomed {
  cursor: grab;
  transition: opacity 0.35s var(--ease-out);
}

.wp-lb__img.is-panning { cursor: grabbing; }

.wp-lb__zoomtag {
  position: absolute;
  bottom: 0.9rem;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  padding: 0.3rem 0.7rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  background: rgba(4, 4, 12, 0.8);
  border: 1px solid rgba(0, 255, 255, 0.3);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.wp-lb__stage:hover .wp-lb__zoomtag { opacity: 1; }

/* --- Position meter ----------------------------------------- */

.wp-lb__pos {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.wp-lb__pos span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gradient-primary);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
  transition: width 0.35s var(--ease-out);
}

/* --- Download button with real progress --------------------- */

.wp-lb__btn { position: relative; overflow: hidden; }

.wp-lb__btn > * { position: relative; z-index: 1; }

.wp-lb__meter {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0 !important;
  width: var(--p, 0%);
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.2s linear;
}

.wp-lb__btn.is-busy { pointer-events: none; }

/* --- Slideshow toggle --------------------------------------- */

.wp-lb__btn--ghost.is-playing {
  color: var(--wp-ink);
  background: var(--neon-green);
  border-color: var(--neon-green);
  animation: wpPlayPulse 2s ease-in-out infinite;
}

@keyframes wpPlayPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 255, 0, 0); }
  50%      { box-shadow: 0 0 22px rgba(0, 255, 0, 0.55); }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 768px) {
  .wp-hero { padding-top: calc(var(--wp-header-h) + 2.5rem); }
  .wp-stat { min-width: 104px; padding: 0.8rem 1rem; }
  .wp-stat__num { font-size: 1.5rem; }
  .wp-count { margin-left: 0; }
  .wp-density { display: none; }
  .wp-keys__panel { padding: 1.4rem; }

  /* Density presets are desktop-only; phones get one comfortable size */
  .wp-gallery {
    --wp-col-min: 100%;
    --wp-row-h: clamp(170px, 46vw, 230px);
  }
  .wp-lb__nav { width: 44px; height: 44px; }
  .wp-lb__nav--prev { left: 0.4rem; }
  .wp-lb__nav--next { right: 0.4rem; }
  /* Five actions won't fit one phone row — wrap them instead of crushing them */
  .wp-lb__actions {
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
  }

  .wp-lb__btn {
    flex: 1 1 auto;
    min-width: 88px;
    justify-content: center;
    padding: 0.65rem 0.9rem;
  }
}

/* =============================================================
   REDUCED MOTION — keep the styling, drop the movement
   ============================================================= */

@media (prefers-reduced-motion: reduce) {
  .wp-hero__fx::before,
  .wp-hero__fx::after,
  .wp-orb,
  .wp-glitch::before,
  .wp-glitch::after,
  .wp-kicker__dot,
  .wp-skel,
  .wp-spinner {
    animation: none;
  }

  .wp-glitch::before,
  .wp-glitch::after { opacity: 0; }

  /* No tilt, no parallax, no staggered rise */
  .wp-tile {
    --rx: 0deg !important;
    --ry: 0deg !important;
  }

  .wp-tile.wp-reveal,
  .wp-tile.wp-reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .wp-ambient,
  .wp-gallery,
  .wp-lb__img,
  .wp-lb__ambient img,
  .wp-tile__sheen,
  .wp-lb__pos span,
  .wp-progress__fill {
    transition: none;
  }

  .wp-lb__btn--ghost.is-playing { animation: none; }

  .wp-tile,
  .wp-tile__img,
  .wp-tile__data,
  .wp-tile__acts,
  .wp-tile__veil::after,
  .wp-lb__btn,
  .cyber-btn-gold,
  .wp-toast {
    transition: none;
  }

  .wp-tile:hover { transform: none; }
  .wp-tile:hover .wp-tile__img { transform: scale(1); }
}
