/* Evidence system — sections 04 / 05 / 06. Matches existing design tokens. */
#cases-legacy,
#documents-legacy,
#testimonials-legacy {
  display: none !important;
}

.ev-section {
  position: relative;
  overflow: hidden;
}

.ev-head {
  max-width: 48rem;
}

.ev-kicker {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ev-rule {
  margin-top: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(200, 164, 92, 0.5), rgba(255, 255, 255, 0.1), transparent);
}

.ev-grid {
  display: grid;
  gap: 1rem;
  margin-top: 4rem;
}

@media (min-width: 640px) {
  .ev-grid { margin-top: 5rem; gap: 1.25rem; }
}

.ev-cases {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .ev-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .ev-cases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ev-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.07);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.ev-card:hover,
.ev-card:focus-visible {
  border-color: rgb(200 164 92 / 0.28);
  outline: none;
}

.ev-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.35rem;
}

@media (min-width: 640px) {
  .ev-card__body { padding: 1.75rem; }
}

.ev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(4 5 7 / 0.45);
  padding: 0.28rem 0.75rem;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(220 191 128 / 0.9);
}

.ev-card h3 {
  margin-top: 1rem;
  font-family: var(--font-display), serif;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #f3efe6;
  transition: color 0.5s;
}

.ev-card:hover h3 {
  color: rgb(232 213 171);
}

.ev-card p {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgb(168 174 186);
}

.ev-metric {
  margin-top: 1.15rem;
}

.ev-metric strong {
  display: block;
  font-family: var(--font-display), serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #e9d5ab, #c8a45c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ev-metric span {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(120 128 142);
}

.ev-meta {
  margin-top: auto;
  padding-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(120 128 142);
}

.ev-cta {
  color: rgb(220 191 128 / 0.95);
}

.ev-card:hover .ev-cta {
  color: #e9d5ab;
}

/* Documents */
.ev-docs {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ev-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .ev-docs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ev-doc__preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  background: #0b0d12;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
  overflow: hidden;
}

.ev-doc__preview img,
.ev-doc__preview picture {
  width: 100%;
  height: 100%;
}

.ev-doc__preview img {
  object-fit: contain;
  object-position: center;
}

.ev-pages {
  position: absolute;
  left: 1rem;
  bottom: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(4 5 7 / 0.72);
  padding: 0.28rem 0.7rem;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(200 208 220);
}

.ev-doc__preview--wide {
  aspect-ratio: 4 / 3;
}

/* Reviews */
.ev-reviews {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ev-reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .ev-reviews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ev-review__shot {
  background: #07080b;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.ev-review__shot img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.ev-quote {
  margin: 0;
  font-family: var(--font-display), serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: #f3efe6;
}

.ev-more {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.ev-more button,
.ev-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: transparent;
  padding: 0 1.4rem;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(220 191 128);
  cursor: pointer;
  transition: border-color 0.5s, background 0.5s;
}

.ev-more button:hover,
.ev-link:hover {
  border-color: rgb(200 164 92 / 0.55);
  background: rgb(200 164 92 / 0.08);
}

.ev-hidden { display: none !important; }

.ev-cta-band {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.07);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
  padding: 2rem 1.75rem;
}

@media (min-width: 768px) {
  .ev-cta-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 2.25rem 2.5rem;
  }
}

.ev-cta-band h3 {
  font-family: var(--font-display), serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f3efe6;
}

.ev-cta-band p {
  margin-top: 0.55rem;
  max-width: 36rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgb(168 174 186);
}

/* Modal */
.ev-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgb(4 5 7 / 0.88);
  backdrop-filter: blur(12px);
}

.ev-modal {
  position: fixed;
  z-index: 221;
  left: 50%;
  top: 50%;
  width: calc(100vw - 1.25rem);
  max-width: 1120px;
  max-height: 92svh;
  overflow: auto;
  transform: translate(-50%, -50%);
  border-radius: 1.1rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: linear-gradient(150deg, rgba(18, 20, 26, 0.98), rgba(6, 8, 12, 0.98));
  box-shadow: 0 40px 110px -45px rgba(0, 0, 0, 0.95);
  padding: 1.5rem 1.25rem 2rem;
  /* Докрутили до края — страница под модалкой не уезжает. */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .ev-modal { padding: 2.25rem 2.5rem 2.5rem; width: calc(100vw - 2rem); }
}

@media (max-width: 639px) {
  .ev-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    max-height: 96svh;
    transform: none;
    border-radius: 1.1rem 1.1rem 0 0;
  }
}

