@charset "UTF-8";

/* hidden attribute должен реально скрывать (некоторые селекторы перебивают дефолт) */
[hidden] { display: none !important; }

:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --muted: #8a8a85;
  --line: #1a1a1a;
  --hairline: #e7e5dd;
  --serif: 'Tenor Sans', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;  /* резервирует место под scrollbar — страница не дёргается при появлении/исчезновении */
}
/* При открытом lightbox блокируем скролл фона — но только пока он открыт */
html.lightbox-open { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* === Header === */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(6px);
}
.logo {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.45em;
}
.nav { display: flex; gap: 40px; }
.nav a {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
  transition: opacity 0.2s ease;
}
.nav a:hover { opacity: 0.55; }

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 9vw, 128px);
  letter-spacing: 0.32em;
  margin-right: -0.32em; /* compensate trailing letter-spacing */
  line-height: 1;
}
.hero-sub {
  margin-top: 36px;
  font-size: 10px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--muted);
}

/* === Category nav над галереей (ссылки на отдельные страницы) === */
.cat-nav {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 36px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 100px 40px 24px;
}
.cat-link {
  display: inline-block;
  padding: 6px 2px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.25s ease, border-color 0.25s ease;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.cat-link:hover { opacity: 1; }
.cat-link.cat-active {
  opacity: 1;
  border-bottom-color: var(--fg);
  pointer-events: none;
}
.cat-count {
  font-size: 9px;
  letter-spacing: 0.2em;
  margin-left: 10px;
  opacity: 0.5;
}

/* Series sub-navigation — появляется на категорийной странице */
.series-nav {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 22px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 6px 40px 18px;
}
.series-link {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.42;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.series-link:hover { opacity: 1; }
.series-link.series-active {
  opacity: 1;
  border-bottom-color: var(--fg);
}
.series-count {
  font-size: 8px;
  letter-spacing: 0.18em;
  margin-left: 6px;
  opacity: 0.55;
}

@media (max-width: 700px) {
  /* Горизонтальный scroll вместо переноса — длинные названия серий не вылезают за край */
  .series-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
    padding: 4px 16px 12px;
    /* Лёгкий fade с краёв чтобы было видно что прокручивается */
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
  .series-nav::-webkit-scrollbar { display: none; }
  .series-link {
    font-size: 9px;
    letter-spacing: 0.18em;
    flex-shrink: 0;
  }
}

/* Заголовок категорийной страницы */
.page-title {
  text-align: center;
  padding: 140px 24px 0;
}
.page-title h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-right: -0.28em;
}
.page-title-sub {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-title + #portfolio .cat-nav { padding-top: 48px; }

@media (max-width: 700px) {
  .cat-nav { gap: 18px; padding: 60px 16px 12px; }
  .cat-link { font-size: 10px; letter-spacing: 0.24em; }
  .page-title { padding-top: 100px; }
}

/* === Gallery (masonry в стиле ariannacattarin.com) === */
/* Авто-число колонок по ширине окна — через CSS variable.
   Пользователь может переопределить через переключатель (col-switch),
   тогда --gallery-cols-user перебивает auto. */
:root { --gallery-cols-auto: 3; }
@media (max-width: 699px)  { :root { --gallery-cols-auto: 1; } }
@media (min-width: 700px) and (max-width: 999px) { :root { --gallery-cols-auto: 2; } }
@media (min-width: 1700px) { :root { --gallery-cols-auto: 4; } }
@media (min-width: 2200px) { :root { --gallery-cols-auto: 5; } }
@media (min-width: 2800px) { :root { --gallery-cols-auto: 6; } }
@media (min-width: 3400px) { :root { --gallery-cols-auto: 7; } }

.gallery {
  /* Адаптивный masonry на всю ширину viewport, без max-width. */
  column-count: var(--gallery-cols-user, var(--gallery-cols-auto));
  column-gap: 40px;
  padding: 24px 48px 160px;
}

/* Переключатель числа колонок — справа над галереей. Виден всегда (на мобильном — варианты 1/2, на десктопе 2-5) */
.col-switch {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0 48px 0 auto;
  padding: 8px 0 24px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--fg);
  justify-content: flex-end;
}
/* На десктопе скрыта кнопка "1" (там слишком много места — 1 колонка не нужна) */
@media (min-width: 1000px) {
  .col-switch-btn[data-cols="1"] { display: none; }
}
/* На мобильном/планшете показываются только 1 и 2 — 3/4/5 не помещаются */
@media (max-width: 999px) {
  .col-switch-btn[data-cols="3"],
  .col-switch-btn[data-cols="4"],
  .col-switch-btn[data-cols="5"] { display: none; }
  .col-switch {
    margin: 0 auto;
    justify-content: center;
    padding: 28px 16px 20px;
  }
}
.col-switch-label {
  margin-right: 14px;
  opacity: 0.5;
}
.col-switch-btn {
  background: none;
  border: none;
  padding: 2px 8px;
  font: inherit;
  cursor: pointer;
  color: inherit;
  opacity: 0.42;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}
.col-switch-btn:hover { opacity: 1; }
.col-switch-btn.col-active {
  opacity: 1;
  border-bottom-color: var(--fg);
}
.g {
  break-inside: avoid;
  margin: 0 0 80px;
  display: block;
}
.g a {
  display: block;
  overflow: hidden;
  color: inherit;
}
/* Skeleton placeholder: soft shimmer + caption "a few moments..." */
.g {
  position: relative;
  background: linear-gradient(110deg,
              #ededea 18%,
              #f6f5f1 40%,
              #ededea 62%);
  background-size: 220% 100%;
  animation: g-shimmer 2.8s ease-in-out infinite;
}
@keyframes g-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -120% 0; }
}
.g::before {
  content: 'a few moments...';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  text-align: center;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.38);
  pointer-events: none;
  transition: opacity 0.5s ease;
  /* gentle slow pulsing of caption */
  animation: g-caption 2.8s ease-in-out infinite;
}
@keyframes g-caption {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.85; }
}

