/* ── Tokens ── */
:root {
  --bg:   #f6f3ec;
  --ink:  #23262b;
  --soft: #5e5b53;
  --line: #e4dfd3;
  --card: #fff;
  --accent: #3a3d42; /* overridden inline per-vizitka */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

/* ── Base ── */
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg) url("/static/img/paper-bg.jpg");
  background-size: 400px;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Wrapper ── */
.wrap {
  max-width: 468px;
  margin: 0 auto;
  /* Боковое поле = прежняя «глубокая» линия письма (база + инсет .greeting),
     теперь общая для всего контента. ~25px@320 · ~31px@390 · 40px на широком. */
  padding: clamp(22px,5vw,34px) clamp(22px,8vw,40px) clamp(30px,7vw,44px);
}

/* ── Header: logo mode ── */
.logo {
  display: block;
  height: clamp(23px, 6.4vw, 28px);
  width: auto;
  max-width: 200px;
  margin: 0 auto clamp(18px, 5vw, 24px);
  object-fit: contain;
}

/* Текстовая заглушка логотипа (когда logo_path пуст) */
.logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(40px, 11vw, 48px);
  max-width: 200px;
  margin: 0 auto clamp(18px, 5vw, 24px);
  padding: 0 16px;
  background: #e7e2d8;
  border: 1.5px dashed #c4bdac;
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #8a8275;
  text-align: center;
}

/* ── Header: photo mode ── */
.portrait {
  width: clamp(140px,40vw,168px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line);
}

/* ── Greeting ── */
/* Боковой «воздух» письма теперь общий — задан на .wrap для всего контента,
   поэтому отдельный инсет .greeting снят (иначе письмо ушло бы глубже). */

/* Короткий разделитель после подписи — отделяет «личное письмо» от контента. */
.greet-divider {
  width: 44px;
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 26px auto;
}

.greet {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(21px, 6vw, 24px);
  line-height: 1.25;
  text-align: center;
  margin-bottom: 14px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.letter {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(15px, 4.2vw, 16.5px);
  line-height: 1.6;
  text-align: center;
  color: var(--soft);
}
/* Абзацный отступ между абзацами письма (см. \n\n в greeting_text). */
.letter p + p { margin-top: 13px; }

/* ── Signature block (photo mode) ── */
/* Подпись выровнена по правому краю письма; заголовок и тело — по центру. */
.sign {
  text-align: right;
  margin-top: 18px;
}
.sign img {
  height: clamp(38px, 11vw, 46px);
  width: auto;
  opacity: .92;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: 0;
}
.leader { font-weight: 500; font-size: 14px; }
.role   { font-size: 12px; color: var(--soft); margin-top: 1px; }

/* ── Section heading ── */
.sec {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(19px, 5.4vw, 21px);
  text-align: center;
  margin: clamp(30px, 8vw, 38px) 0 5px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.sec-line {
  width: 34px;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 18px;
  border-radius: 2px;
}

/* ── Gallery slider ── */
.slider {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}
.stage {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #e7e0d2;
}
.stage img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(28px, 8vw, 34px);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.arrow.l { left: 9px; }
.arrow.r { right: 9px; }
.arrow svg { width: 15px; height: 15px; }
.count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(28,24,18,.55);
  color: #fff;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 11px;
}
.thumbs {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.thumbs img {
  flex: 1;
  min-width: 0;
  height: clamp(40px, 12vw, 54px);
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s;
}
.thumbs img.on {
  opacity: 1;
  outline: 2px solid var(--accent);
}
.gal-caption {
  font-size: clamp(13.5px, 3.6vw, 14px);
  line-height: 1.55;
  color: var(--ink);
  margin-top: 12px;
  min-height: 1.5em;
}

/* ── Преимущества — список (плоский текст, без полоски) ── */
/* Голый текст на бумаге: только воздух между пунктами. Отличается от карточек
   (.bul-card с тенью) именно лёгкостью — ни рамок, ни фона, ни полос. */
.bul {
  margin-bottom: 18px;
}
.bul:last-child { margin-bottom: 0; }
/* Заголовок пункта — тёмный и плотный (вес 600, --ink), на 0.5px крупнее
   текста; текст под ним светлее (--soft) и тоньше — явная ступень заголовок/
   текст. Едино для списка и карточек. */
.bul-title { font-weight: 600; font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.bul-text  { font-size: clamp(13.5px, 3.6vw, 14px); line-height: 1.55; color: var(--soft); }

/* ── Преимущества — карточки ── */
/* Тянутся по высоте на длинном тексте; тень мягкая и в пределах padding .wrap,
   на 320px не обрезается. */
.bul-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  padding: 13px;
  margin-bottom: 9px;
}

/* ── Reviews source link ── */
.rev-source {
  text-align: center;
  margin-top: 12px;
}
.rev-source a {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  opacity: .8;
}
.rev-source a:hover { opacity: 1; }

/* ── Cases (плоско, без карточки) ── */
.case {
  margin-bottom: 20px;
}
.case + .case {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.case-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(16px, 4.6vw, 18px);
  color: var(--ink);
  margin-bottom: 12px;
}
.case-img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  margin-bottom: 14px;
  background: var(--line);
}
.case-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent);
  margin-bottom: 3px;
}
.case-txt { font-size: clamp(13.5px, 3.6vw, 14px); line-height: 1.55; color: var(--ink); margin-bottom: 10px; }
.case-res .case-lbl { color: #1a7a3c; }
.case-res .case-txt { margin-bottom: 0; }
.case-source {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  opacity: .75;
}
.case-source:hover { opacity: 1; }

/* ── Works (примеры работ: слайдер на каждый пример, плоско) ── */
.work { margin-bottom: 20px; }
.work-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(16px, 4.6vw, 18px);
  color: var(--ink);
  margin-bottom: 12px;
}
.work-desc {
  font-size: clamp(13.5px, 3.6vw, 14px);
  line-height: 1.55;
  color: var(--ink);
  margin-top: 12px;
}
.work-desc p { margin: 0 0 10px; }
.work-desc p:last-child { margin-bottom: 0; }
.work-desc ul,
.work-desc ol { margin: 0 0 10px; padding-left: 22px; }
.work-desc ul:last-child,
.work-desc ol:last-child { margin-bottom: 0; }
.work-desc li { margin-bottom: 6px; }
.work-desc strong { font-weight: 600; }

/* ── CTA / contacts ── */
.cta {
  text-align: center;
  margin-top: clamp(32px, 8vw, 40px);
  padding-top: clamp(24px, 6vw, 32px);
  border-top: 1px solid var(--line);
}
.cta h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  font-size: clamp(19px, 5.4vw, 21px);
  margin-bottom: 4px;
}
.cta-group { margin-top: 22px; }
.cta-group-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .55px;
  color: var(--soft);
  margin-bottom: 10px;
}
.ctabtns { display: flex; flex-direction: column; gap: 10px; }
.site-link {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: .82;
}
.site-link:hover { opacity: 1; }
.ctabtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 15px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Manrope', system-ui, sans-serif;
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  transition: opacity .15s;
}
.ctabtn:hover { opacity: .72; }
.ctabtn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Лайтбокс (зум контентных фото) ── */
.zoomable { cursor: zoom-in; }

.lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 13, 10, .9);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lb.on { display: flex; }
.lb-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
}
.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}
.lb-close:hover { opacity: 1; }

/* Стрелки листания внутри лайтбокса */
.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .85;
  -webkit-tap-highlight-color: transparent;
}
.lb-prev:hover, .lb-next:hover { opacity: 1; background: rgba(255, 255, 255, .2); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
