/* ===========================================================
   Reviews section — animated card stack
   =========================================================== */
.reviews-section {
  background: var(--color-canvas-soft);
  padding: 112px 0;
  position: relative;
  overflow: hidden;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 64px;
  align-items: start;
}

/* ===== Left column — context / overall rating ===== */
.reviews-left {
  position: sticky;
  top: 100px;
}

.reviews-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: #E3421F;
  margin: 0 0 16px;
  display: inline-flex; align-items: center; gap: 12px;
}
.reviews-eyebrow::before {
  content: ""; display: inline-block; width: 28px; height: 2px; background: #E3421F;
}

.reviews-title {
  font-size: 52px; font-weight: 900; line-height: 1.02;
  letter-spacing: -0.022em; text-transform: uppercase;
  margin: 0 0 22px;
  color: #0A0A0A;
}
.reviews-title .accent { color: #E3421F; }

.reviews-lead {
  font-size: 17px; line-height: 1.6;
  color: var(--color-fg-2);
  margin: 0 0 36px;
  max-width: 460px;
}

/* Yandex rating card */
.yandex-card {
  background: #fff;
  border: 1px solid var(--color-border-1);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
}
.yandex-card-head {
  display: flex; align-items: center; gap: 14px;
}
.yandex-logo {
  width: 44px; height: 44px;
  background: #FFCC00;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Rubik", sans-serif;
  font-weight: 900; font-size: 22px;
  color: #0A0A0A;
  letter-spacing: -0.03em;
}
.yandex-card-meta { display: flex; flex-direction: column; gap: 2px; }
.yandex-card-name { font-size: 14px; font-weight: 700; color: #0A0A0A; }
.yandex-card-sub { font-size: 12px; color: var(--color-fg-3); }

.yandex-score-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border-1);
  border-bottom: 1px solid var(--color-border-1);
}
.yandex-score {
  font-size: 56px; font-weight: 900; line-height: 1;
  letter-spacing: -0.03em;
  color: #0A0A0A;
}
.yandex-stars {
  display: flex; gap: 2px; margin-bottom: 4px;
}
.yandex-stars svg {
  width: 22px; height: 22px;
  color: #FFCC00;
  fill: #FFCC00;
}
.yandex-score-bottom {
  display: flex; flex-direction: column; gap: 2px;
}
.yandex-count { font-size: 13px; color: var(--color-fg-2); font-weight: 600; }
.yandex-verified { font-size: 11px; color: var(--color-fg-3); letter-spacing: 0.06em; text-transform: uppercase; }

