@font-face {
  font-family: "Montserrat";
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/montserrat-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/montserrat-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/montserrat-cyrillic-700.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193;
}

:root {
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --navy: #0f1a3b;
  --muted: #5a6680;
  --blue: #2a8cff;
  --star: #ffb400;
}

* {
  box-sizing: border-box;
}

.reviews {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  overflow: auto;
  color: var(--navy);
  font-family: "Montserrat", Arial, sans-serif;
  background: #0c1424 url("../assets/reviews/cover.jpg") center / cover no-repeat;
  -webkit-overflow-scrolling: touch;
}

.reviews.is-active {
  display: block;
}

.reviews button,
.reviews input,
.reviews textarea {
  font: inherit;
  color: inherit;
}

.glass {
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.62) 0%, rgba(232, 241, 255, 0.4) 50%, rgba(211, 229, 249, 0.34) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 22px 50px -18px rgba(15, 26, 59, 0.45),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 20px 40px -26px rgba(255, 255, 255, 0.85);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 64px;
}

/* header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 23px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  text-decoration: none;
  transition: transform 250ms var(--ease);
}

.top__brand img {
  display: block;
  filter: drop-shadow(0 6px 14px rgba(15, 26, 59, 0.35));
}

.hero {
  margin: 18px 0 24px;
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 16px rgba(15, 26, 59, 0.55);
}

.hero h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: 0.02em;
}

.hero p {
  max-width: 520px;
  margin: 8px auto 0;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.45;
}

/* tabs */

.tabs {
  display: flex;
  gap: 6px;
  max-width: 620px;
  margin: 0 auto 24px;
  padding: 6px;
  border-radius: 26px;
}

.tabs__item {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 10px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 250ms var(--ease), box-shadow 250ms var(--ease), color 250ms var(--ease);
}

