@font-face {
  font-family: "Great Vibes Local";
  src: url("assets/fonts/GreatVibes-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #f4ede3;
  --panel: #fff9f2;
  --panel-strong: rgba(255, 249, 242, 0.9);
  --panel-border: #e7d8c6;
  --text: #433126;
  --muted: #7a6555;
  --accent: #b18863;
  --accent-strong: #8d6747;
  --shadow: 0 18px 40px rgba(104, 80, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(180deg, #f8f1e7 0%, var(--bg) 100%);
}

body {
  padding: 24px;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(360px, 46vw, 500px);
  border-radius: 30px;
  padding: 40px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow);
  background:
    linear-gradient(100deg, rgba(32, 21, 13, 0.42) 0%, rgba(44, 29, 18, 0.24) 32%, rgba(82, 62, 42, 0.08) 72%),
    var(--hero-image, linear-gradient(135deg, #e9d8c3, #cfb292));
  background-position: var(--hero-position-desktop, center 24%);
  background-size: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 241, 231, 0.02), rgba(49, 34, 23, 0.34)),
    linear-gradient(90deg, rgba(31, 19, 11, 0.08), rgba(31, 19, 11, 0.02) 34%, transparent 58%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  color: #fff9f2;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.84;
}

.hero h1,
.section-head h2 {
  margin: 0;
  line-height: 1.04;
}

.hero h1 {
  font-family: "Great Vibes Local", "Great Vibes", "Cormorant Garamond", serif;
  font-size: clamp(3rem, 5.2vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 10px 30px rgba(23, 12, 6, 0.3);
}

.hero-copy {
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 249, 242, 0.92);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.14);
  border: 1px solid rgba(255, 248, 240, 0.24);
  color: #fff8f0;
  font-size: 0.95rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.instagram-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #fff8f0;
  background: rgba(255, 248, 240, 0.18);
  border: 1px solid rgba(255, 248, 240, 0.28);
  box-shadow: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.instagram-button:hover,
.instagram-button:focus-visible {
  transform: translateY(-1px);
  background: rgba(255, 248, 240, 0.28);
  border-color: rgba(255, 248, 240, 0.45);
}

.instagram-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.content {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.folders-panel,
.gallery-panel {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.folders-panel {
  padding: 22px;
  height: fit-content;
  position: sticky;
  top: 24px;
}

.gallery-panel {
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.section-head.compact {
  margin-bottom: 18px;
}

.section-meta {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.folder-list {
  display: grid;
  gap: 14px;
}

.folder-card {
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.folder-card:hover,
.folder-card:focus-visible,
.folder-card.active {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(104, 80, 58, 0.14);
  border-color: rgba(177, 136, 99, 0.55);
}

.folder-preview {
  background: #eadcca;
}

.folder-preview-button {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}

.folder-preview-button:focus-visible .folder-preview {
  outline: 2px solid rgba(177, 136, 99, 0.7);
  outline-offset: -2px;
}

.folder-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.folder-body {
  padding: 16px;
}

.folder-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.folder-title h3,
.lightbox-folder,
.lightbox-counter,
.lightbox-filename {
  margin: 0;
}

.folder-title h3 {
  font-size: 1.05rem;
}

.folder-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.folder-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.folder-open-button {
  all: unset;
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 600;
}

.folder-open-button:hover,
.folder-open-button:focus-visible {
  text-decoration: underline;
}

.folder-link {
  color: var(--accent-strong);
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  color: #fffaf2;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(141, 103, 71, 0.24);
}

.button.secondary {
  color: var(--accent-strong);
  background: rgba(255, 250, 244, 0.82);
  border-color: rgba(177, 136, 99, 0.28);
}

.gallery-panel-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grid-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(177, 136, 99, 0.24);
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.88);
  box-shadow: 0 10px 22px rgba(141, 103, 71, 0.12);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.grid-mode-button:hover,
.grid-mode-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(141, 103, 71, 0.16);
  border-color: rgba(177, 136, 99, 0.42);
}

.grid-mode-icon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 18px;
  height: 18px;
}

.grid-mode-cell {
  border-radius: 3px;
  background: rgba(141, 103, 71, 0.18);
  border: 1px solid rgba(141, 103, 71, 0.26);
  transition:
    opacity 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.grid-mode-button[data-grid-mode="focus"] .grid-mode-cell {
  opacity: 0.3;
}

.grid-mode-button[data-grid-mode="focus"] .grid-mode-cell:nth-child(5) {
  opacity: 1;
  background: var(--accent-strong);
  transform: scale(1.08);
}

.grid-mode-button[data-grid-mode="balanced"] .grid-mode-cell {
  opacity: 0.3;
}

.grid-mode-button[data-grid-mode="balanced"] .grid-mode-cell:nth-child(1),
.grid-mode-button[data-grid-mode="balanced"] .grid-mode-cell:nth-child(2),
.grid-mode-button[data-grid-mode="balanced"] .grid-mode-cell:nth-child(4),
.grid-mode-button[data-grid-mode="balanced"] .grid-mode-cell:nth-child(5) {
  opacity: 1;
  background: var(--accent-strong);
}

.grid-mode-button[data-grid-mode="compact"] .grid-mode-cell {
  opacity: 1;
  background: var(--accent-strong);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-grid[data-grid-mode="focus"] {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.gallery-grid[data-grid-mode="balanced"] {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.gallery-grid[data-grid-mode="compact"] {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.image-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(104, 80, 58, 0.08);
}

.image-trigger {
  all: unset;
  display: block;
  cursor: zoom-in;
}

.image-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #efe2d2;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 16px;
}

.image-label {
  margin: 0;
  color: var(--muted);
}

.gallery-grid[data-grid-mode="compact"] .image-body {
  padding: 12px;
  gap: 10px;
}

.gallery-grid[data-grid-mode="compact"] .image-label {
  font-size: 0.85rem;
}

.gallery-grid[data-grid-mode="compact"] .button.secondary {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 249, 242, 0.56);
  border-radius: 22px;
  border: 1px dashed rgba(177, 136, 99, 0.35);
}

.lightbox {
  width: min(1200px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: none;
  border-radius: 28px;
  background: transparent;
  color: #fff8f0;
}

.lightbox::backdrop {
  background: rgba(35, 24, 16, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-inner {
  position: relative;
  background: rgba(37, 26, 18, 0.92);
  border: 1px solid rgba(242, 221, 196, 0.16);
  border-radius: 28px;
  padding: 24px 24px 22px;
  box-shadow: 0 28px 60px rgba(21, 12, 8, 0.36);
}

.lightbox-figure {
  margin: 10px 0 18px;
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(250, 245, 237, 0.08);
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.lightbox-folder {
  color: rgba(255, 248, 240, 0.72);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lightbox-counter {
  font-size: 1rem;
  font-weight: 600;
}

.lightbox-filename {
  margin-top: 6px;
  color: rgba(255, 248, 240, 0.74);
}

.lightbox-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-button {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #fff9f2;
  background: rgba(255, 249, 242, 0.12);
  backdrop-filter: blur(8px);
  font-size: 1.7rem;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(255, 249, 242, 0.24);
}

.close-button {
  top: 18px;
  right: 18px;
}

.nav-button {
  top: 50%;
  transform: translateY(-50%);
}

.nav-button.prev {
  left: 18px;
}

.nav-button.next {
  right: 18px;
}

@media (max-width: 1024px) {
  .content {
    grid-template-columns: 1fr;
  }

  .folders-panel {
    position: static;
  }

  .folder-list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

  .hero {
    min-height: 380px;
    padding: 26px;
    border-radius: 24px;
    background-position: var(--hero-position-mobile, center 22%);
  }

  .gallery-panel,
  .folders-panel,
  .lightbox-inner {
    padding: 18px;
  }

  .section-head,
  .lightbox-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .folder-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .folder-body {
    padding: 12px;
  }

  .folder-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-panel-actions {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    width: 100%;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .grid-mode-button {
    width: 52px;
    height: auto;
    min-height: 46px;
  }

  .gallery-grid[data-grid-mode="focus"] {
    grid-template-columns: 1fr;
  }

  .gallery-grid[data-grid-mode="balanced"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .gallery-grid[data-grid-mode="compact"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .gallery-grid[data-grid-mode="compact"] .image-body {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .gallery-grid[data-grid-mode="compact"] .image-label {
    font-size: 0.78rem;
  }

  .lightbox {
    width: calc(100vw - 12px);
  }

  .nav-button {
    width: 42px;
    height: 42px;
    top: auto;
    bottom: 92px;
    transform: none;
  }

  .nav-button.prev {
    left: 18px;
  }

  .nav-button.next {
    right: 18px;
  }
}