.g img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* Когда img загружен — JS навешивает класс .loaded → подпись и переливание уходят, фото появляется */
.g.loaded {
  background: none;
  animation: none;
}
.g.loaded::before {
  opacity: 0;
  animation: none;
}
.g.loaded img { opacity: 1; }

.g a:hover img { opacity: 0.85; }
.g figcaption {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--fg);
  text-align: center;
}

/* Разные пропорции — задаются прямо на img через aspect-ratio.
   В masonry column-layout разные высоты создают «рассыпанный» ритм. */
.r-45 img { aspect-ratio: 4 / 5; }   /* портрет «классический» */
.r-34 img { aspect-ratio: 3 / 4; }   /* портрет вертикальный */
.r-23 img { aspect-ratio: 2 / 3; }   /* портрет узкий */
.r-11 img { aspect-ratio: 1 / 1; }   /* квадрат */
.r-43 img { aspect-ratio: 4 / 3; }   /* горизонталь */

/* === Section headers === */
.about h2,
.services h2,
.contact h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

/* === About === */
.about {
  padding: 140px 48px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  align-items: center;
}
.about-text p {
  margin-bottom: 22px;
  max-width: 460px;
  font-weight: 300;
}
.about-photo img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* === Services === */
.services {
  padding: 140px 48px;
  max-width: 1400px;
  margin: 0 auto;
}
.services h2 { text-align: center; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 80px;
  margin-top: 24px;
}
.service h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.service-lead {
  margin-bottom: 32px;
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
}
.service ul {
  list-style: none;
  margin-bottom: 28px;
}
.service ul li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.service ul.simple li {
  justify-content: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.service-rate {
  margin-top: 32px;
  font-family: var(--serif);
  letter-spacing: 0.2em;
  font-size: 13px;
  text-transform: uppercase;
}

/* === Contact / Newsletter === */
.contact {
  padding: 140px 48px 160px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.contact > p {
  margin-bottom: 40px;
  color: var(--muted);
  font-style: italic;
  font-weight: 300;
}
.newsletter {
  display: flex;
  border: 1px solid var(--line);
  margin-bottom: 48px;
}
.newsletter input {
  flex: 1;
  padding: 18px 20px;
  background: transparent;
  border: none;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg);
  outline: none;
}
.newsletter input::placeholder { color: var(--muted); letter-spacing: 0.25em; }
.newsletter button {
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  padding: 0 28px;
  cursor: pointer;
  font-size: 18px;
  color: var(--fg);
  transition: background 0.2s ease;
}
.newsletter button:hover { background: var(--fg); color: var(--bg); }
.contact-info a {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 3px;
}
.hero-socials {
  justify-content: center;
  margin-top: 48px;
  gap: 22px;
}
.hero-socials svg { width: 22px; height: 22px; stroke-width: 1.5; }
.hero-socials a { width: 30px; height: 30px; color: var(--fg); opacity: 0.55; }
.hero-socials a:hover { opacity: 1; }

.contact-socials {
  justify-content: center;
  margin-top: 28px;
  gap: 18px;
}
.contact-socials svg { width: 20px; height: 20px; }
.contact-socials a { width: 28px; height: 28px; color: var(--fg); opacity: 0.65; }
.contact-socials a:hover { opacity: 1; }
.newsletter-status {
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-style: italic;
}
.newsletter-consent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 24px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
}
.newsletter-consent input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--fg);
  flex-shrink: 0;
}
.newsletter-consent a {
  border-bottom: 1px solid currentColor;
  color: var(--fg);
}
.footer-legal {
  display: flex;
  gap: 22px;
}
.footer-legal a {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.footer-legal a:hover { color: var(--fg); }

/* Made by ergart with love — в центре footer-строки между copyright и legal-ссылками */
.footer-credit {
  flex: 1;
  text-align: center;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.ergart-link {
  position: relative;
  color: var(--fg);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.2s ease;
}
.ergart-link:hover { color: var(--fg); }

/* Летящие сердца — частицы появляются вокруг ergart-link при наведении */
.heart-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 14px;
  line-height: 1;
  color: #1a1a1a;
  user-select: none;
  will-change: transform, opacity;
}

/* Cookie consent banner */
.cookie-consent {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(26, 26, 26, 0.96);
  color: #fafaf8;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  z-index: 200;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cookie-slide-up 0.4s ease;
}
@keyframes cookie-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cookie-consent p { flex: 1; margin: 0; }
.cookie-consent a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  color: inherit;
}
.cookie-accept {
  background: transparent;
  color: #fafaf8;
  border: 1px solid #fafaf8;
  padding: 8px 18px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.cookie-accept:hover { background: #fafaf8; color: #1a1a1a; }

/* Newsletter popup при заходе */
.newsletter-popup {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: nl-popup-fade 0.4s ease;
}
@keyframes nl-popup-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.newsletter-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.newsletter-popup-box {
  position: relative;
  background: var(--bg);
  max-width: 460px;
  width: 100%;
  padding: 56px 40px 40px;
  text-align: center;
  animation: nl-popup-slide 0.45s ease;
}
@keyframes nl-popup-slide {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.newsletter-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 6px 10px;
  transition: color 0.2s ease;
}
.newsletter-popup-close:hover { color: var(--fg); }
.newsletter-popup-box h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.newsletter-popup-sub {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 28px;
  font-style: italic;
  font-weight: 300;
}

@media (max-width: 600px) {
  .newsletter-popup-box { padding: 48px 22px 28px; }
  .newsletter-popup-box h2 { font-size: 13px; letter-spacing: 0.36em; }
  .newsletter-popup-sub { font-size: 11px; }
}

@media (max-width: 600px) {
  .cookie-consent {
    flex-direction: column;
    align-items: stretch;
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 14px 16px;
    text-align: center;
    gap: 12px;
  }
  .cookie-accept { width: 100%; }
}

/* Невалидный checkbox после попытки submit */
.newsletter-consent.invalid {
  color: #c63a3a;
}
/* Load more кнопка — только на мобильном (контролируется JS) */
.load-more-btn {
  display: block;
  margin: 28px auto 80px;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--fg);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.load-more-btn:hover { background: var(--fg); color: var(--bg); }

.newsletter-consent.invalid input[type="checkbox"] {
  accent-color: #c63a3a;
  outline: 1px solid #c63a3a;
  outline-offset: 2px;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 18, 18, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lb-fade 0.25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-image {
  max-width: calc(100vw - 160px);
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  display: block;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: transparent;
  border: none;
  color: #f5f5f0;
  cursor: pointer;
  font-family: var(--serif);
  line-height: 1;
  padding: 12px 16px;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }

.lb-close {
  top: 18px;
  right: 24px;
  font-size: 32px;
  font-weight: 300;
}

.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
  font-weight: 300;
  padding: 0 24px;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: #f5f5f0;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  opacity: 0.65;
  pointer-events: none;
}

/* Сдвинуть курсор-указатель на превью галереи — намекает на клик */
.gallery .g a { cursor: zoom-in; }

@media (max-width: 700px) {
  .lb-image { max-width: calc(100vw - 80px); }
  .lb-prev, .lb-next { font-size: 40px; padding: 0 12px; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
}

/* === Footer === */
.site-footer {
  /* Grid 1fr auto 1fr — credit точно по центру viewport, не зависит от ширины соседей */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 28px 48px;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--hairline);
}
.site-footer > span { justify-self: start; }
.site-footer > .footer-credit { justify-self: center; }
.site-footer > nav.footer-legal { justify-self: end; }

.footer-socials {
  display: flex;
  gap: 14px;
  align-items: center;
}
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.15s ease;
}
.footer-socials a:hover {
  color: var(--fg);
  transform: translateY(-1px);
}
.footer-socials svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .gallery { column-gap: 40px; padding: 60px 40px 120px; }
}