.tabs__item.is-active {
  background: linear-gradient(180deg, #1fd2ff 0%, var(--blue) 100%);
  box-shadow: 0 10px 22px -10px rgba(42, 140, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #fff;
}

.tabs__count {
  font-weight: 600;
  font-size: 13px;
  opacity: 0.7;
}

.tabs__count:empty {
  display: none;
}

/* layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
  gap: 24px;
}

.list {
  display: grid;
  gap: 14px;
}

#reviews {
  display: grid;
  gap: 14px;
}

.state {
  margin: 0;
  padding: 28px;
  font-weight: 600;
  text-align: center;
}

.state p {
  margin: 0 0 16px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 16px 22px;
}

.summary[hidden] {
  display: none;
}

.summary__score {
  font-size: 32px;
  line-height: 1;
}

.summary__stars {
  font-size: 20px;
}

.summary__count {
  font-weight: 600;
  color: var(--muted);
}

.summary__write {
  margin-left: auto;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.stars {
  letter-spacing: 2px;
  color: var(--star);
  white-space: nowrap;
}

.stars i {
  font-style: normal;
  color: rgba(15, 26, 59, 0.16);
}

.review {
  padding: 20px 22px;
}

.review__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review__avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, #1fd2ff, var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.review__who {
  display: grid;
  flex: 1;
  min-width: 0;
}

.review__who strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review__who time {
  font-size: 13px;
  color: var(--muted);
}

.review .stars {
  font-size: 17px;
}

.review__text {
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: #2b3350;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* form */

.write {
  position: sticky;
  top: 20px;
  padding: 24px;
  scroll-margin-top: 20px;
}

.write h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  margin-bottom: 7px;
  padding: 0;
  font-weight: 700;
  font-size: 14px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  transition: border-color 200ms, box-shadow 200ms, background-color 200ms;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(42, 140, 255, 0.18);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.segment label,
.rate {
  position: relative;
}

.segment input,
.rate input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.segment span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 200ms, color 200ms, box-shadow 200ms;
}

.segment input:checked + span {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(15, 26, 59, 0.6);
}

.segment input:focus-visible + span,
.rate input:focus-visible + label {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.rate {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}

.rate label {
  font-size: 34px;
  line-height: 1;
  color: rgba(15, 26, 59, 0.18);
  cursor: pointer;
  transition: color 150ms, transform 150ms var(--ease);
}

.rate input:checked ~ label,
.rate label:hover,
.rate label:hover ~ label {
  color: var(--star);
}

.rate label:hover {
  transform: scale(1.12);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 26px;
  background: linear-gradient(180deg, #1fd2ff 0%, var(--blue) 100%);
  box-shadow: 0 12px 24px -10px rgba(42, 140, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 250ms var(--ease), filter 250ms var(--ease);
}

.btn:disabled {
  filter: grayscale(0.4) brightness(0.95);
  cursor: progress;
}

.btn--ghost {
  width: auto;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 6px 16px -8px rgba(15, 26, 59, 0.35);
  color: var(--navy);
}

.form__msg {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 14px;
}

.form__msg:empty {
  display: none;
}

.form__msg.is-error {
  color: #c62f3a;
}

.form__msg.is-ok {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(220, 252, 231, 0.9);
  color: #166534;
}

.form__note {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

@media (hover: hover) {
  .top__back:hover,
  .btn:not(:disabled):hover {
    transform: translateY(-2px);
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .write {
    position: static;
  }
}

@media (max-width: 480px) {
  .top__brand img {
    width: 56px;
    height: auto;
  }

  .tabs__item {
    flex-direction: column;
    gap: 0;
    font-size: 14px;
  }

  .review {
    padding: 16px;
  }

  .review__head {
    flex-wrap: wrap;
  }

  .review .stars {
    width: 100%;
    order: 3;
  }

  .write {
    padding: 20px 16px;
  }
}

/* intro: video, then the cover, then the glass panels on top of it */

.reviews.is-reeling {
  overflow: hidden;
}

.reviews:not(.is-open) .page {
  opacity: 0;
}

.reviews .hero {
  margin-top: clamp(150px, 28vh, 320px);
  text-shadow: 0 2px 18px rgba(8, 12, 28, 0.75);
}

.reel {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0c1424;
  transition: opacity 1500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.reel__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1700ms cubic-bezier(0.45, 0.05, 0.2, 1);
}

.reel.is-still .reel__still {
  opacity: 1;
}

.reel.is-gone {
  opacity: 0;
  pointer-events: none;
}

.reel__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  transform: scale(1);
  transition:
    opacity 1700ms cubic-bezier(0.45, 0.05, 0.2, 1),
    transform 1700ms cubic-bezier(0.45, 0.05, 0.2, 1);
}

.reel.is-still .reel__video {
  opacity: 0;
  transform: scale(1.04);
}

.reel__skip {
  position: absolute;
  z-index: 2;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow:
    0 10px 28px -12px rgba(0, 0, 0, 0.55),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: opacity 600ms ease, background-color 200ms;
}

.reel.is-still .reel__skip {
  opacity: 0;
  pointer-events: none;
}

.reel__skip:hover {
  background: rgba(255, 255, 255, 0.38);
}

.reel__skip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reviews.is-open .page {
  animation: page-in 1500ms cubic-bezier(0.22, 0.08, 0.18, 1) both;
}

.reviews.is-open .hero,
.reviews.is-open .page .glass {
  animation: window-in 1300ms cubic-bezier(0.22, 0.08, 0.18, 1) both;
}

.reviews.is-open .page .top__back { animation-delay: 80ms; }
.reviews.is-open .hero { animation-delay: 180ms; }
.reviews.is-open .page .tabs { animation-delay: 320ms; }
.reviews.is-open .page .summary { animation-delay: 440ms; }
.reviews.is-open .page .write { animation-delay: 520ms; }
.reviews.is-open #reviews .review:nth-child(1) { animation-delay: 460ms; }
.reviews.is-open #reviews .review:nth-child(2) { animation-delay: 560ms; }
.reviews.is-open #reviews .review:nth-child(3) { animation-delay: 660ms; }
.reviews.is-open #reviews .review:nth-child(4) { animation-delay: 760ms; }
.reviews.is-open #reviews .review:nth-child(5) { animation-delay: 860ms; }
.reviews.is-open #reviews .review:nth-child(n + 6) { animation-delay: 960ms; }

@media (prefers-reduced-motion: reduce) {
  .reviews.is-active .reel { display: none; }
  .reviews.is-reeling { overflow: auto; }
  .reviews .page { opacity: 1; }
  .reviews.is-open .page,
  .reviews.is-open .hero,
  .reviews.is-open .page .glass { animation: none; }
}
