/* ===== Основа ===== */
:root {
  --paper: #fbfaf7;
  --tile: #f2eee7;
  --warm: #f4f0e9;
  --ink: #171513;
  --muted: #6f685e;
  --line: #e4ded3;
  --accent: #9a7b4f;
  --dark: #141210;
  --dark-2: #1d1a17;
  --dark-line: #34302a;
  --dark-muted: #a39b8f;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --section: clamp(80px, 11vw, 160px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--dark-muted); }

.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.eyebrow--light { color: #c4a87c; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 54px; padding: 0 32px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  transition: background .3s var(--ease);
}
.btn:hover { background: var(--accent); }
.btn--small { height: 42px; padding: 0 22px; font-size: 12px; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.link-arrow {
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid currentColor; padding-bottom: 4px;
  transition: color .3s;
}
.link-arrow::after { content: " →"; }
.link-arrow:hover { color: var(--accent); }

/* ===== Шапка ===== */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background .4s var(--ease), border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(251, 250, 247, .88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-color: var(--line);
}
.header__inner { display: flex; align-items: center; gap: 48px; height: 80px; }
.logo { display: flex; flex-direction: column; line-height: 1; margin-right: auto; }
.logo__mark { font: 500 26px/1 var(--serif); letter-spacing: .02em; }
.logo__sub { font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.nav { display: flex; gap: 36px; }
.nav a { font-size: 14px; color: var(--muted); transition: color .25s; position: relative; }
.nav a:hover { color: var(--ink); }
.burger { display: none; width: 40px; height: 40px; position: relative; }
.burger span { position: absolute; left: 9px; right: 9px; height: 1px; background: var(--ink); transition: transform .3s var(--ease); }
.burger span:first-child { top: 16px; }
.burger span:last-child { top: 23px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ===== Плитка для предметных фото: белый фон фото сливается с плиткой ===== */
.tile { background: var(--tile); position: relative; overflow: hidden; }
.tile img {
  width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 1.2s var(--ease);
}
.tile--cover img { object-fit: cover; mix-blend-mode: normal; }

/* ===== Первый экран ===== */
.hero { padding: 150px 0 clamp(60px, 8vw, 110px); }
.hero__grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 6vw, 110px); align-items: center; }
.hero__title {
  font: 400 clamp(44px, 6vw, 88px)/1.02 var(--serif);
  letter-spacing: -.015em;
}
.hero__title em { font-style: italic; color: var(--accent); }
.hero__lead { margin-top: 32px; max-width: 460px; font-size: 17px; color: var(--muted); }
.hero__actions { display: flex; align-items: center; gap: 36px; margin-top: 48px; flex-wrap: wrap; }
.hero__media { margin: 0; }
.tile--hero { aspect-ratio: 4 / 5; }
.tile--hero img { padding: 9%; }
.caption { margin-top: 16px; font-size: 13px; color: var(--muted); letter-spacing: .02em; }

/* ===== Направления ===== */
.section--tight { padding: 0 0 var(--section); }
.disciplines {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.disciplines li + li { border-left: 1px solid var(--line); }
.disciplines a {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 12px 24px; text-align: center; height: 100%;
  transition: background .3s;
}
.disciplines a:hover { background: var(--warm); }
.disciplines img { width: 76px; height: 76px; object-fit: contain; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.disciplines a:hover img { transform: scale(1.08); }
.disciplines span { font: 500 18px/1.2 var(--serif); }
.disciplines small { font-size: 12px; color: var(--muted); }

/* ===== Секции ===== */
.section { padding: var(--section) 0; }
.section--dark { background: var(--dark); color: #ece6dc; }
.section--warm { background: var(--warm); }
.section__head { margin-bottom: clamp(40px, 6vw, 80px); }
.section__head--split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.section__title { font: 400 clamp(36px, 4.4vw, 64px)/1.05 var(--serif); letter-spacing: -.01em; max-width: 760px; }
.section__lead { color: var(--muted); max-width: 440px; justify-self: end; }
.section--dark .section__lead { color: var(--dark-muted); }

/* ===== Избранное ===== */
.featured { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2vw, 28px); }
.card { cursor: zoom-in; }
.card .tile { aspect-ratio: 4 / 5; }
.card .tile img { padding: 10%; }
.card:hover .tile img { transform: scale(1.035); }
.card__meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; align-items: baseline; }
.card__title { font: 500 21px/1.25 var(--serif); }
.card__cat { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.featured .card:nth-child(1) { grid-column: 1 / span 7; }
.featured .card:nth-child(1) .tile { aspect-ratio: 7 / 6; }
.featured .card:nth-child(2) { grid-column: 8 / span 5; align-self: end; }
.featured .card:nth-child(3) { grid-column: 1 / span 4; }
.featured .card:nth-child(4) { grid-column: 5 / span 4; margin-top: 80px; }
.featured .card:nth-child(5) { grid-column: 9 / span 4; }
.featured .card:nth-child(6) { grid-column: 2 / span 5; }
.featured .card:nth-child(7) { grid-column: 7 / span 5; margin-top: 120px; }
.featured .card:nth-child(n+3) { margin-top: clamp(24px, 4vw, 64px); }

/* ===== Техники ===== */
.crafts { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 4vw, 64px) clamp(20px, 2.5vw, 36px); }
.craft__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--dark-2); cursor: zoom-in; }
.craft__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.craft:hover .craft__img img { transform: scale(1.05); }
.craft h3 { font: 400 28px/1.2 var(--serif); margin-top: 24px; color: #f4efe6; }
.craft p { margin-top: 10px; color: var(--dark-muted); font-size: 15px; max-width: 360px; }

/* ===== Фильтры и галерея ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
.filter {
  padding: 0 0 16px; margin-bottom: -1px;
  font-size: 14px; color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.filter sup { font-size: 10px; margin-left: 3px; color: var(--accent); }
.filter:hover { color: var(--ink); }
.filter[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(28px, 3vw, 44px) clamp(14px, 1.6vw, 24px); }
.gallery .card { animation: fadeUp .7s var(--ease) both; }
.gallery .card__title { font-size: 18px; }
.gallery .card__meta { margin-top: 12px; flex-direction: column; gap: 4px; }
.gallery__more { display: flex; justify-content: center; margin-top: 64px; }
.gallery__more .btn[hidden] { display: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ===== Интерьеры ===== */
.interiors { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: clamp(14px, 1.6vw, 24px); }
.interiors .tile { background: #ebe5db; height: clamp(380px, 40vw, 600px); cursor: zoom-in; }
.interiors .tile img { padding: 7%; }
.interiors .tile:hover img { transform: scale(1.035); }

/* ===== Шаги ===== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.step { padding: 36px 32px 0 0; }
.step + .step { padding-left: 32px; border-left: 1px solid var(--line); }
.step__num { font: italic 400 20px/1 var(--serif); color: var(--accent); }
.step h3 { font: 400 28px/1.2 var(--serif); margin: 28px 0 14px; }
.step p { color: var(--muted); font-size: 15px; }

/* ===== Контакты ===== */
.contact { padding: var(--section) 0 0; }
.contact__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(48px, 8vw, 140px); padding-bottom: var(--section); }
.contact__title { font: 400 clamp(40px, 5vw, 76px)/1.02 var(--serif); color: #f4efe6; }
.contact__lead { margin-top: 28px; color: var(--dark-muted); max-width: 440px; }
.contact__list { margin: 0; display: grid; gap: 0; align-content: start; }
.contact__list div { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--dark-line); }
.contact__list div:last-child { border-bottom: 1px solid var(--dark-line); }
.contact__list dt { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--dark-muted); padding-top: 6px; }
.contact__list dd { margin: 0; font: 400 24px/1.35 var(--serif); color: #f4efe6; }
.contact__list dd .muted { font: 400 14px/1.6 var(--sans); }
.contact__list a { transition: color .25s; }
.contact__list a:hover { color: #c4a87c; }
.footer { display: flex; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--dark-line); font-size: 13px; color: var(--dark-muted); }
.footer a:hover { color: #f4efe6; }

/* ===== Лайтбокс ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: #f8f6f2;
  display: grid; grid-template-columns: 80px 1fr 80px; align-items: center;
  animation: lbIn .35s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
/* колонки заданы явно: если стрелки скрыты, фото не должно съезжать в крайнюю колонку */
.lightbox__nav--prev { grid-column: 1; grid-row: 1; }
.lightbox__nav--next { grid-column: 3; grid-row: 1; }
.lightbox__figure { grid-column: 2; grid-row: 1; margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 0 24px; min-width: 0; }
.lightbox__img { height: auto; max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; mix-blend-mode: multiply; }
.lightbox__caption { margin-top: 24px; display: flex; gap: 24px; align-items: baseline; font: 400 22px/1.3 var(--serif); text-align: center; }
.lightbox__count { font: 400 12px/1 var(--sans); letter-spacing: .14em; color: var(--muted); }
.lightbox__close { position: absolute; top: 18px; right: 24px; font: 300 40px/1 var(--sans); width: 48px; height: 48px; color: var(--muted); }
.lightbox__nav { height: 100%; font: 200 56px/1 var(--sans); color: var(--muted); transition: color .2s; }
.lightbox__close:hover, .lightbox__nav:hover { color: var(--ink); }

/* ===== Появление при прокрутке ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .gallery .card, .lightbox { animation: none; }
  .tile img, .craft__img img, .disciplines img { transition: none; }
}

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
  .disciplines { grid-template-columns: repeat(4, 1fr); }
  .disciplines li { border-bottom: 1px solid var(--line); }
  .disciplines li:nth-child(4n+1) { border-left: 0; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(n+3) { margin-top: 32px; border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .header__inner { height: 68px; gap: 16px; }
  .header__cta { display: none; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: 68px 0 auto; height: calc(100dvh - 68px);
    background: var(--paper);
    flex-direction: column; gap: 0; padding: 24px var(--pad);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .nav.is-open { opacity: 1; visibility: visible; }
  .nav a { font: 400 36px/1.2 var(--serif); color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--line); }
  .header.menu-open { background: var(--paper); border-color: var(--line); }

  .hero { padding-top: 110px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
  .tile--hero { aspect-ratio: 1 / 1; }

  .section__head--split { grid-template-columns: 1fr; gap: 20px; }
  .section__lead { justify-self: start; }

  .featured { grid-template-columns: 1fr 1fr; }
  .featured .card:nth-child(n) { grid-column: auto; margin-top: 0; align-self: start; }
  .featured .card:nth-child(1) { grid-column: 1 / -1; }

  .crafts { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .interiors { grid-template-columns: 1fr 1fr; }
  .interiors .tile { height: 56vw; }
  .interiors .tile:first-child { grid-column: 1 / -1; height: 80vw; }

  .contact__grid { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .lightbox__figure { padding: 64px 16px 96px; }
  .lightbox__img { max-height: calc(100dvh - 260px); }
  /* на телефоне стрелки - небольшие кнопки внизу, листать можно и свайпом */
  .lightbox__nav {
    position: fixed; bottom: 20px; width: 56px; height: 56px;
    font-size: 40px; border: 1px solid var(--line); border-radius: 50%;
    background: var(--paper); display: flex; align-items: center; justify-content: center;
    padding-bottom: 4px;
  }
  .lightbox__nav--prev { left: calc(50% - 72px); }
  .lightbox__nav--next { left: calc(50% + 16px); }
}

@media (max-width: 560px) {
  .disciplines { grid-template-columns: repeat(2, 1fr); }
  .disciplines li:nth-child(n) { border-left: 0; }
  .disciplines li:nth-child(2n) { border-left: 1px solid var(--line); }
  .crafts { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(n) { padding-left: 0; border-left: 0; }
  .step + .step { margin-top: 32px; border-top: 1px solid var(--line); }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); padding: 0 var(--pad); }
  .filters::-webkit-scrollbar { display: none; }
  .filter { white-space: nowrap; }
  .card__meta { flex-direction: column; gap: 4px; }
  .contact__list div { grid-template-columns: 1fr; gap: 6px; }
  .lightbox__caption { flex-direction: column; gap: 8px; font-size: 19px; }
}
