:root {
  --bg: #f6f0e3;
  --bg-elevated: #fffcf5;
  --bg-glass: rgba(246, 240, 227, 0.72);
  --text: #362f27;
  --text-muted: #8b7d68;
  --border: #e6dbc2;

  --terracotta: #ddab88;
  --terracotta-deep: #b1663f;
  --olive: #cdd39c;
  --olive-deep: #707c3f;
  --sand: #ecd7a6;
  --sand-deep: #b6883c;

  --accent: var(--olive-deep);
  --accent-soft: rgba(112, 124, 63, 0.14);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(ellipse 700px 420px at 8% -6%, rgba(221, 171, 136, 0.45), transparent 60%),
    radial-gradient(ellipse 700px 420px at 96% 8%, rgba(205, 211, 156, 0.4), transparent 60%),
    radial-gradient(ellipse 900px 520px at 50% 40%, rgba(236, 215, 166, 0.3), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 4.25rem;
}

a {
  color: inherit;
}

::selection {
  background: var(--terracotta);
  color: var(--text);
}

/* Progress bar */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--terracotta-deep), var(--olive-deep), var(--sand-deep));
  z-index: 200;
  transition: width 0.1s linear;
}

/* Hero */

.hero {
  text-align: center;
  padding: 3rem 1.5rem 2.25rem;
}

.hero__eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero__title {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.01em;
  color: var(--text);
}

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

.hero__tagline {
  max-width: 32rem;
  margin: 0.6rem auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero__gear {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.hero__albums {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hero__albums[hidden] {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--olive);
}

.filter-chip.is-active {
  background: var(--olive-deep);
  border-color: var(--olive-deep);
  color: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.hero__gear .pill:nth-child(1) {
  background: rgba(221, 171, 136, 0.3);
  border-color: rgba(177, 102, 63, 0.35);
  color: var(--text);
}

.hero__gear .pill:nth-child(2) {
  background: rgba(221, 171, 136, 0.3);
  border-color: rgba(177, 102, 63, 0.35);
  color: var(--text);
}

/* Gallery */

.gallery-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

.gallery-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.sort-toggle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.1rem;
  transition: color 0.2s var(--ease);
}

.sort-toggle:hover {
  color: var(--text);
}

.gallery-groups {
  display: flex;
  flex-direction: column;
}

.date-group {
  display: block;
  width: 100%;
  margin-bottom: 2.25rem;
}

.date-group:last-child {
  margin-bottom: 0;
}

.date-group__heading {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 8px;
  gap: 0.9rem;
}

.gallery__item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-color: var(--bg-elevated);
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(50, 44, 56, 0.08);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), box-shadow 0.35s var(--ease);
}

.gallery__item.in-view {
  opacity: 1;
  transform: translateY(0);
}

.gallery__item:hover {
  box-shadow: 0 18px 34px rgba(112, 124, 63, 0.2);
}

.gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.5s ease;
  opacity: 0;
}

.gallery__item img.loaded {
  opacity: 1;
}

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

.gallery__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.85rem 0.75rem;
  background: linear-gradient(to top, rgba(38, 30, 40, 0.82), transparent);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}

.gallery__item:hover .gallery__overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery__rating-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(38, 30, 40, 0.72);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  pointer-events: none;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

.empty-state[hidden] {
  display: none;
}

.loading-grid {
  columns: 1;
  column-gap: 0.9rem;
}

@media (min-width: 600px) { .loading-grid { columns: 2; } }
@media (min-width: 900px) { .loading-grid { columns: 3; } }
@media (min-width: 1300px) { .loading-grid { columns: 4; } }

.loading-grid[hidden] {
  display: none;
}

.loading-grid__item {
  break-inside: avoid;
  margin-bottom: 0.9rem;
  height: 260px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #ece0c8 30%, #faf5e9 50%, #ece0c8 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.loading-grid__item:nth-child(2) { height: 340px; animation-delay: 0.1s; }
.loading-grid__item:nth-child(3) { height: 200px; animation-delay: 0.2s; }
.loading-grid__item:nth-child(4) { height: 300px; animation-delay: 0.3s; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

/* About */

.about {
  max-width: 700px;
  margin: 1rem auto 5rem;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.about h2 {
  color: var(--text);
  font-weight: 600;
  font-size: 1.2rem;
}

.about strong {
  color: var(--text);
  font-weight: 600;
}

/* Footer */

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.65rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.social a[aria-label="instagram"]:hover {
  color: var(--terracotta-deep);
  background: rgba(221, 171, 136, 0.35);
  border-color: var(--terracotta);
}

.social a[aria-label="tiktok"]:hover {
  color: var(--olive-deep);
  background: rgba(205, 211, 156, 0.4);
  border-color: var(--olive);
}

.social a[aria-label="flickr"]:hover {
  color: var(--sand-deep);
  background: rgba(236, 215, 166, 0.45);
  border-color: var(--sand);
}

.social a:hover {
  transform: translateY(-3px);
}

.social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.footer-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 4.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 80;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.25s var(--ease);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.back-to-top[hidden] {
  display: none;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(40, 33, 43, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightbox-in 0.35s var(--ease);
}

@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lightbox__figure img {
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  filter: blur(0);
  transition: filter 0.25s ease;
  touch-action: none;
  transform-origin: center center;
  cursor: zoom-in;
}

.lightbox__figure img.is-loading {
  filter: blur(14px);
}

.lightbox__meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.lightbox__meta .pill {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f2eef5;
}

.rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.1rem;
}

.rating__stars {
  display: flex;
  gap: 0.2rem;
}

.rating__star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem;
  font-size: 1.6rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.15s var(--ease), transform 0.15s var(--ease);
}

.rating__star:hover,
.rating__star:focus-visible {
  transform: scale(1.15);
}

.rating__star.is-filled {
  color: var(--sand-deep);
}

.rating__summary {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.rating__views {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(205, 211, 156, 0.25);
  border-color: var(--olive);
}

.lightbox__close {
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  font-size: 1rem;
}

.lightbox__counter {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f2eef5;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
}

.lightbox__nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

@media (max-width: 600px) {
  .lightbox { padding: 0.5rem; }
  .lightbox__nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .lightbox__nav--prev { left: 0.35rem; }
  .lightbox__nav--next { right: 0.35rem; }
  .hero { padding: 2.25rem 1.25rem 1.75rem; }
}