.ev-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: flex;
  height: 44px;
  width: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(4 5 7 / 0.45);
  color: rgb(200 208 220);
  cursor: pointer;
}

.ev-close:hover,
.ev-close:focus-visible {
  border-color: rgb(200 164 92 / 0.55);
  color: #e9d5ab;
  outline: none;
}

.ev-modal h2 {
  margin-top: 0.85rem;
  max-width: 40rem;
  padding-right: 3rem;
  font-family: var(--font-display), serif;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #f3efe6;
}

.ev-block {
  margin-top: 1.6rem;
}

.ev-block h3 {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(200 164 92 / 0.8);
}

.ev-block p,
.ev-block li {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgb(188 194 206);
}

.ev-block--result p {
  font-family: var(--font-display), serif;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
  color: #f3efe6;
}

.ev-block ol {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: ev;
}

.ev-block li {
  counter-increment: ev;
  display: flex;
  gap: 0.75rem;
}

.ev-block li::before {
  content: counter(ev, decimal-leading-zero);
  flex-shrink: 0;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: rgb(200 164 92 / 0.75);
  padding-top: 0.35rem;
}

.ev-gallery {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .ev-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ev-thumb {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.8rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: #0b0d12;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.ev-thumb:focus-visible {
  outline: 2px solid rgb(200 164 92 / 0.7);
  outline-offset: 2px;
}

.ev-thumb__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 11rem;
  max-height: 16rem;
  padding: 0.5rem;
  background: #07080b;
}

.ev-thumb__frame img {
  max-width: 100%;
  max-height: 15rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ev-thumb figcaption {
  padding: 0.7rem 0.9rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgb(168 174 186);
}

/* Lightbox */
.ev-lite {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  flex-direction: column;
  /* Размытие, как у подложки кейса: без него сквозь 6% прозрачности
     чётко читался текст открытой под просмотрщиком карточки. */
  background: rgb(4 5 7 / 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ev-lite__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgb(200 208 220);
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ev-lite__stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0.5rem 3.2rem 1.25rem;
  touch-action: pan-y pinch-zoom;
}

.ev-lite__stage img {
  max-width: 100%;
  max-height: calc(100svh - 6.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.ev-lite__stage.is-zoom {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: flex-start;
  touch-action: pan-x pan-y pinch-zoom;
}

.ev-lite__stage.is-zoom img {
  max-height: none;
  max-width: none;
  width: min(1600px, 180%);
  flex: none;
  margin: auto;
  cursor: zoom-out;
}

.ev-nav {
  /* fixed, а не absolute: при увеличении документа область просмотра
     прокручивается, и absolute-стрелки уезжали бы вместе с картинкой. */
  position: fixed;
  z-index: 1;
  top: 50%;
  display: flex;
  height: 48px;
  width: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(4 5 7 / 0.55);
  color: #f3efe6;
  cursor: pointer;
  transform: translateY(-50%);
}

.ev-nav--prev { left: 0.5rem; }
.ev-nav--next { right: 0.5rem; }

.ev-nav:hover,
.ev-nav:focus-visible {
  border-color: rgb(200 164 92 / 0.6);
  outline: none;
}

.ev-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

body.ev-lock {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .ev-card,
  .ev-card h3,
  .ev-lite__stage img {
    transition: none;
  }
}

@media (max-width: 359px) {
  .ev-card__body { padding: 1.2rem; }
  .ev-modal { padding: 1.25rem 1rem 1.5rem; }
}

/* Заголовок группы внутри сетки документов: документы идут теми же
   блоками, что и кейсы, — прокуратура, ВВК, поиск, суд. */
.ev-group {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
}

.ev-group:not(:first-child) {
  margin-top: 2.25rem;
}

.ev-group__label {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(220 191 128 / 0.9);
}

.ev-group__title {
  flex: 1 1 16rem;
  font-family: var(--font-display), serif;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgb(200 208 220);
}

.ev-group__count {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(120 128 142);
}

/* Пояснение под сеткой документов и внутри карточки кейса. */
.ev-note {
  margin-top: 2.25rem;
  max-width: 46rem;
  font-size: 0.84rem;
  line-height: 1.7;
  color: rgb(120 128 142);
}

.ev-hint {
  margin-top: 1rem;
  border-left: 1px solid rgb(200 164 92 / 0.35);
  padding-left: 0.9rem;
  font-size: 0.87rem;
  line-height: 1.65;
  color: rgb(150 157 170);
}
