:root {
  --cream: #f5efe4;
  --cream-deep: #ece2d0;
  --ink: #2a2620;
  --ink-soft: #5c564c;
  --emerald: #0b6e4f;
  --emerald-deep: #084d38;
  --sand-light: #e7dfcd;
  --white: #ffffff;
  --shadow: 0 18px 40px -20px rgba(42, 38, 32, 0.35);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-display);
  color: var(--emerald-deep);
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--emerald);
  color: var(--white);
  padding: 0.8em 1.2em;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  background: linear-gradient(180deg, rgba(247, 242, 232, 0.92) 0%, rgba(245, 239, 228, 0.92) 100%);
  padding: 3.5rem 1.5rem 2.25rem;
  overflow: hidden;
  border-bottom: 1px solid var(--cream-deep);
}

.bg-particles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

.header-branch {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(90px, 14vw, 210px);
  height: 100%;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, black 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, black 55%, transparent 100%);
}
.header-branch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.logo {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tagline {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.divider {
  color: var(--emerald);
  margin: 1.4rem 0;
  font-size: 1.1rem;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.nav-pill {
  border: 1px solid var(--cream-deep);
  background: var(--white);
  color: var(--ink);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  min-height: 44px;
}

.nav-pill:hover { border-color: var(--emerald); }

.nav-pill.is-active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--white);
}

/* ---------- Catalog ---------- */

.catalog {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.catalog-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.catalog-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.catalog-title {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.catalog-count {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.product-grid-scroll {
  max-height: min(640px, 70vh);
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-right: -0.5rem;
}

.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem;
  opacity: 1;
  transition: opacity 0.15s ease-out;
}

.product-grid.is-fading {
  opacity: 0;
}

.product-card {
  flex: 1 1 calc(33.333% - 1.6rem);
  min-width: 240px;
  max-width: 340px;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--cream-deep);
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }

.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, var(--sand-light), var(--cream-deep));
}
.product-placeholder svg {
  width: 34%;
  height: 34%;
  fill: none;
  stroke: var(--emerald);
  stroke-width: 1.1;
  opacity: 0.75;
}

.product-body {
  padding: 1.1rem 1.3rem 1.4rem;
}

.product-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: center;
}

/* ---------- Works (masonry gallery) ---------- */

.works {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.works-head {
  margin-bottom: 1.6rem;
}

.works-title {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.works-sub {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.masonry {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.4rem;
}

.masonry-item {
  flex: 1 1 calc(33.333% - 1.4rem);
  min-width: 240px;
  max-width: 340px;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(48px) scale(0.97);
  filter: blur(8px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.masonry-item.is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

.masonry-photo {
  overflow: hidden;
}

.masonry-photo img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.masonry-item:hover .masonry-photo img,
.masonry-item:focus-within .masonry-photo img {
  transform: scale(1.06);
}

.masonry-item figcaption {
  padding: 0.8rem 1rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Contact ---------- */

.contact {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

.contact-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

.contact-info, .contact-map {
  display: flex;
  flex-direction: column;
}

.contact-info h2, .contact-map h2 {
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1.3rem;
}

.info-list {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.info-list svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: var(--emerald);
  margin-top: 0.1rem;
}

.info-list a { text-decoration: none; }
.info-list a:hover { color: var(--emerald); }

.socials {
  display: flex;
  gap: 0.7rem;
}

.socials a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.socials a:hover { background: var(--emerald-deep); }
.socials svg { width: 20px; height: 20px; fill: var(--white); }

.map {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  min-height: 260px;
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; }

.contact-form-wrap {
  padding-top: 2.5rem;
  border-top: 1px solid var(--cream-deep);
  max-width: 640px;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 17, 12, 0.92);
  z-index: 1000;
  padding: 3.5rem 1.5rem;
}

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

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.24);
}
.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
  width: 55%;
  height: 55%;
}

.lightbox-close {
  top: 1.2rem;
  right: 1.2rem;
  width: 44px;
  height: 44px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev[hidden],
.lightbox-next[hidden] {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--emerald-deep);
  color: var(--cream);
  text-align: center;
  padding: 1.4rem 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

/* ---------- Responsive ---------- */

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

@media (max-width: 520px) {
  .site-header { padding: 2.6rem 1rem 1.8rem; }
  .nav-pill { padding: 0.65rem 1.05rem; font-size: 0.72rem; }
  .catalog-panel, .contact-panel { padding: 1.4rem; }
  .catalog, .contact, .works { padding-left: 1.1rem; padding-right: 1.1rem; }
  .masonry { gap: 0.8rem; }
  .masonry-item {
    flex-basis: calc(50% - 0.4rem);
    min-width: 120px;
    max-width: calc(50% - 0.4rem);
  }

  .product-grid { gap: 0.8rem; }
  .product-card {
    flex-basis: calc(50% - 0.4rem);
    min-width: 120px;
    max-width: calc(50% - 0.4rem);
  }
  .product-body { padding: 0.7rem 0.8rem 0.9rem; }
  .product-name { font-size: 0.85rem; }
}