@media (max-width: 900px) {
  .site-header { padding: 16px 20px; }
  .nav { gap: 18px; }
  .nav a { font-size: 9px; letter-spacing: 0.22em; }
  .logo { font-size: 11px; letter-spacing: 0.35em; }
}
@media (max-width: 700px) {
  /* На мобильном — две строки: логотип сверху по центру, меню под ним */
  .site-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 10px;
  }
  .logo { font-size: 11px; letter-spacing: 0.42em; }
  .nav {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav a {
    font-size: 8.5px;
    letter-spacing: 0.2em;
  }
}
@media (max-width: 900px) {

  .hero-sub { font-size: 9px; }

  /* column-count управляется через --gallery-cols-auto/-user, не override-им жёстко */
  .gallery {
    column-gap: 24px;
    padding: 60px 16px 100px;
  }
  .g { margin-bottom: 40px; }

  .about {
    grid-template-columns: 1fr;
    padding: 80px 24px;
    gap: 40px;
  }
  .services { padding: 80px 24px; }
  .services-grid { grid-template-columns: 1fr; gap: 56px; }
  .contact { padding: 80px 24px; }
}
@media (max-width: 700px) {
  /* Подвал — обе строки помещаются на узком экране без переноса слов */
  .site-footer {
    /* На мобиле — flex с column, перебиваем grid из десктопа */
    display: flex;
    padding: 28px 14px 22px;
    flex-direction: column;
    gap: 14px;
    text-align: center;
    align-items: center;
    font-size: 9px;
    letter-spacing: 0.24em;
  }
  .site-footer > span { white-space: nowrap; }
  .footer-legal {
    gap: 18px;
    order: 2;
  }
  .footer-legal a { font-size: 9px; letter-spacing: 0.28em; }
  .footer-socials {
    order: 1;
    justify-content: center;
    gap: 18px;
  }
  /* «Made by ergart» — последний элемент на мобильном, отделён тонкой линией от доков */
  .footer-credit {
    order: 3;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
    font-size: 8.5px;
    letter-spacing: 0.22em;
  }
}


