*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #fdfcfb;
  --bg-header: rgba(253, 252, 251, 0.92);
  --text: #2a2a2a;
  --text-muted: rgba(0, 0, 0, 0.45);
  --border: rgba(0, 0, 0, 0.06);
  --card-bg: #fff;
  --card-shadow: rgba(0, 0, 0, 0.04);
  --spinner-bg: rgba(0, 0, 0, 0.1);
  --spinner-fg: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-header: rgba(18, 18, 18, 0.92);
  --text: #e8e8e8;
  --text-muted: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.08);
  --card-bg: #1e1e1e;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --spinner-bg: rgba(255, 255, 255, 0.1);
  --spinner-fg: rgba(255, 255, 255, 0.5);
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  gap: 32px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav-link.is-active {
  border-color: var(--text);
}

.nav-link-cta {
  border: 1px solid var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, color 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--text-muted);
  transform: scale(1.05);
}

.theme-icon-dark {
  display: none;
}

[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: inline;
  color: #fff;
}

.page {
  padding: 60px 0 80px;
}

.intro {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.7);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.gallery figure {
  margin: 0;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--card-shadow);
  transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
  .gallery figure {
    border-radius: 16px;
  }
}

.gallery img {
  width: 100%;
  height: auto;
  object-fit: cover;
  cursor: zoom-in;
  background: linear-gradient(110deg, var(--card-bg) 8%, var(--border) 18%, var(--card-bg) 33%);
  background-size: 200% 100%;
  animation: skeleton 1.5s linear infinite;
}

.gallery img[src] {
  animation: none;
  background: none;
}

@keyframes skeleton {
  to {
    background-position-x: -200%;
  }
}

.gallery figure:hover {
  transform: translateY(-4px);
}

.gallery-status {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.gallery-status.is-loading::after {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid var(--spinner-bg);
  border-top-color: var(--spinner-fg);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.gallery-status.is-error {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
  padding: 24px;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 18px;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

@media (min-width: 768px) {
  .lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 24px;
    width: 40px;
    height: 40px;
  }
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 10;
}

.lightbox-nav:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

@media (min-width: 768px) {
  .lightbox-nav {
    font-size: 36px;
    width: 50px;
    height: 50px;
  }
  
  .lightbox-prev {
    left: 24px;
  }
  
  .lightbox-next {
    right: 24px;
  }
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  transition: border-color 0.3s ease;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

  .nav {
    gap: 12px;
  }
}
