:root {
  --bg: #0b1220;
  --surface: #0f172a;
  --surface-2: #111827;
  --card: #0b1220;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #22d3ee;
  --ring: #22d3ee40;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Noto Sans Bengali", "Inter", ui-sans-serif, system-ui,
    -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue",
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  /* Stable background without seams/clipping */
  background-color: var(--bg);
  background-image: radial-gradient(
      ellipse 60% 35% at 15% 0%,
      rgba(34, 211, 238, 0.18) 0%,
      rgba(34, 211, 238, 0) 60%
    ),
    radial-gradient(
      ellipse 45% 35% at 85% 10%,
      rgba(109, 40, 217, 0.22) 0%,
      rgba(109, 40, 217, 0) 62%
    ),
    linear-gradient(180deg, #0b1220 0%, #04060c 100%);
  background-repeat: no-repeat;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: min(1080px, 100%);
  margin-inline: auto;
  padding: 24px 20px;
}

.site-header {
  position: relative;
  padding: 56px 0 28px;
  background: linear-gradient(
    180deg,
    rgba(34, 211, 238, 0.12),
    rgba(34, 211, 238, 0) 60%
  );
  border-bottom: 1px solid #1f2937;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.header-main {
  flex: 1;
  min-width: 300px;
}

.site-title {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #e6fbff;
}

.site-tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 2.2vw, 16px);
  max-width: 600px;
}

.total-count {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.15) 0%,
    rgba(109, 40, 217, 0.12) 100%
  );
  padding: 1.5rem 2rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  min-width: 180px;
  backdrop-filter: blur(10px);
}

.count-label {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.count-number {
  color: var(--primary);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}

main.container {
  padding-top: 12px;
  counter-reset: card-counter;
}

/* Card */
.card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0)
  );
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 20px;
  margin: 18px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  counter-increment: card-counter;
}

.card__title {
  margin: 0 0 8px;
  font-size: clamp(20px, 3.5vw, 24px);
  line-height: 1.25;
}
.card__title::before {
  content: counter(card-counter, decimal-leading-zero) ". ";
  color: var(--primary);
  font-weight: 700;
}

.card__text {
  margin: 0 0 14px;
  color: #cbd5e1;
}

.reference-link {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 4px;
}

.reference-link:hover,
.reference-link:focus {
  color: #fff;
  background: rgba(34, 211, 238, 0.2);
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

.reference-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.gallery a {
  position: relative;
  display: block;
  background: #0b1624;
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.gallery a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 60%,
    rgba(0, 0, 0, 0.3)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery a:hover img,
.gallery a:focus img {
  transform: scale(1.06);
}
.gallery a:hover::after,
.gallery a:focus::after {
  opacity: 1;
}

.gallery a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #1f2937;
  margin-top: 14px;
}
.site-footer p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 4px;
  border-radius: 4px;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
  background: rgba(34, 211, 238, 0.2);
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

.site-footer a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.lightbox.open {
  display: flex;
}

.lightbox__figure {
  margin: 0;
  text-align: center;
  max-width: 96vw;
}
.lightbox__image {
  max-width: 92vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.lightbox__caption {
  color: #e5e7eb;
  margin-top: 10px;
  font-size: 14px;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  appearance: none;
  border: none;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.6);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(17, 24, 39, 0.9);
}
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.lightbox__close {
  top: 22px;
  right: 22px;
  font-size: 28px;
}
.lightbox__prev,
.lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__prev {
  left: 16px;
}
.lightbox__next {
  right: 16px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-main {
    min-width: unset;
  }

  .total-count {
    font-size: 2rem;
    padding: 1rem 1.5rem;
    min-width: 140px;
  }
}

@media (min-width: 600px) {
  .card {
    padding: 22px;
  }
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
  }
}
@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
