:root {
  --cream: #fbf7ed;
  --linen: #f2e8d6;
  --sage: #6f8060;
  --sage-dark: #35432e;
  --olive: #536543;
  --rose: #d99a89;
  --terracotta: #a95f43;
  --charcoal: #1f251d;
  --muted: #697163;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(53, 67, 46, 0.16);
  --radius-large: 32px;
  --radius-medium: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--charcoal);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 154, 137, 0.2), transparent 30rem),
    linear-gradient(180deg, var(--cream) 0%, #fffaf1 48%, var(--linen) 100%);
}

body.menu-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

.gallery-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.gallery-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 40px;
  border-right: 1px solid rgba(83, 101, 67, 0.16);
  background: rgba(251, 247, 237, 0.9);
  backdrop-filter: blur(18px);
}

.gallery-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.gallery-brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(83, 101, 67, 0.14);
  box-shadow: 0 6px 18px rgba(53, 67, 46, 0.08);
}

.gallery-brand small {
  display: block;
  color: var(--muted);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.gallery-menu-toggle {
  display: none;
}

.gallery-nav-label {
  margin: 0 0 18px;
  color: var(--terracotta);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-nav ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-link {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.folder-link:hover,
.folder-link:focus-visible,
.folder-link.is-active {
  color: var(--sage-dark);
  background: rgba(111, 128, 96, 0.12);
  transform: translateX(4px);
}

.gallery-sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid rgba(83, 101, 67, 0.16);
}

.gallery-sidebar-footer a {
  color: var(--sage-dark);
  font-weight: 800;
}

.gallery-main {
  min-width: 0;
  padding: 56px clamp(24px, 5vw, 76px);
}

.gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 7vw, 6.4rem);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.gallery-controls {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(83, 101, 67, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 16px 40px rgba(53, 67, 46, 0.08);
}

.control-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--sage-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.control-button.is-active {
  color: var(--white);
  background: var(--sage-dark);
}

.folder-empty {
  max-width: 720px;
  padding: 34px;
  border: 1px dashed rgba(83, 101, 67, 0.32);
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.image-board {
  width: 100%;
}

.image-board[data-layout-mode="masonry"] {
  column-count: 3;
  column-gap: 22px;
}

.image-board[data-layout-mode="grid"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 280px;
  margin: 0 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-large);
  background: rgba(111, 128, 96, 0.18);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  break-inside: avoid;
}

.image-board[data-layout-mode="grid"] .gallery-card {
  aspect-ratio: 4 / 5;
  margin: 0;
}

.gallery-card img,
.gallery-card video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 260ms ease, transform 460ms ease;
}

.gallery-card.is-loaded img,
.gallery-card.is-loaded video {
  opacity: 1;
  transform: scale(1);
}

.gallery-card:hover img,
.gallery-card:hover video {
  transform: scale(1.045);
}

.gallery-card::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(53, 67, 46, 0.66);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.18)),
    rgba(111, 128, 96, 0.14);
  content: "Loading";
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery-card.is-loaded::before {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(31, 37, 29, 0.84);
  backdrop-filter: blur(18px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-frame {
  max-width: min(1100px, 82vw);
  max-height: 88vh;
  margin: 0;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius-large);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

.lightbox-frame figcaption {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 999px;
  color: var(--sage-dark);
  background: rgba(251, 247, 237, 0.9);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.lightbox-close {
  top: 24px;
  right: 24px;
  padding: 12px 18px;
}

.lightbox-nav {
  top: 50%;
  padding: 14px 18px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 980px) {
  .gallery-shell {
    grid-template-columns: 1fr;
  }

  .gallery-sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(83, 101, 67, 0.16);
  }

  .gallery-brand {
    margin-bottom: 0;
  }

  .gallery-brand-logo {
    width: 46px;
    height: 46px;
  }

  .gallery-menu-toggle {
    position: absolute;
    right: 16px;
    top: 19px;
    display: inline-flex;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    color: var(--white);
    background: var(--sage-dark);
    cursor: pointer;
    font-weight: 800;
  }

  .gallery-nav,
  .gallery-sidebar-footer {
    display: none;
  }

  .gallery-sidebar.is-open .gallery-nav,
  .gallery-sidebar.is-open .gallery-sidebar-footer {
    display: block;
    margin-top: 24px;
  }

  .gallery-main {
    padding-top: 42px;
  }

  .gallery-header {
    flex-direction: column;
  }

  .image-board[data-layout-mode="masonry"],
  .image-board[data-layout-mode="grid"] {
    column-count: 2;
    display: block;
  }
}

@media (max-width: 640px) {
  .gallery-main {
    padding: 34px 16px;
  }

  .gallery-controls {
    width: 100%;
  }

  .control-button {
    flex: 1;
  }

  .image-board[data-layout-mode="masonry"],
  .image-board[data-layout-mode="grid"] {
    column-count: 1;
  }

  .lightbox-nav {
    top: auto;
    bottom: 24px;
    transform: none;
  }

  .lightbox-frame {
    max-width: 94vw;
  }
}
