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

body {
  background: #0e0e0e;
  color: #ccc;
  font-family: "Saira", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  font-variation-settings:
          "wdth" 100;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.colorful {
  font-family: "Fredericka the Great", serif;
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.04em;
  background: linear-gradient(
    90deg,
    #f9b8c4, #f7cba8, #f9efb0, #b8f0d0,
    #a8d8f7, #c0b8f9, #f4b8f0, #f9b8c4
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
  user-select: none;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

.normal {
  font-family: "Fredericka the Great", serif;
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.04em;
  color: #ccc;
}

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

nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #aaa;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 28px;
  cursor: default;
  transition: border-color 0.2s, color 0.2s;
}

nav a:hover {
  border-color: #555;
  color: #eee;
}

@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
  }

  nav a {
    text-align: center;
  }
}

#gallery {
  display: none;
  position: fixed;
  inset: 0;
  background: #0e0e0e;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
}

#gallery.open {
  display: flex;
}

#gallery-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: #555;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  margin-bottom: 36px;
  transition: color 0.2s;
}

#gallery-back:hover {
  color: #ccc;
}

#gallery-title {
  font-size: 1.6rem;
  font-weight: 300;
  font-style: italic;
  color: #777;
  margin-bottom: 32px;
  letter-spacing: 0.06em;
}

#gallery-grid, #projects-grid {
  display: grid;
  gap: 10px;
  width: 100%;
}

#gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  max-width: 1000px;
}

#projects-grid {
  margin: 0 auto;
  grid-template-columns: 1fr;
  max-width: 400px;
  width: 100%;
  padding: 0 16px;
}

.album-card, .project-card {
  background: #161616;
  border: 1px solid #222;
  cursor: default;
  overflow: hidden;
  display: flex;
  transition: border-color 0.2s;
}

.album-card {
  flex-direction: column;
}

.project-card {
  flex-direction: row;
  align-items: center;
}

.album-card:hover {
  border-color: #444;
}

.album-thumb, .project-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #111;
}

.album-thumb {
  width: 100%;
}

.project-thumb {
  margin-left: 8px;
  width: 90px;
  min-width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.album-no-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2a2a;
  font-size: 2.5rem;
}

.album-label, .project-label {
  color: white;
  padding: 10px 12px;
  letter-spacing: 0.1em;
}

.album-label {
  font-size: 0.75rem;
  text-transform: uppercase;
}

.project-label {
  font-size: 1rem;
}

.photo-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}
.photo-item:hover img {
  opacity: 0.75;
}

#msg {
  color: #333;
  font-style: italic;
  font-size: 1rem;
  margin-top: 24px;
}

#photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(14,14,14,0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#photo-viewer.open {
  display: flex;
}

.pv-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.pv-close,
.pv-prev,
.pv-next {
  position: absolute;
  background: none;
  border: none;
  color: #aaa;
  font-size: 6rem;
  cursor: pointer;
}

.pv-close { top: 20px; right: 30px; }
.pv-prev { left: 30px; }
.pv-next { right: 30px; }

.pv-download {
  position: absolute;
  bottom: 20px;
  color: #aaa;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.album-desc {
  padding: 0 12px 12px 12px;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
}

.album-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px 12px;
}

.action-btn {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #aaa;
  text-decoration: none;
  padding: 6px 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.action-btn:hover {
  border-color: #555;
  color: #eee;
}
