:root {
  --bg: #ffffff;
  --text: #141414;
  --muted: #7a7a7a;
  --border: #e4e4e4;
  --placeholder-bg: #fafafa;
  --placeholder-border: #c9b98a;
  --placeholder-text: #8a7a4a;
  --accent: #3860e0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #f2f2f2;
    --muted: #9a9a9a;
    --border: #2b2b2b;
    --placeholder-bg: #24211a;
    --placeholder-border: #6b5b33;
    --placeholder-text: #d8c483;
    --accent: #6f93ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.v2-top-bar {
  display: flex;
  justify-content: flex-end;
  padding: 24px 32px 0;
}

.v2-lang-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.v2-lang-toggle:hover { border-color: var(--text); }

/* Hero */
.v2-hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 32px 90px;
  display: flex;
  align-items: center;
  gap: 48px;
}

.v2-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.v2-hero-text h1 {
  font-size: 44px;
  margin: 0 0 16px;
  line-height: 1.15;
}

.v2-tagline {
  font-size: 19px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 20px;
}

.v2-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
}

.v2-contacts a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.v2-contacts a:hover { border-color: var(--text); }

@media (max-width: 760px) {
  .v2-hero { flex-direction: column; text-align: center; padding-bottom: 60px; gap: 28px; }
  .v2-photo { width: 180px; height: 180px; }
  .v2-hero-text h1 { font-size: 32px; }
  .v2-tagline { max-width: none; }
  .v2-contacts { justify-content: center; }
}

/* Case rows */
.v2-cases {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 100px;
}

.v2-case {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 48px;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.v2-case:first-child { border-top: none; }

.v2-case-text {
  position: sticky;
  top: 32px;
  align-self: start;
}

.v2-case-text h2 {
  font-size: 28px;
  margin: 0 0 20px;
}

.v2-field { margin-bottom: 16px; }

.v2-field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.v2-field-value {
  font-size: 15px;
}

.v2-field p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.v2-case-media {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.v2-case-media img,
.v2-case-media video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
}

/* Вертикальное видео (телефон) кадрируем до альбомных пропорций, чтобы не растягивало страницу */
.v2-case-media video {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* Фото + видео рядом на общей подложке, пропорции всей рамки как в референсе (2880:1680), колонки 545:210 */
.v2-duo-frame {
  background: #6b6b6f;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: 545fr 210fr;
  gap: 16px;
  aspect-ratio: 2880 / 1680;
  box-sizing: border-box;
}

.v2-duo-frame img,
.v2-duo-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

@media (max-width: 560px) {
  .v2-duo-frame {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
  }
  .v2-duo-frame img,
  .v2-duo-frame video {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

/* Слайдер "до/после" */
.v2-compare {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.v2-compare-before {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.v2-compare-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

.v2-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  border-left: 2px solid #fff;
  transform: translateX(-1px);
}

.v2-compare-handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.v2-compare-label {
  position: absolute;
  top: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 999px;
}

.v2-compare-label-before { left: 16px; }
.v2-compare-label-after { right: 16px; }

.v2-media-placeholder {
  width: 100%;
  min-height: 560px;
  border: 1px dashed var(--placeholder-border);
  background: var(--placeholder-bg);
  color: var(--placeholder-text);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  padding: 12px;
}

@media (max-width: 760px) {
  .v2-case {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 40px 0;
  }
  .v2-case-media { order: -1; }
  .v2-case-text { position: static; }
}

.v2-footer-note {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px 60px;
  font-size: 12px;
  color: var(--muted);
}

/* Ссылка "открыть кейс целиком" под описанием */
.v2-case-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.v2-case-link:hover { opacity: 0.75; }

/* Полный кейс — полноэкранный оверлей */
.v2-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: none;
  overflow-y: auto;
}
.v2-detail-overlay.open { display: block; }

.v2-detail-close {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 101;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v2-detail-close:hover { border-color: var(--accent); color: var(--accent); }

.v2-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 90px 24px 100px;
}

.v2-detail-hero {
  margin-bottom: 28px;
}
.v2-detail-hero img,
.v2-detail-hero video {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}
.v2-detail-hero .img-placeholder,
.v2-detail-hero .v2-media-placeholder {
  min-height: 280px;
  border-radius: 16px;
}

.v2-detail-title {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 36px;
  line-height: 1.15;
}

.v2-detail-block { margin-bottom: 46px; }
.v2-detail-block h3 {
  font-size: 18px;
  margin: 0 0 10px;
}
.v2-detail-block p {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
  margin: 0;
}
.v2-detail-block.is-placeholder p {
  color: var(--placeholder-text);
  font-style: italic;
}

.v2-detail-images {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.v2-detail-images img,
.v2-detail-images video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}
.v2-detail-images .v2-media-placeholder {
  min-height: 260px;
  border-radius: 12px;
}

.v2-detail-figure {
  margin: 0;
}
.v2-detail-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 600px) {
  .v2-detail { padding: 80px 20px 80px; }
}
