:root {
  --bg-main: #f5f1e7;
  --bg-accent: rgba(187, 122, 50, 0.2);
  --bg-accent-dark: rgba(45, 58, 47, 0.14);
  --text-main: #1f211b;
  --card-border: rgba(45, 58, 47, 0.2);
  --card-bg: rgba(252, 249, 241, 0.88);
}

* {
  box-sizing: border-box;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
.header-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem 1.4rem; }
.header-nav a { color: #2d3a2f; text-decoration: none; font-size: .85rem; }
.header-nav a:hover, .back-link:hover { text-decoration: underline; }
.home-hero { max-width: 1240px; margin: 2rem auto 3rem; padding: 0 1.25rem; display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: 3rem; }
.section-kicker { color: #86613b; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; margin: 0 0 1rem; }
.hero-copy h1 { font-family: Georgia, serif; font-size: clamp(2.5rem, 4.5vw, 4.2rem); font-weight: 400; line-height: 1.08; letter-spacing: -.045em; color: #2d3a2f; margin: 0 0 1.5rem; }
.hero-copy h1 em { font-weight: 400; color: #94724c; }
.hero-copy > p:not(.section-kicker) { max-width: 420px; font-size: .95rem; line-height: 1.8; color: #686154; }
.collection-cta { display: inline-flex; gap: 2rem; padding: .85rem 0; margin-top: 1rem; color: #2d3a2f; border-bottom: 1px solid #94724c; text-decoration: none; font-size: .9rem; }
.hero-image { position: relative; display: block; color: white; overflow: hidden; }
.hero-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-image span { position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem 1rem 1rem; background: linear-gradient(transparent, #0009); font-size: .72rem; letter-spacing: .04em; }
.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.collection-heading h2, .collection-page h1 { font-family: Georgia, serif; font-weight: 400; color: #2d3a2f; font-size: clamp(2rem, 3vw, 3rem); margin: 0; }
.collection-heading > p { max-width: 270px; color: #686154; font-size: .8rem; line-height: 1.6; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 1.2rem; }
.collection-card { text-decoration: none; color: #2d3a2f; min-width: 0; }
.collection-cover { overflow: hidden; background: #ece3d2; }
.collection-cover img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.collection-card:hover img { transform: scale(1.035); }
.collection-card-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .8rem; }
.collection-card h3 { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 400; margin: 0; }
.collection-card > p { margin: .4rem 0 0; color: #807665; font-size: .75rem; }
.projects-section { margin-top: 3rem; border-top: 1px solid #94724c55; padding-top: 2.5rem; }
.collection-page { padding-top: 2rem; padding-bottom: 3rem; }
.back-link { display: inline-block; color: #686154; font-size: .85rem; text-decoration: none; margin-bottom: 2.5rem; }
.collection-intro { max-width: 650px; color: #686154; line-height: 1.7; margin: 1rem 0 2rem; }
.photo-modal[hidden] { display: none; }
@media (max-width: 900px) {
  .home-hero { gap: 1.5rem; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .home-hero { grid-template-columns: 1fr; margin-top: 2rem; }
  .hero-image img { aspect-ratio: 4 / 3; }
  .collection-heading { display: block; }
  .collection-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .collection-cover img { transition: none; }
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, var(--bg-accent), transparent 34%),
    radial-gradient(circle at 86% 6%, var(--bg-accent-dark), transparent 30%),
    var(--bg-main);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(245, 241, 231, 0.86);
  border-bottom: 1px solid rgba(45, 58, 47, 0.12);
}

.header-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: #2d3a2f;
  text-decoration: none;
  max-width: 100%;
  font-size: clamp(1.05rem, 2.7vw, 1.45rem);
  overflow-wrap: break-word;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-note {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
  color: #6a5536;
}

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

.gallery-block {
  display: grid;
  gap: 0.8rem;
}

.gallery-block-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a3d29;
}

.gallery-divider {
  height: 4px;
  margin: 1.25rem 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(126, 92, 49, 0.7), transparent);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-item {
  margin: 0;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 12px 22px rgba(29, 31, 24, 0.09);
}

.gallery-open {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.gallery-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #000;
}

.gallery-item figcaption {
  padding: 0.75rem 0.85rem 0.9rem;
  font-size: 0.92rem;
  color: #3f3f38;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
}

.modal-close-btn {
  position: fixed;
  top: 0.85rem;
  right: 1.1rem;
  z-index: 2;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.8rem;
  line-height: 1;
  cursor: pointer;
}

.photo-modal-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 4rem 1rem 4.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-image {
  max-width: 96vw;
  max-height: calc(100vh - 8.4rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.modal-caption {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0.7rem;
  z-index: 2;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.85rem;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.48);
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
}

body.modal-open {
  overflow: hidden;
}

.admin-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem;
}

.admin-container {
  display: grid;
  gap: 1rem;
}

.admin-card {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: rgba(252, 249, 241, 0.92);
  padding: 1rem;
  box-shadow: 0 10px 18px rgba(29, 31, 24, 0.08);
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-form,
.upload-form,
.caption-form {
  display: grid;
  gap: 0.75rem;
}

.admin-form label,
.upload-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-form input,
.upload-form input,
.upload-form select,
.caption-form input {
  border: 1px solid rgba(45, 58, 47, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.admin-array-group {
  display: grid;
  gap: 0.75rem;
}

.admin-array-group h2 {
  margin: 0;
  font-size: 1rem;
  color: #4a3d29;
}

.admin-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.admin-photo-card {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: rgba(252, 249, 241, 0.92);
  padding: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.admin-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.admin-preview-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}

.admin-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #4d4b40;
}

.btn-primary,
.btn-ghost,
.btn-danger {
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  border: 1px solid #8c5f2b;
  background: #ad7537;
  color: #fff;
}

.btn-ghost {
  border: 1px solid rgba(45, 58, 47, 0.25);
  background: #fff;
  color: #2d3a2f;
}

.btn-danger {
  border: 1px solid #9b2d2d;
  background: #b53737;
  color: #fff;
}

.btn-small {
  padding: 0.4rem 0.6rem;
  font-size: 0.86rem;
}

.admin-status {
  margin: 0.6rem 0;
  color: #205f2a;
  font-weight: 700;
}

.admin-error {
  margin: 0.6rem 0;
  color: #8b1c1c;
  font-weight: 700;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .admin-gallery {
    grid-template-columns: 1fr;
  }

  .photo-modal-stage {
    padding: 3.8rem 0.5rem 3.7rem;
  }

  .modal-close-btn {
    top: 0.45rem;
    right: 0.75rem;
    font-size: 2.35rem;
  }
}

.portfolio-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1rem 2rem; margin-top: 3rem; padding-top: 1.5rem; padding-bottom: 2rem; border-top: 1px solid var(--card-border); }
.portfolio-link { display: inline-flex; gap: 1rem; align-items: center; color: var(--text-main); font-size: .85rem; text-decoration: none; padding: .6rem 0; border-bottom: 1px solid #94724c; }
.portfolio-link:hover { color: #86613b; }
@media (max-width: 560px) {
  html { scroll-padding-top: 130px; }
  .header-nav, .portfolio-links { justify-content: flex-start; }
}