.yandex-bars { display: flex; flex-direction: column; gap: 6px; }
.yandex-bar {
  display: grid; grid-template-columns: 32px 1fr 28px;
  gap: 10px; align-items: center;
  font-size: 12px; color: var(--color-fg-2);
}
.yandex-bar-track {
  height: 6px; background: #F0EFEC;
  border-radius: 3px; overflow: hidden;
}
.yandex-bar-fill { height: 100%; background: #FFCC00; border-radius: 3px; }
.yandex-bar-num { font-weight: 600; text-align: right; }

.yandex-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: #0A0A0A;
  padding-top: 4px;
}
.yandex-link svg { width: 14px; height: 14px; }
.yandex-link:hover { color: #E3421F; }

/* ===== Right column — animated card stack ===== */
.stack-wrapper {
  position: relative;
  padding-left: 8px;
}

.stack {
  position: relative;
  height: 520px;
  perspective: 1400px;
  touch-action: pan-y;
}

.stack-card {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 14px;
  padding: 36px 36px 28px;
  border: 1px solid var(--color-border-1);
  box-shadow: 0 24px 48px rgba(10,10,10,0.10);
  display: flex; flex-direction: column;
  transform-origin: 50% 100%;
  transition:
    transform 520ms cubic-bezier(0.22, 0.9, 0.18, 1),
    opacity 520ms cubic-bezier(0.22, 0.9, 0.18, 1),
    box-shadow 320ms ease;
  will-change: transform, opacity;
}
.stack-card.dragging {
  transition: none;
  cursor: grabbing;
}
.stack-card.exiting {
  transition:
    transform 600ms cubic-bezier(0.5, 0, 0.6, 1),
    opacity 400ms ease;
}

/* Stack quote mark */
.stack-quote {
  position: absolute;
  top: 24px; right: 30px;
  font-family: "Rubik", serif;
  font-size: 90px;
  line-height: 0.5;
  color: #E3421F;
  font-weight: 900;
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

/* Author row */
.stack-author {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.stack-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #0A0A0A;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.stack-avatar.a1 { background: linear-gradient(135deg, #3A3A3A, #1A1A1A); }
.stack-avatar.a2 { background: linear-gradient(135deg, #2A3A35, #15201D); color: #FFD8B8; }
.stack-avatar.a3 { background: linear-gradient(135deg, #3D2E2A, #1E1614); color: #E3421F; }
.stack-avatar.a4 { background: linear-gradient(135deg, #2E2A35, #1A1620); color: #C8BBE6; }
.stack-avatar.a5 { background: linear-gradient(135deg, #353030, #1A1818); }
.stack-avatar.a6 { background: linear-gradient(135deg, #2A2F3A, #15181F); color: #B8CDFF; }

.stack-author-info { flex: 1; min-width: 0; }
.stack-author-name {
  font-size: 17px; font-weight: 800; color: #0A0A0A;
  letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 8px;
}
.stack-author-name .verified {
  display: inline-flex; align-items: center;
  width: 18px; height: 18px;
  background: #4A9D2F; color: #fff;
  border-radius: 50%;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.stack-author-name .verified svg { width: 11px; height: 11px; }
.stack-author-meta {
  font-size: 12.5px; color: var(--color-fg-3);
  margin-top: 2px;
}

.stack-rating {
  display: flex; gap: 2px;
  margin-bottom: 18px;
}
.stack-rating svg {
  width: 18px; height: 18px;
  color: #FFCC00;
  fill: #FFCC00;
}

.stack-text {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--color-fg-1);
  flex: 1;
  margin: 0;
  text-wrap: pretty;
  /* allow up to ~9 lines */
  display: -webkit-box;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stack-text b { color: #0A0A0A; font-weight: 700; }

.stack-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border-1);
  display: flex; align-items: center; justify-content: space-between;
}
.stack-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: #F5F5F4;
  padding: 6px 10px; border-radius: 4px;
  font-size: 11.5px; font-weight: 700;
  color: var(--color-fg-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stack-tag svg { width: 12px; height: 12px; color: #E3421F; }

.stack-source {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  color: var(--color-fg-3);
}
.stack-source .yandex-mini {
  width: 16px; height: 16px;
  background: #FFCC00;
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 10px;
  color: #0A0A0A;
}

/* ===== Stack controls ===== */
.stack-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding: 0 8px;
}
.stack-counter {
  display: flex; align-items: baseline; gap: 6px;
  font-family: "Rubik", monospace;
  letter-spacing: -0.01em;
}
.stack-counter-current {
  font-size: 36px; font-weight: 900;
  color: #0A0A0A;
  line-height: 1;
}
.stack-counter-sep {
  font-size: 22px; color: var(--color-fg-3);
  font-weight: 500;
}
.stack-counter-total {
  font-size: 22px; font-weight: 700;
  color: var(--color-fg-3);
}
.stack-counter-label {
  margin-left: 12px;
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-fg-3);
}

.stack-actions {
  display: flex; gap: 10px;
}
.stack-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1.5px solid #0A0A0A;
  background: #fff;
  color: #0A0A0A;
  display: flex; align-items: center; justify-content: center;
  transition: all 160ms cubic-bezier(0.2,0.8,0.2,1);
}
.stack-btn:hover { background: #0A0A0A; color: #fff; }
.stack-btn.primary {
  background: #E3421F; border-color: #E3421F; color: #fff;
}
.stack-btn.primary:hover {
  background: #FF5630; border-color: #FF5630;
  box-shadow: 0 8px 22px rgba(227,66,31,0.32);
}
.stack-btn svg { width: 20px; height: 20px; }
.stack-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ===== Progress dots ===== */
.stack-dots {
  display: flex; gap: 6px;
  margin-top: 18px;
  justify-content: center;
}
.stack-dot {
  width: 24px; height: 4px;
  background: #D6D5D2;
  border: none;
  border-radius: 2px;
  transition: all 320ms cubic-bezier(0.2,0.8,0.2,1);
  padding: 0;
  cursor: pointer;
}
.stack-dot.active {
  width: 40px;
  background: #E3421F;
}
.stack-dot:hover:not(.active) { background: #0A0A0A; }

/* ===== Auto-rotate indicator ===== */
.stack-autoplay {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-fg-3); font-weight: 600;
  margin-top: 14px;
}
.stack-autoplay-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #E3421F;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.stack-autoplay.paused .stack-autoplay-dot { background: var(--color-fg-3); animation: none; }

/* ===== Tip line ===== */
.stack-tip {
  margin-top: 28px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--color-fg-3);
}
.stack-tip svg { width: 14px; height: 14px; }
.stack-tip kbd {
  font-family: "Rubik", monospace;
  font-size: 11px; font-weight: 700;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid var(--color-border-1);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #0A0A0A;
}

/* ===== Reviews bottom — summary stats ===== */
.reviews-bottom {
  margin-top: 96px;
  padding: 32px 40px;
  background: #0A0A0A;
  color: #fff;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 36px;
  align-items: center;
}
.reviews-bottom-text {
  font-size: 18px; font-weight: 700; line-height: 1.3;
  letter-spacing: -0.005em;
}
.reviews-bottom-text .accent { color: #E3421F; }
.reviews-bottom-stat {
  border-left: 1px solid #232323;
  padding-left: 24px;
}
.reviews-bottom-num {
  font-size: 34px; font-weight: 900; letter-spacing: -0.02em;
  line-height: 1;
}
.reviews-bottom-num .unit { color: #E3421F; font-size: 18px; margin-left: 2px; }
.reviews-bottom-label {
  font-size: 12px; color: #B5B5B5;
  margin-top: 6px; line-height: 1.4;
}

/* ===== Variant: grid layout ===== */
.reviews-section.layout-grid .stack { display: none; }
.reviews-section.layout-grid .reviews-grid { grid-template-columns: 1fr; }
.reviews-section.layout-grid .reviews-left { position: static; max-width: none; }
.reviews-section.layout-grid .reviews-lead { max-width: 780px; }
.reviews-section.layout-grid .yandex-card { max-width: 100%; }
.reviews-section.layout-grid .grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
}
.reviews-section:not(.layout-grid) .grid-view { display: none; }
.grid-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  border: 1px solid var(--color-border-1);
  display: flex; flex-direction: column;
}
.grid-card .stack-text {
  font-size: 15px; -webkit-line-clamp: 7;
}
