/* =========================================================
   Berdicool — главная страница
   Сетка: три колонки 600 / 396 / 396 (при ширине 1440), поля 24px.
   Ширины экрана: 1200+ · 960–1199 · 640–959 · до 639 (телефон)
   ========================================================= */
body.home { background: #000; }
.home .page { background: #fff; }

/* заголовки на планшетах чуть меньше (как на живом сайте) */
@media (max-width: 1199px) and (min-width: 960px) { .h-xl { font-size: 36px; line-height: 41px; letter-spacing: -1.6px; } }
@media (max-width: 959px) and (min-width: 640px)  { .h-xl { font-size: 32px; line-height: 37px; letter-spacing: -1.2px; } }

/* ================= Первый экран ================= */
.hero {
  position: relative; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 560px;
  background: var(--red); color: #fff;
}
.bc-mark3d { position: absolute; inset: 0; overflow: hidden; }
.bc-mark3d canvas { position: relative; display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; max-width: none; }
.bc-mark-flat { position: absolute; left: 50%; top: 50%; height: 57%; max-width: 42%; aspect-ratio: 45/53; transform: translate(-50%, -50%); pointer-events: none; transition: opacity .5s ease; }
.bc-mark3d.bc-3d-ready .bc-mark-flat { opacity: 0; }

.hero__mail { position: absolute; left: 24px; top: 32px; letter-spacing: 0; transition: opacity .2s ease; }
.hero__btn {
  position: absolute; right: 29px; top: 12px; width: 196px; height: 58px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid #fff; border-radius: 12px;
  font-size: 14px;
  transition: background-color .2s ease, color .2s ease;
}
.hero__btn svg { width: 16px; height: 16px; transition: transform .3s ease; }
@media (hover: hover) {
  .hero__mail:hover { opacity: .7; }
  .hero__btn:hover { background: #fff; color: var(--red); }
  .hero__btn:hover svg { transform: translate(2px, -2px); }
}

.hero__circle {
  position: absolute; left: 50%; top: 50%;
  width: 216px; height: 216px; margin: -108px 0 0 -108px;
  border: 1px dashed #fff; border-radius: 50%;
  pointer-events: none;
}
.hero__word {
  position: absolute; top: 50%; margin-top: -90px;
  font-size: 200px; line-height: 180px; font-weight: 500; letter-spacing: -12px;
  pointer-events: none; user-select: none; white-space: nowrap;
}
.hero__word--l { left: 24px; }
.hero__word--r { right: 36px; }
.hero__title {
  position: absolute; left: 24px; bottom: 24px; width: 470px;
  font-size: 40px; line-height: 46px; letter-spacing: -1.6px; font-weight: 500;
  pointer-events: none;
}
.hero__desc { position: absolute; right: 24px; bottom: 23px; width: 400px; font-size: 14px; line-height: 18px; pointer-events: none; }

@media (max-width: 1199px) {
  .hero__circle { width: 180px; height: 180px; margin: -90px 0 0 -90px; }
  .hero__word { font-size: 150px; line-height: 135px; letter-spacing: -9px; margin-top: -67px; }
  .hero__word--r { right: 28px; }
  .hero__title { width: 400px; font-size: 32px; line-height: 37px; letter-spacing: -1.3px; bottom: 23px; }
  .hero__desc { width: 383px; right: 41px; }
}
@media (max-width: 959px) {
  .hero__mail, .hero__btn { display: none; }
  .hero__circle { width: 140px; height: 140px; margin: -70px 0 0 -70px; }
  .hero__word { font-size: 100px; line-height: 90px; letter-spacing: -6px; margin-top: -45px; }
  .hero__word--r { right: 24px; }
  .hero__title { width: 380px; font-size: 28px; line-height: 32px; letter-spacing: -1.1px; bottom: 25px; }
  .hero__desc { left: 24px; right: auto; width: 380px; bottom: 140px; }
  .bc-mark-flat { height: 38%; max-width: 80%; }
}
@media (max-width: 639px) {
  /* телефон: berdi сверху слева от круга, cool снизу справа */
  .hero__circle { width: 150px; height: 150px; margin: -75px 0 0 -75px; }
  .hero__word { font-size: 64px; line-height: 58px; letter-spacing: -4px; margin-top: 0; }
  .hero__word--l { left: 16px; top: calc(50% - 141px); }
  .hero__word--r { right: 16px; top: calc(50% + 83px); }
  .hero__title { left: 16px; width: 243px; font-size: 22px; line-height: 25px; letter-spacing: -0.9px; bottom: 17px; }
  .hero__desc { left: 16px; width: min(327px, calc(100% - 32px)); font-size: 12px; line-height: 15px; bottom: 103px; }
}

/* ================= О нас ================= */
.about { padding: 160px var(--pad); background: #fff; }
.about__lead { max-width: 1200px; }
.about__cols { display: grid; grid-template-columns: 600fr 396fr 396fr; margin-top: 96px; }
.about__col { border-left: 1px solid #e6e6e6; padding-left: 36px; display: flex; flex-direction: column; align-items: flex-start; }
.about__col--first { border: 0; padding: 0; }
.about__col--first p { margin-top: 37px; max-width: 236px; }
.about__text { margin-top: 20px; max-width: 300px; min-height: 54px; display: flex; align-items: center; }
.about__num { display: flex; align-items: center; gap: 24px; margin-top: 68px; }
.about__big { font-size: 112px; line-height: 101px; letter-spacing: -5.6px; font-weight: 500; }
.about__num .t-s { max-width: 120px; }
.about__col > .arrow-link, .about__col > .t-m { margin-top: 68px; }

@media (max-width: 1199px) {
  .about { padding: 120px var(--pad); }
  .about__cols { margin-top: 80px; }
  .about__col { padding-left: 6px; border-left: 0; }
  .about__col--first { padding: 0; }
  .about__text { max-width: 229px; min-height: 72px; align-items: flex-start; }
  .about__big { font-size: 88px; line-height: 79px; }
  .about__num .t-s { max-width: 100px; }
}
@media (max-width: 959px) {
  .about { padding: 80px var(--pad); }
  .about__cols { display: block; margin-top: 48px; }
  .about__col { padding: 24px 0 0; margin-top: 48px; border-top: 1px solid #e6e6e6; }
  .about__col--first { border: 0; padding: 0; margin: 0; }
  .about__col--first p { margin-top: 20px; max-width: 334px; }
  .about__text { margin-top: 16px; max-width: 270px; min-height: 0; }
  .about__num { margin-top: 32px; }
  .about__big { font-size: 80px; line-height: 72px; letter-spacing: -4px; }
  .about__num .t-s { max-width: 130px; }
  .about__col > .arrow-link, .about__col > .t-m { margin-top: 32px; }
}

/* ================= Кейсы ================= */
.cases { padding: 40px var(--pad) 160px; background: #fff; }
.cases__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 64px; }
.cases__head h2 { max-width: 420px; }
.cases__head p { max-width: 362px; }
.cases__row { display: grid; grid-template-columns: 600fr 792fr; align-items: start; }
.cases__row--rev { grid-template-columns: 792fr 600fr; }
.cases__row + .cases__row, .cases__extra { margin-top: 120px; }
.card { display: block; min-width: 0; }
.card--s { width: 72%; }
.cases__row--rev .card--s { justify-self: end; }
.card__img { height: 492px; overflow: hidden; background: #f4f4f4; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.card__cap { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.card__year { flex: none; }
@media (hover: hover) { .card:hover .card__img img { transform: scale(1.06); } }
.cases__toggle { margin-top: 64px; }

/* «Все кейсы»: ряды выплывают снизу по очереди, при закрытии плавно гаснут */
.cases__extra[hidden] { display: none; }
@keyframes case-row-in { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes cases-out { from { opacity: 1; } to { opacity: 0; } }
.cases__extra.is-open .cases__row { animation: case-row-in 1s cubic-bezier(.22, 1, .36, 1) both; }
.cases__extra.is-open .cases__row:nth-child(2) { animation-delay: .15s; }
.cases__extra.is-open .cases__row:nth-child(3) { animation-delay: .3s; }
.cases__extra.is-closing { animation: cases-out .3s ease both; }

@media (max-width: 1199px) {
  .cases__row { grid-template-columns: 410fr 542fr; }
  .cases__row--rev { grid-template-columns: 542fr 410fr; }
  .card--s { width: 92.1%; }
  .card__img { height: 360px; }
}
@media (max-width: 959px) {
  .cases { padding-bottom: 80px; }
  .cases__head { display: block; margin-bottom: 40px; }
  .cases__head h2 { max-width: none; }
  .cases__head p { margin-top: 16px; max-width: 380px; }
  .cases__row, .cases__row--rev { display: block; }
  .card, .card--s { width: 100%; }
  .card + .card, .cases__row + .cases__row, .cases__extra { margin-top: 40px; }
  .card__img { height: 460px; }
  .cases__toggle { margin-top: 40px; }
}
@media (max-width: 639px) {
  .card__img { height: auto; aspect-ratio: 342 / 380; }
  .cases__head p { max-width: 259px; }
}

/* ================= Услуги ================= */
.services { position: relative; display: grid; grid-template-columns: 600fr 792fr; padding: 140px var(--pad); background: #000; color: #fff; }
.services__left { display: flex; flex-direction: column; justify-content: space-between; }
.services__left h2 { max-width: 440px; }
.services__note { max-width: 380px; }
.acc__item { border-top: 1px solid var(--line); }
.acc__item:last-child { border-bottom: 1px solid var(--line); }
.acc__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  width: 100%; padding: 36px 0; text-align: left;
  font-size: 32px; line-height: 1.15; letter-spacing: -1.28px; font-weight: 500;
  transition: color .2s ease;
}
.acc__btn svg { flex: none; width: 32px; height: 32px; transition: transform .4s ease; }
.acc__btn[aria-expanded="true"] svg { transform: rotate(45deg); }
@media (hover: hover) { .acc__btn:hover { color: var(--red); } }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.4, 0, .2, 1); }
.acc__panel > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .45s; }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__item.is-open .acc__panel > div { visibility: visible; transition-delay: 0s; }
.acc__text { padding: 0 64px 36px 0; font-size: 16px; line-height: 1.3; letter-spacing: -0.16px; }
.acc__dim { color: #878787; }
.acc__dim strong { font-weight: 700; }

@media (max-width: 1199px) { .services { padding: 120px var(--pad); grid-template-columns: 410fr 542fr; } .services__left h2 { max-width: 390px; } .services__note { max-width: 340px; } }
@media (max-width: 959px) {
  .services { display: block; padding: 80px var(--pad); }
  .services__left { display: block; margin-bottom: 40px; }
  .services__left h2, .services__note { max-width: 520px; }
  .services__note { margin-top: 16px; }
}
@media (max-width: 639px) {
  .acc__btn { padding: 20px 0; font-size: 24px; letter-spacing: -0.96px; gap: 16px; }
  .acc__btn svg { width: 24px; height: 24px; }
  .acc__text { padding: 0 0 20px; }
  .services__note { max-width: 312px; }
}

/* ================= Клиенты ================= */
.clients { padding: 160px var(--pad) 120px; background: #fff; }
.clients__head { display: grid; grid-template-columns: 25.86% 1fr; }
.clients__head h2 { max-width: 900px; }
.clients__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 64px; }
.clients__grid li { aspect-ratio: 330 / 216; background: #f4f4f4; display: flex; align-items: center; justify-content: center; }
.clients__grid img { width: calc(var(--w) / 330 * 100%); height: auto; }

@media (max-width: 1199px) {
  .clients { padding: 120px var(--pad) 120px; }
  .clients__grid li { aspect-ratio: 220 / 160; }
  .clients__grid img { width: calc(var(--w) / 330 * 105%); }
}
@media (max-width: 959px) {
  .clients { padding: 80px var(--pad); }
  .clients__head { display: block; }
  .clients__head h2 { margin-top: 24px; }
  .clients__grid { grid-template-columns: repeat(2, 1fr); }
  .clients__grid li { aspect-ratio: 314 / 148; }
  .clients__grid img { width: calc(var(--w) / 330 * 85%); }
}
@media (max-width: 639px) {
  .clients__grid { gap: 12px; margin-top: 40px; }
  .clients__grid li { aspect-ratio: 165 / 108; }
  .clients__grid img { width: calc(var(--w) / 330 * 100%); }
}

/* ================= Контакты ================= */
.contacts { display: grid; grid-template-columns: 600fr 792fr; padding: 120px var(--pad) 140px; background: #fff; }
.contacts__card { max-width: 576px; }
.contacts__photo { width: 364px; max-width: 100%; height: 259px; overflow: hidden; }
.contacts__photo img { width: 100%; height: 100%; object-fit: cover; }
.contacts__card .h-m { margin-top: 24px; }
.contacts__text { margin-top: 24px; max-width: 303px; }
.contacts__card .arrow-link { margin-top: 24px; }
.contacts__data { display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; padding-top: 32px; border-top: 1px solid #e6e6e6; }
.contacts__item + .contacts__item { margin-top: 40px; }
.contacts__item a { display: block; margin-top: 12px; transition: color .2s ease; }
.contacts__social { display: grid; justify-items: start; }
.contacts__social a + a { margin-top: 12px; }
@media (hover: hover) { .contacts__item a:hover { color: var(--red); } }

@media (max-width: 1199px) {
  .contacts { grid-template-columns: 410fr 542fr; padding-bottom: 120px; }
  .contacts__photo { height: 176px; }
  .contacts__card { padding-right: 24px; }
}
@media (max-width: 959px) {
  .contacts { display: flex; flex-direction: column-reverse; padding: 40px var(--pad) 80px; }
  .contacts__card { max-width: none; padding: 0; margin-top: 60px; }
  .contacts__photo { width: 100%; height: 300px; }
  .contacts__card .h-m, .contacts__text, .contacts__card .arrow-link { margin-top: 16px; }
  .contacts__text { max-width: 363px; }
  .contacts__data { display: block; margin-top: 28px; }
  .contacts__col + .contacts__col { margin-top: 40px; }
  .contacts__item a { margin-top: 10px; }
  .contacts__social { display: flex; flex-wrap: wrap; gap: 0 20px; }
  .contacts__social a + a { margin-top: 10px; }
}
@media (max-width: 639px) {
  .contacts__photo { height: 220px; }
}
