:root {
  --blue: #4f86f7;
  --blue-700: #2a5ad5;
  --blue-100: #e9f0ff;
  --bg: #f7f9ff;
  --text: #0f172a;
  --muted: #64748b;
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(79, 134, 247, 0.2);
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.12);
  --radius: 18px;
  --speed: 240ms;
}

body.dark {
  --bg: #0b1221;
  --text: #e6ebf5;
  --muted: #9aa7bd;
  --card: rgba(16, 24, 44, 0.62);
  --border: rgba(79, 134, 247, 0.3);
  --shadow: 0 24px 70px rgba(4, 10, 25, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 20% 20%, #ffffff 0%, var(--bg) 45%)
      fixed,
    linear-gradient(135deg, #f0f6ff 0%, #ffffff 60%) fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body.dark {
  background: radial-gradient(circle at 20% 20%, #132341 0%, var(--bg) 45%)
      fixed,
    linear-gradient(140deg, #0b1221 0%, #101a30 70%) fixed;
}

.bg-orb {
  position: fixed;
  width: 40vmax;
  height: 40vmax;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

.orb-a {
  top: -10vmax;
  left: -6vmax;
  background: radial-gradient(circle, rgba(79, 134, 247, 0.8), transparent 70%);
}

.orb-b {
  bottom: -12vmax;
  right: -8vmax;
  background: radial-gradient(circle, rgba(94, 224, 255, 0.7), transparent 70%);
}

.hero {
  padding: 48px 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.logo {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--speed) ease, box-shadow var(--speed) ease;
}

.toggle:active {
  transform: scale(0.98);
}

.toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px rgba(79, 134, 247, 0.8);
}

.hero-content h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--blue-700);
}

.subtitle {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.gallery {
  column-count: 3;
  column-gap: 18px;
}

@media (max-width: 960px) {
  .gallery {
    column-count: 2;
  }
}

@media (max-width: 640px) {
  .gallery {
    column-count: 1;
  }

  .toolbar {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}

.card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  opacity: 0;
  animation: fadeUp 600ms ease forwards;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 20%,
    rgba(79, 134, 247, 0.3),
    transparent 55%
  );
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.card:hover::after {
  opacity: 1;
}

.card img {
  width: 100%;
  display: block;
  height: auto;
  transition: transform 400ms ease;
}

.card:hover img {
  transform: scale(1.04);
}

.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(
    180deg,
    rgba(12, 18, 32, 0) 30%,
    rgba(12, 18, 32, 0.62) 100%
  );
  color: #ffffff;
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-action {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: grid;
  place-items: center;
  background: rgba(79, 134, 247, 0.4);
  box-shadow: 0 0 14px rgba(79, 134, 247, 0.6);
}

.loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px auto 0;
  color: var(--muted);
}

.loader.active {
  display: flex;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--blue-100);
  border-top-color: var(--blue);
  animation: spin 1s linear infinite;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 12, 24, 0.85);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--speed) ease;
  z-index: 50;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  margin-top: 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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