:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #6f716f;
  --line: #d8d5ce;
  --accent: #cc6b32;
  --accent-dark: #9e4d22;
  --dark: #242624;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(24, 24, 22, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.container { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(243, 241, 236, .88);
  border-bottom: 1px solid rgba(216, 213, 206, .75);
}
.header-inner {
  min-height: 124px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .08em; }
.brand-image img { display:block; height: 108px; width: auto; }
.nav { display: flex; gap: 10px; align-items: center; color: #3c3d3c; font-weight: 650; }
.nav a {
  padding: 9px 13px;
  border-radius: 12px;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.nav a:hover {
  color: var(--accent-dark);
  background: rgba(204,107,50,.07);
}
.nav a.active {
  color: var(--accent-dark);
  background: rgba(204,107,50,.13);
  box-shadow: inset 0 0 0 1px rgba(204,107,50,.16);
}
.page-content-top { padding-top: 34px; }

.hero { padding: 74px 0 54px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 36px;
  align-items: stretch;
}
.hero-copy, .hero-art {
  border-radius: 32px;
  overflow: hidden;
  min-height: 510px;
}
.hero-copy {
  background: var(--dark);
  color: white;
  padding: clamp(36px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; color: #d7b29c; }
h1 { font-size: clamp(46px, 7vw, 88px); line-height: .95; margin: 18px 0 22px; letter-spacing: -.045em; }
.hero-copy p { max-width: 610px; color: #d6d7d5; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 800; cursor: pointer;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-light { border-color: #5f625e; color: white; }
.btn-light:hover { background: rgba(255,255,255,.08); }
.hero-art {
  background: linear-gradient(160deg, #ebe6de, #d8d1c6);
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px;
}
.hero-art::before, .hero-art::after { content: none; }
.hero-mark { width: min(100%, 420px); height: auto; filter: drop-shadow(0 18px 30px rgba(36,38,36,.12)); }

.section { padding: 5px 0; }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 26px; }
.section-head h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.035em; }
.section-head p { margin: 0; color: var(--muted); max-width: 520px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid #e6e2da; transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card:focus-visible { outline: 3px solid rgba(204,107,50,.28); outline-offset: 2px; }
.product-media {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(180deg, #f3eee6, #e7e0d5);
}
.product-image { width: 100%; height: 100%; object-fit: contain; background: transparent; }
.product-body { padding: 18px; }
.product-category { color: var(--accent-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.product-name { font-size: 20px; margin: 6px 0 8px; line-height: 1.2; }
.product-details {
  color: #4f514f;
  font-size: 14px;
  line-height: 1.55;
  margin-top: 10px;
}
#catalog-grid.cards { grid-template-columns: repeat(3, 1fr); }
.catalog-note {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid #e0dbd2;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  color: var(--muted);
  font-size: 14px;
}
.catalog-note strong { color: var(--ink); }

.works-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 18px; }
.work { overflow: hidden; border-radius: 24px; min-height: 280px; background: #d4d0c7; }
.work:first-child { grid-row: span 2; min-height: 578px; }
.work img { width: 100%; height: 100%; object-fit: cover; }

.contact-panel {
  background: var(--accent); color: white; border-radius: 30px; padding: clamp(34px, 6vw, 62px);
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: end;
}
.contact-panel h2 { margin: 0 0 12px; font-size: clamp(36px, 5vw, 62px); letter-spacing: -.04em; }
.contact-links { display: grid; gap: 10px; }
.contact-links a { padding: 15px 18px; border-radius: 16px; background: rgba(255,255,255,.12); font-weight: 750; }
.contact-links a:hover { background: rgba(255,255,255,.2); }

.catalog-hero { padding: 5px 0 0px; }
.catalog-hero h1 { color: var(--ink); font-size: clamp(48px, 7vw, 80px); margin-bottom: 12px; }
.catalog-hero p { color: var(--muted); max-width: 700px; }

.catalog-tools {
  display: grid; gap: 10px;
  padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.66); border: 1px solid #e2ddd5;
  margin-bottom: 10px;
}
.catalog-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; height: 52px; border-radius: 16px; border: 1px solid var(--line);
  background: white; padding: 0 18px 0 46px; outline: none;
}
.search-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(204,107,50,.14); }
.search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #777; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  border: 1px solid var(--line); background: white; border-radius: 999px; padding: 8px 13px;
  cursor: pointer; font-weight: 750;
}
.filter-btn.active { background: var(--dark); color: white; border-color: var(--dark); }
.results-meta {
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  font-size: 14px;
}
.empty { padding: 50px 20px; text-align: center; background: white; border-radius: 22px; color: var(--muted); }

.footer { padding: 34px 0 44px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding-top: 24px; }
.footer-brand img { height: 62px; width: auto; display: block; }

@media (max-width: 950px) {
  .hero-grid, .contact-panel { grid-template-columns: 1fr; }
  .hero-art { min-height: 360px; }
  .cards, #catalog-grid.cards { grid-template-columns: repeat(2, 1fr); }
  .works-grid { grid-template-columns: 1fr 1fr; }
  .work:first-child { grid-column: span 2; grid-row: auto; min-height: 420px; }
}
@media (max-width: 680px) {
  .header-inner { min-height: 98px; }
  .brand-image img { height: 76px; }
  .nav { gap: 6px; font-size: 14px; }
  .hero { padding-top: 28px; }
  .hero-copy, .hero-art { min-height: auto; }
  .hero-copy { padding: 38px 26px; }
  .hero-art { min-height: 300px; }
  .cards, #catalog-grid.cards, .works-grid { grid-template-columns: 1fr; }
  .work:first-child { grid-column: auto; min-height: 320px; }
  .work { min-height: 260px; }
  .section { padding: 42px 0; }
  .section-head { align-items: start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
}


body.modal-open { overflow: hidden; }
.product-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
}
.product-modal.is-open { display: block; }
.product-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(23, 23, 23, .55);
  backdrop-filter: blur(4px);
}
.product-modal__dialog {
  position: relative;
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 20px auto;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.24);
}
.product-modal__close {
  position: sticky; top: 12px; margin-left: auto; margin-right: 12px; margin-top: 12px;
  width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(23,23,23,.08);
  font-size: 28px; line-height: 1; cursor: pointer; z-index: 2; display: grid; place-items: center;
}
.product-modal__grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 28px;
  padding: 8px 28px 28px; align-items: start;
}
.product-modal__media {
  min-height: 420px; border-radius: 24px; background: linear-gradient(180deg, #f3eee6, #e7e0d5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.product-modal__image { width: 100%; max-height: 70vh; object-fit: contain; }
.product-modal__category { color: var(--accent-dark); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; margin-top: 10px; }
.product-modal__title { margin: 10px 0 14px; font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -.03em; }
.product-modal__details { color: #444; line-height: 1.7; font-size: 16px; }

@media (max-width: 950px) {
  .product-modal__grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .product-media { padding: 12px; }
  .product-modal__dialog { width: min(100% - 16px, 1000px); margin: 8px auto; max-height: calc(100vh - 16px); }
  .product-modal__grid { padding: 6px 16px 20px; gap: 16px; }
  .product-modal__media { min-height: 260px; padding: 16px; }
  .product-modal__details { font-size: 15px; }
}

/* Gallery */
.gallery-section { padding-top: 20px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.gallery-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #e6e2da;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f3eee6, #e7e0d5);
  padding: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery-card:focus-visible { outline: 3px solid rgba(204,107,50,.28); outline-offset: 2px; }
.gallery-thumb-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}
.gallery-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(23,23,23,.72);
  color: white;
  font-size: 22px;
  padding-left: 3px;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  pointer-events: none;
}
.gallery-preview-item { position: relative; display: block; }
.gallery-preview-item img,
.gallery-preview-item video { width: 100%; height: 100%; object-fit: contain; background: #e7e0d5; }

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}
.gallery-modal.is-open { display: block; }
.gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12,12,12,.86);
  backdrop-filter: blur(7px);
}
.gallery-modal__dialog {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 28px 76px;
}
.gallery-modal__stage {
  width: min(1400px, 100%);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-modal__media {
  max-width: 100%;
  max-height: calc(100vh - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0,0,0,.34);
}
.gallery-modal__close,
.gallery-modal__nav {
  position: absolute;
  z-index: 2;
  border: 0;
  color: white;
  background: rgba(255,255,255,.13);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.gallery-modal__close {
  right: 22px;
  top: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}
.gallery-modal__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  border-radius: 18px;
  font-size: 44px;
  line-height: 1;
}
.gallery-modal__prev { left: 16px; }
.gallery-modal__next { right: 16px; }
.gallery-modal__close:hover,
.gallery-modal__nav:hover { background: rgba(255,255,255,.22); }

@media (max-width: 950px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .header-inner {
    min-height: auto;
    padding: 10px 0 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .brand-image img { height: 70px; }
  .nav {
    width: 100%;
    gap: 16px;
    font-size: 14px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 3px;
  }
}
@media (max-width: 680px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-card { padding: 10px; }
  .gallery-modal__dialog { padding: 70px 12px 20px; }
  .gallery-modal__close { right: 12px; top: 12px; }
  .gallery-modal__nav { width: 44px; height: 58px; font-size: 36px; background: rgba(0,0,0,.35); }
  .gallery-modal__prev { left: 8px; }
  .gallery-modal__next { right: 8px; }
  .gallery-modal__media { max-height: calc(100vh - 90px); }
}

/* Home page compact layout */
.home-hero { padding: 42px 0 28px; }
.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.42fr);
  gap: 20px;
  align-items: stretch;
}
.hero-copy--compact {
  min-height: 360px;
  padding: clamp(30px, 4vw, 46px);
  border-radius: 28px;
}
.hero-copy--compact h1 {
  font-size: clamp(40px, 5vw, 64px);
  margin: 14px 0 16px;
}
.hero-copy--compact p {
  font-size: 16px;
  margin: 0;
}
.hero-copy--compact .hero-actions { margin-top: 22px; }

.featured-panel {
  background: rgba(255,255,255,.72);
  border: 1px solid #e2ddd5;
  border-radius: 28px;
  padding: 16px;
  min-width: 0;
}
.featured-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 12px;
}
.featured-panel__head h2 {
  margin: 0;
  font-size: clamp(24px, 2.7vw, 34px);
  letter-spacing: -.03em;
}
.featured-panel__head a { font-weight: 750; color: var(--accent-dark); white-space: nowrap; }
.featured-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.featured-products .product-card { border-radius: 18px; }
.featured-products .product-media { aspect-ratio: 16 / 10; padding: 10px; }
.featured-products .product-body { padding: 11px 12px 12px; }
.featured-products .product-category { display: none; }
.featured-products .product-name {
  font-size: 16px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.featured-products .product-details { display: none; }

/* Shape-aware home gallery collage */
.works-grid--smart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(6, 58px);
  gap: 12px;
  grid-auto-flow: dense;
}
.works-grid--smart .gallery-preview-item {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 0;
  padding: 0;
  background: #ddd7cd;
  cursor: pointer;
  box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.works-grid--smart .gallery-preview-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.works-grid--smart .gallery-preview-item img,
.works-grid--smart .gallery-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-slot--tall { grid-column: 1; grid-row: 1 / span 6; }
.preview-slot--wide-a { grid-column: 2; grid-row: 1 / span 3; }
.preview-slot--wide-b { grid-column: 2; grid-row: 4 / span 3; }
.preview-slot--small-a { grid-column: 3; grid-row: 1 / span 2; }
.preview-slot--small-b { grid-column: 3; grid-row: 3 / span 2; }
.preview-slot--small-c { grid-column: 3; grid-row: 5 / span 2; }

.section--contacts { padding-top: 32px; padding-bottom: 44px; }
.contact-panel--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  border-radius: 24px;
}
.contact-panel--compact h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  margin: 2px 0 0;
}
.contact-panel--compact .contact-links { min-width: 0; }
.contact-panel--compact .contact-links a {
  padding: 13px 18px;
  white-space: nowrap;
}

