/* Modern image gallery styles */
:root {
  --bg: #0f1724;
  --panel: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.06);
  --muted: #a8b3c1;
  --accent-1: #7c3aed;
  --accent-2: #38bdf8;
  --text: #e6eef6;
  --radius: 12px;
  --gap: 18px;
}

:root.light {
  --bg: linear-gradient(180deg, #f6f8fb, #e9eef6);
  --panel: rgba(255, 255, 255, 0.7);
  --glass: rgba(255, 255, 255, 0.6);
  --muted: #4b5563;
  --text: #0b1220;
}

* {
  box-sizing: border-box
}

.site-root,
html,
body {
  height: 100%;
  min-height: 100vh;
}

body {
  margin: 0;
  font-family: Inter, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 20px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto
}

.brand {
  display: flex;
  flex-direction: column
}

.site-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.6px
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px
}

.search-wrap {
  background: var(--panel);
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center
}

#search {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  color: var(--text);
  min-width: 220px
}

select {
  padding: 8px;
  border-radius: 10px;
  border: 0;
  background: var(--panel);
  color: var(--text)
}

.icon-btn {
  background: var(--panel);
  border-radius: 10px;
  border: 0;
  padding: 8px 10px;
  cursor: pointer
}

.filter-bar {
  overflow: hidden;
  padding: 12px 0
}

.filters {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding: 6px 12px
}

.filter {
  white-space: nowrap;
  border: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 220ms ease;
  box-shadow: none
}

.filter.active {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-1));
  color: #042027;
  font-weight: 700;
  transform: translateY(-4px)
}

.main {
  /* max-width: 1200px; */
  margin: 28px auto;
  padding: 0 20px
}

.gallery {
  /* display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap) */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-direction: row;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 32px rgba(2, 6, 23, 0.4);
  transform: translateY(0);
  transition: transform .36s ease, opacity .36s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 300px;
  margin: 10px;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 24, 36, 0.01) 0%, rgba(20, 24, 36, 0.10) 55%, rgba(20, 24, 36, 0.5) 100%);
}

.card img {
  display: block;
  width: 300px;
  height: 300px;
  top:50%;
  left:50%;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform .5s ease, opacity .6s ease;
  opacity: 0;
  transform: scale(1.04)
}

.card .meta {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: var(--text);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 2
}

.card .meta h4 {
  margin: 0;
  font-size: 16px
}

.card .meta p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted)
}

.card.show {
  opacity: 1;
  transform: translateY(0)
}

.card.hide {
  opacity: 0;
  transform: scale(.98);
  pointer-events: none
}

.card:hover img {
  transform: scale(1.12)
}

/* Per-card inline slider (used for grouped project preview) */
.card .card-slides {
  position: relative;
  width: 300px;
  height: 300px;
  overflow: hidden;
  border-radius: var(--radius)
}

.card .card-slide {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity .45s ease, transform .45s ease;
  opacity: 0;
  transform: scale(1.02)
}

.card .card-slide.show {
  opacity: 1;
  transform: none
}

.card .card-slide img {
  width: 100%;
  height: 100%;
  position: relative;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  object-fit: cover;
  border-radius: var(--radius);
  display: block
}

@media (max-width:420px) {
  .card .card-slides {
    height: 260px
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 60
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto
}

.lb-content {
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center
}

.lb-content img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.6)
}

.lb-content .slide {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center
}

.lb-content .slide img {
  width: 100%;
  height: auto;
  border-radius: 10px
}

.lb-caption {
  margin-top: 12px;
  color: var(--text);
  text-align: center
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: var(--panel);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer
}

.lb-prev {
  left: 28px
}

.lb-next {
  right: 28px
}

.lb-close {
  position: fixed;
  right: 22px;
  top: 22px;
  background: var(--panel);
  border-radius: 8px;
  border: 0;
  padding: 8px 10px;
  cursor: pointer
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 80
}

.spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--accent-2);
  animation: spin 1s linear infinite
}

.preloader-text {
  margin-top: 14px;
  color: var(--muted)
}

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

/* Scroll to top */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: var(--panel);
  cursor: pointer;
  display: none
}

.to-top.show {
  display: block
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 0;
  background: linear-gradient(90deg, #181c2a 0%, #232946 100%);
  color: #e6eef6;
  box-shadow: 0 -2px 24px rgba(2, 6, 23, 0.12);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.18);
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #7c3aed, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-copyright {
  margin: 0;
  font-size: 1.08rem;
  color: #b6c2d6;
  letter-spacing: 0.2px;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 60%, #38bdf8 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.10);
  transition: transform 0.18s, box-shadow 0.18s;
  font-size: 1.2rem;
}

.footer-social:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.18);
}

@media (max-width: 600px) {
  .footer-inner {
    padding: 28px 8px 18px 8px;
  }

  .footer-title {
    font-size: 1.1rem;
  }

  .footer-copyright {
    font-size: 0.98rem;
  }

  .footer-social {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

/* Responsive */
@media (max-width:1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr)
  }
}

@media (max-width:760px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start
  }

  #search {
    min-width: 140px
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:420px) {
  .gallery {
    grid-template-columns: repeat(1, 1fr)
  }

  .card img {
    height: 260px
  }

  .filters {
    padding: 8px;
    gap: 8px
  }

  .filter {
    padding: 8px 10px
  }
}

/* small entrance animations */
.site-title,
.tagline {
  transform: translateY(6px);
  opacity: 0;
  animation: fadeUp .6s ease forwards
}

.filter {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp .4s ease forwards
}

.filter:nth-child(1) {
  animation-delay: .18s
}

.filter:nth-child(2) {
  animation-delay: .22s
}

.filter:nth-child(3) {
  animation-delay: .26s
}

.filter:nth-child(4) {
  animation-delay: .30s
}

.filter:nth-child(5) {
  animation-delay: .34s
}

.filter:nth-child(6) {
  animation-delay: .38s
}

.filter:nth-child(7) {
  animation-delay: .42s
}

.filter:nth-child(8) {
  animation-delay: .46s
}

@keyframes fadeUp {
  to {
    transform: none;
    opacity: 1
  }
}

/* utility */
.hidden {
  display: none
}