:root {
  color-scheme: dark;
  --bg: #03080d;
  --bg-mid: #071621;
  --bg-deep: #010305;
  --ink: #eef7fb;
  --accent: #68ffd8;
  --accent-2: #43b3ff;
  --frame: rgba(7, 22, 33, 0.7);
  --border: rgba(104, 255, 216, 0.24);
  --glow: rgba(67, 179, 255, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(67, 179, 255, 0.22), transparent 22%),
    radial-gradient(circle at 84% 18%, rgba(104, 255, 216, 0.16), transparent 20%),
    radial-gradient(circle at 50% 82%, rgba(67, 179, 255, 0.12), transparent 28%),
    linear-gradient(160deg, var(--bg-mid) 0%, var(--bg) 46%, var(--bg-deep) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 90%);
  pointer-events: none;
}

.page {
  width: min(1320px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.gallery-shell {
  width: 100%;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid rgba(104, 255, 216, 0.14);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    var(--frame);
  box-shadow:
    0 36px 90px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.gallery-orb {
  position: absolute;
  width: 28rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.34;
  pointer-events: none;
}

.gallery-orb-left {
  top: -11rem;
  left: -10rem;
  background: rgba(67, 179, 255, 0.28);
}

.gallery-orb-right {
  right: -12rem;
  bottom: -14rem;
  background: rgba(104, 255, 216, 0.18);
}

.gallery {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.4vw, 1.2rem);
  position: relative;
  z-index: 1;
}

.tile {
  aspect-ratio: 16 / 9;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  background: rgba(6, 19, 27, 0.78);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  position: relative;
  transform-origin: center;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.24), transparent 34%);
  pointer-events: none;
}

.tile:hover,
.tile:focus-within {
  transform: translateY(-10px) scale(1.01);
  border-color: rgba(104, 255, 216, 0.46);
  box-shadow:
    0 30px 64px rgba(0, 0, 0, 0.42),
    0 0 40px var(--glow);
}

.tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 240ms ease;
}

.tile:hover img,
.tile:focus-within img {
  transform: scale(1.04);
}

.tile-a {
  transform: rotate(-1.8deg);
}

.tile-b {
  transform: translateY(1.6rem);
}

.tile-c {
  transform: rotate(1.8deg);
}

.tile-a:hover,
.tile-b:hover,
.tile-c:hover,
.tile-a:focus-within,
.tile-b:focus-within,
.tile-c:focus-within {
  transform: translateY(-10px) scale(1.01);
}

@media (max-width: 900px) {
  .gallery-shell {
    padding: 1rem;
  }

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

  .tile-a,
  .tile-b,
  .tile-c {
    transform: none;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100vw - 1rem, 100%);
    padding: 0.5rem 0;
  }

  .gallery-shell {
    border-radius: 24px;
    padding: 0.7rem;
  }

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

  .tile {
    border-radius: 20px;
  }
}