/* ===========================================================
   Studies page — учебные кейсы и сертификации
   ===========================================================*/

.studies-intro {
  max-width: 880px;
  margin: 0 auto;
  padding: 140px 32px 80px;
  text-align: center;
}
.studies-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.studies-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.studies-lede {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
  max-width: 640px;
  margin: 0 auto;
  letter-spacing: 0.01em;
}

.studies-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 32px;
}

/* Шапка секции — нумерация + крупный заголовок + горизонтальная черта.
   Выровнена по левому краю в одну линию с заголовками проектов внутри. */
.studies-section-header {
  max-width: 1100px;
  margin: 0 auto 64px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--fg);
  display: flex;
  align-items: baseline;
  gap: 28px;
}
.studies-section-num {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--fg);
  flex-shrink: 0;
  line-height: 1;
}
.studies-section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(14px, 1.7vw, 20px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0;
  text-align: left;
  line-height: 1.3;
}

/* Контент-блок секции без проектов (Photography, Education) — внутри тот же max-width */
.studies-section-body {
  max-width: 1100px;
  margin: 0 auto;
}

.study-project {
  max-width: 1100px;
  margin: 0 auto 120px;
  padding: 0;
}
.study-project:last-child { margin-bottom: 0; }
.study-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 54px);
  letter-spacing: 0.06em;
  margin: 0 0 24px;
  color: var(--fg);
}
.study-description {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
  max-width: 720px;
  margin: 0 0 48px;
  letter-spacing: 0.01em;
}
.study-description em {
  font-style: italic;
  color: var(--fg);
}

.study-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 12px;
}
.study-slide {
  margin: 0;
  background: var(--bg-soft, #f0ece4);
}
.study-slide img {
  display: block;
  width: 100%;
  height: auto;
}

/* Photography & Production block — короткое описание + ссылка на портфолио */
.studies-section-body .study-description {
  margin: 0 0 24px;
}
.studies-back-link {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin: 0;
}
.studies-back-link a {
  color: var(--fg);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.studies-back-link a:hover { opacity: 0.55; }

/* Education block */
.studies-edu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.studies-edu-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.edu-school {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--fg);
}
.edu-program {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.study-certificate {
  margin: 0;
  max-width: 720px;
}
.study-certificate img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
}
.study-certificate figcaption {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
}

@media (max-width: 700px) {
  .studies-intro { padding: 90px 18px 50px; }
  .studies-section { padding: 50px 18px; }
  .studies-section-header { margin-bottom: 40px; gap: 14px; padding-bottom: 14px; }
  .studies-section-num { font-size: 10px; letter-spacing: 0.2em; }
  .studies-section-title { letter-spacing: 0.08em; }
  .study-project { margin-bottom: 70px; }
  .study-description { font-size: 14px; }
  .study-gallery { gap: 16px; }
  .edu-school { font-size: 16px; }
  .studies-edu-list { gap: 18px; margin-bottom: 40px; }
}