@media (max-width: 950px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .hero-copy--compact { min-height: auto; }
  .featured-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .works-grid--smart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(9, 56px);
  }
  .preview-slot--tall { grid-column: 1; grid-row: 1 / span 6; }
  .preview-slot--wide-a { grid-column: 2; grid-row: 1 / span 3; }
  .preview-slot--wide-b { grid-column: 2; grid-row: 4 / span 3; }
  .preview-slot--small-a { grid-column: 1; grid-row: 7 / span 3; }
  .preview-slot--small-b { grid-column: 2; grid-row: 7 / span 3; }
  .preview-slot--small-c { display: none; }
}

@media (max-width: 680px) {
  .home-hero { padding-top: 22px; }
  .hero-copy--compact { padding: 30px 24px; }
  .featured-panel { padding: 12px; }
  .featured-panel__head { align-items: center; }
  .featured-panel__head a { font-size: 14px; }
  .featured-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .featured-products .product-media { aspect-ratio: 4 / 3; }
  .featured-products .product-name { font-size: 14px; }
  .works-grid--smart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(8, 52px);
    gap: 10px;
  }
  .preview-slot--tall { grid-column: 1; grid-row: 1 / span 5; }
  .preview-slot--wide-a { grid-column: 2; grid-row: 1 / span 2; }
  .preview-slot--wide-b { grid-column: 2; grid-row: 3 / span 3; }
  .preview-slot--small-a { grid-column: 1; grid-row: 6 / span 3; }
  .preview-slot--small-b { grid-column: 2; grid-row: 6 / span 3; }
  .preview-slot--small-c { display: none; }
  .contact-panel--compact {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px;
  }
  .contact-panel--compact .contact-links a { white-space: normal; text-align: center; }
}

