/* мяу-гав */

:root {
  --yellow: #FFD600;
  --blue:   #2B50FF;   /* на синем — белый текст */
  --red:    #FF4632;   /* на красном — чёрный текст */
  --ink:    #121212;
  --muted:  #2A2A2A;   /* вторичный текст */
  --label:  #3B3B3B;
  --ground: #F3F3EF;   /* фон страницы и серые карточки */
  --white:  #FFFFFF;
  --error:  #D4200C;

  --r-xl: 40px;        /* крупные островки */
  --r-lg: 36px;        /* карточки */
  --r-md: 18px;        /* поля формы */
  --r-pill: 999px;     /* кнопки, шапка, чипсы */

  --gap: 24px;         /* между островками */
  --container: 1280px;

  --font-head: 'Unbounded', system-ui, sans-serif;
  --font-text: 'Manrope', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--blue); }
p { margin: 0; }
img { max-width: 100%; }
input, textarea, button { font: inherit; }
input::placeholder, textarea::placeholder { color: #5A6690; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- каркас ---------- */

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.main {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.section { margin-top: 48px; scroll-margin-top: 24px; }

/* ---------- типографика ---------- */

.h1, .h2, .h3 { margin: 0; font-family: var(--font-head); font-weight: 700; }

.h1 {
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.h2 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.h3 { font-size: 26px; line-height: 1.15; }
.h3--lg { font-size: 34px; line-height: 1.1; }
.h3--sm { font-size: 24px; }

.lead { max-width: 620px; font-size: 20px; color: var(--muted); }
.lead--on-blue { max-width: 460px; color: var(--white); }

.muted { color: var(--muted); }

.eyebrow,
.label {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow { color: var(--label); }
.label--muted { font-size: 14px; letter-spacing: 0.06em; color: var(--label); }

/* ---------- островки ---------- */

.island {
  background: var(--white);
  border-radius: var(--r-xl);
}
.island--big { padding: 72px 64px; }
.island--yellow { background: var(--yellow); }
.island--blue { background: var(--blue); color: var(--white); }
.island--red { background: var(--red); }

/* ---------- шапка ---------- */

.header {
  background: var(--white);
  border-radius: var(--r-pill);
  padding: 14px 16px 14px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.logo:hover { color: var(--ink); }
.logo__word {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.brand { display: flex; align-items: center; gap: 10px; }

/* кошка и собака у логотипа: по клику говорят «мяу» и «гав» */
.pets { display: flex; gap: 8px; }

.pet {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.pet:hover { background: var(--ground); }
.pet__face { display: block; transition: transform .2s ease; }
.pet:hover .pet__face { transform: rotate(-10deg) scale(1.1); }
.pet.is-talking .pet__face { animation: pet-hop .45s ease; }

.pet__say {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px) scale(.6);
  transform-origin: 50% 100%;
  transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.6, .5, 1);
  z-index: 10;
}
/* хвостик облачка */
.pet__say::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: inherit;
}
.pet--cat .pet__say { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.pet--dog .pet__say { background: var(--blue); color: var(--white); border-color: var(--blue); }
.pet.is-talking .pet__say { opacity: 1; transform: translate(-50%, 0) scale(1); }

@keyframes pet-hop {
  0%   { transform: translateY(0) rotate(0); }
  40%  { transform: translateY(-6px) rotate(-12deg); }
  70%  { transform: translateY(0) rotate(8deg); }
  100% { transform: translateY(0) rotate(0); }
}

.dots { display: flex; gap: 4px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; }
.dots span:nth-child(1) { background: var(--yellow); }
.dots span:nth-child(2) { background: var(--blue); }
.dots span:nth-child(3) { background: var(--red); }
.dots--lg { gap: 6px; }
.dots--lg span { width: 20px; height: 20px; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nav__link {
  padding: 12px 18px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-weight: 500;
}
.nav__link--cta {
  padding: 12px 22px;
  font-weight: 700;
  background: var(--ink);
  color: var(--white);
}
.nav__link--cta:hover { background: var(--blue); color: var(--white); }

/* ---------- кнопки ---------- */

.buttons { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 18px 30px;
  border: none;
  border-radius: var(--r-pill);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--blue { background: var(--blue); color: var(--white); }
.btn--blue:hover { color: var(--white); filter: brightness(1.08); }
.btn--grey { background: var(--ground); color: var(--ink); }
.btn--grey:hover { color: var(--ink); filter: brightness(.96); }
.btn--yellow { background: var(--yellow); color: var(--ink); }

/* ---------- первый экран ---------- */

.hero { display: flex; flex-wrap: wrap; gap: var(--gap); }

.hero__main {
  flex: 999 1 560px;
  min-width: 0;
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}

.hero__art {
  flex: 1 1 340px;
  min-width: 0;
  min-height: 360px;
  position: relative;
  overflow: hidden;
}

.circle { position: absolute; border-radius: 50%; }
.circle--yellow { width: 220px; height: 220px; background: var(--yellow); top: 14%; left: 12%; }
.circle--blue   { width: 150px; height: 150px; background: var(--blue);   top: 42%; left: 48%; }
.circle--red    { width: 96px;  height: 96px;  background: var(--red);    top: 12%; left: 62%; }

/* ---------- секции и сетки ---------- */

#philosophy { display: flex; flex-direction: column; gap: 48px; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.section__head--bare { padding: 0 16px; }
.section__note { max-width: 460px; color: var(--muted); }

.grid { display: grid; gap: var(--gap); }
.grid--steps   { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--formats { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--works   { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--ground);
  border-radius: 32px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.num {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
}
.num--yellow { background: var(--yellow); }
.num--blue   { background: var(--blue); color: var(--white); }
.num--red    { background: var(--red); }

.format {
  border-radius: var(--r-xl);
  padding: 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
}

/* ---------- работы ---------- */

.works { display: flex; flex-direction: column; gap: 32px; }

.project {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project__shot {
  border-radius: 26px;
  height: 280px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px 28px 0;
}

.project__img {
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px 14px 0 0;
  display: block;
}
.project__img--wide  { width: 100%; }
.project__img--phone { width: 62%; }

.project__body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project__link { font-weight: 700; align-self: flex-start; }

.project--cta {
  background: var(--ink);
  color: var(--white);
  padding: 44px;
  justify-content: space-between;
  gap: 24px;
  text-decoration: none;
  min-height: 420px;
  transition: background .2s ease;
}
.project--cta:hover { color: var(--white); background: #000; }
.project--cta:hover .arrow-link svg { transform: translateX(4px); }

.project__cta-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.15;
}

.arrow-link { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.arrow-link svg { transition: transform .2s ease; }

/* ---------- связь ---------- */

.contact { display: flex; flex-wrap: wrap; gap: 56px; }

.contact__intro {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.meow {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  color: var(--yellow);
}

.form {
  flex: 1.3 1 440px;
  min-width: 0;
  background: var(--white);
  color: var(--ink);
  border-radius: 32px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form--done { justify-content: center; min-height: 240px; }
.form__thanks {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
}

.form__error { color: var(--error); font-weight: 700; }

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}
.field__label { font-weight: 700; font-size: 15px; padding: 0; }
.field--chips .field__label { margin-bottom: 10px; }

.field input[type="text"],
.field textarea {
  width: 100%;
  background: var(--ground);
  border: 2px solid transparent;
  border-radius: var(--r-md);
  padding: 16px 20px;
  color: var(--ink);
  transition: border-color .15s ease;
}
.field textarea { resize: vertical; }
.field input[type="text"]:focus,
.field textarea:focus { outline: none; border-color: var(--blue); }

.field--error input[type="text"],
.field--error textarea { border-color: var(--error); }
.field__error { color: var(--error); font-size: 15px; font-weight: 500; }

/* радиокнопки в виде таблеток */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ground);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease;
}
.chip:hover { background: #E6E6E0; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.chip:has(input:checked) { background: var(--ink); color: var(--white); }
.chip:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }

.btn--submit {
  padding: 20px 32px;
  min-height: 56px;
  font-family: var(--font-head);
  font-size: 18px;
}
.btn--submit:hover { filter: brightness(1.04); }

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- подвал ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 0;
  color: var(--label);
  font-size: 15px;
}
.footer__logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
}

/* ---------- ссылки на кейсы с главной ---------- */

.project__shot-link { display: block; border-radius: 26px; }
.project__shot-link .project__img { transition: transform .25s ease; }
.project__shot-link:hover .project__img { transform: translateY(-6px); }
.project__title-link { text-decoration: none; }
.project__title-link:hover { color: var(--blue); }
.project__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- страница кейса ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-weight: 700;
  text-decoration: none;
}

.case-hero { gap: 40px; }
.case-hero__text { display: flex; flex-direction: column; gap: 24px; }

.case-hero__shot { min-height: 420px; }
.case-hero__shot .project__img {
  position: absolute;
  top: 48px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 96px);
  height: calc(100% - 48px);
  object-position: top left;
}
.case-hero__shot .project__img--phone { width: min(300px, 62%); }

.case {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.cb { margin: 0; }
.cb--text,
.cb--quote,
.cb--facts { width: 100%; max-width: 760px; margin: 0 auto; }

.prose { display: flex; flex-direction: column; gap: 20px; }
.prose h2 {
  margin: 16px 0 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0; color: var(--muted); }
.prose ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.prose li::marker { color: var(--blue); }
.prose strong { color: var(--ink); }
/* Картинки в кейсах. У каждого вида своя предельная высота:
   скриншоты обрезаются снизу (как в карточках на главной),
   иллюстрации в тексте вписываются целиком в серую рамку. */
.case {
  --shot-wide: 640px;
  --shot-phone: 560px;
  --shot-gallery: 480px;
  --shot-inline: 480px;
  --shot-row: 400px;
}

.prose figure { margin: 16px 0; }
.figure-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: var(--ground);
  border-radius: 24px;
}
.figure-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: var(--shot-inline);
  border-radius: 12px;
}
/* картинки, идущие в тексте подряд, — в ряд одинаковой высоты */
.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.figure-row figure { margin: 0; }
.figure-row .figure-frame { height: var(--shot-row); padding: 16px; }
.figure-row .figure-frame img { max-height: 100%; }

.prose figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 15px;
  color: var(--label);
}

.cb--image img,
.cb__gallery img {
  display: block;
  max-width: 100%;
  object-fit: cover;
  object-position: top center;
}

.cb--wide img {
  width: 100%;
  height: auto;
  max-height: var(--shot-wide);
  border-radius: 24px;
}

.cb__backing {
  border-radius: 32px;
  padding: 48px 32px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.cb--phone .cb__backing img {
  width: min(320px, 100%);
  height: auto;
  max-height: var(--shot-phone);
  border-radius: 20px 20px 0 0;
}

.cb__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  align-items: end;
}
.cb__gallery img {
  width: 100%;
  height: var(--shot-gallery);
  border-radius: 20px 20px 0 0;
}

.cb figcaption,
.cb--image figcaption,
.cb--gallery figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 15px;
  color: var(--label);
}

.cb--quote blockquote {
  margin: 0;
  position: relative;
  padding-left: 40px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.3;
}
.cb--quote blockquote::before {
  content: "«";
  position: absolute;
  left: 0;
  top: -6px;
  color: var(--blue);
  font-weight: 800;
}
.cb--quote figcaption { text-align: left; padding-left: 40px; margin-top: 16px; font-weight: 700; }

.cb--facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.fact {
  background: var(--ground);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fact dd {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.case-footer { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: 24px; }
.next-case { text-decoration: none; }
.next-case:hover { color: var(--ink); }
.next-case:hover .project__img { transform: translateY(-6px); }
.next-case .project__img { transition: transform .25s ease; }
.next-case:hover .arrow-link svg { transform: translateX(4px); }

/* ---------- телефон ---------- */

@media (max-width: 720px) {
  .page { padding: 28px 12px 32px; }  /* сверху место для «мяу» и «гав» */
  .section { margin-top: 24px; }

  .header { border-radius: 32px; padding: 12px 12px 12px 20px; }
  .nav__link { padding: 10px 12px; }
  .nav__link--cta { padding: 10px 16px; }

  .island--big,
  .hero__main { padding: 40px 24px; }
  .hero__main { gap: 32px; }
  .hero__art { min-height: 260px; }
  .circle--yellow { width: 150px; height: 150px; }
  .circle--blue   { width: 110px; height: 110px; }
  .circle--red    { width: 70px;  height: 70px; }

  #philosophy { gap: 32px; }
  .card { padding: 28px; }
  .format { padding: 32px 28px; min-height: 0; }
  .h3--lg { font-size: 28px; }

  .grid--works { grid-template-columns: 1fr; }
  .project__shot { height: 240px; padding: 20px 20px 0; }
  .project--cta { padding: 32px; min-height: 320px; }
  .project__cta-title { font-size: 26px; }

  .contact { gap: 32px; }

  .case-hero__shot { min-height: 340px; }
  .case-hero__shot .project__img { top: 32px; width: calc(100% - 48px); height: calc(100% - 32px); }
  .case { gap: 32px; }
  .case {
    --shot-wide: 420px;
    --shot-phone: 440px;
    --shot-gallery: 380px;
    --shot-inline: 360px;
    --shot-row: 320px;
  }
  .cb__backing { padding: 32px 20px 0; border-radius: 24px; }
  .cb--wide img { border-radius: 16px; }
  .cb--phone .cb__backing img, .cb__gallery img { border-radius: 16px 16px 0 0; }
  /* на телефоне галерея листается вбок */
  .cb__gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .cb__gallery::-webkit-scrollbar { display: none; }
  .cb__gallery img { flex: 0 0 78%; scroll-snap-align: center; }
  .figure-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .figure-row::-webkit-scrollbar { display: none; }
  .figure-row figure { flex: 0 0 78%; scroll-snap-align: center; }
  .figure-frame { padding: 16px; border-radius: 18px; }
  .cb--quote blockquote, .cb--quote figcaption { padding-left: 28px; }
  .case-footer { grid-template-columns: 1fr; }
  .form { padding: 24px; border-radius: 28px; }
  .form__thanks { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