@media (max-width: 680px) {
  .nav a { padding: 7px 9px; border-radius: 10px; }
  .page-content-top { padding-top: 24px; }
}

@media (max-width: 680px) {
  .catalog-tools { padding: 10px; gap: 8px; margin-bottom: 8px; }
  .catalog-search-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .results-meta { font-size: 12px; }
  .search-wrap input { height: 48px; }
  .catalog-note { margin-bottom: 10px; padding: 11px 13px; }
}


/* Contacts page and soft page navigation */
#contacts { scroll-margin-top: 150px; }
html.is-navigating main { opacity: .55; }
main { transition: opacity .12s ease; }
.contacts-page { min-height: min(520px, calc(100vh - 260px)); display: flex; align-items: center; }
.contacts-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 28px;
  background: var(--dark);
  color: white;
}
.contacts-title {
  margin: 7px 0 8px;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: -.035em;
}
.contacts-copy { margin: 0; color: #d6d7d5; }
.contacts-phone {
  display: grid;
  gap: 3px;
  min-width: 285px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--accent);
  color: white;
}
.contacts-phone span { font-size: 18px; opacity: .82; }
.contacts-phone strong { font-size: 20px; }
.contacts-phone:hover { background: var(--accent-dark); }
@media (max-width: 680px) {
  #contacts { scroll-margin-top: 120px; }
  .contacts-page { min-height: 360px; }
  .contacts-card { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
  .contacts-phone { min-width: 0; width: 100%; }
}

/* Reliable local contact scrolling */
.section--contacts { scroll-margin-top: 150px; }
@media (max-width: 680px) {
  .section--contacts { scroll-margin-top: 120px; }
}
