/* Responsive hardening */
.site-header .button--header {
  width: auto;
  flex: 0 0 auto;
}

.hero {
  min-height: min(860px, calc(100svh - 104px));
  overflow: hidden;
}

.hero__inner {
  min-height: inherit;
  padding: 56px 0;
}

.hero__content {
  width: min(620px, 39vw);
  transform: none;
}

.hero__visual {
  overflow: hidden;
}

.hero__visual img {
  right: 0;
  transform: none;
}

.hero h1,
.portfolio-copy h2,
.services-heading h2,
.about-copy h2,
.about-scene__content h3,
.process-heading h2,
.contacts-intro h2,
.legal-page h1 {
  letter-spacing: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.hero h1 {
  font-size: 64px;
}

.hero h1 span {
  white-space: normal;
}

.portfolio-copy h2 {
  font-size: 64px;
}

.portfolio-copy > p:last-child {
  font-size: 17px;
}

.portfolio-case h3 {
  font-size: 27px;
}

.services-heading h2 {
  font-size: 56px;
  white-space: normal;
}

.service-card__copy h3 {
  font-size: 28px;
  letter-spacing: 0;
}

.service-card--websites .service-card__copy h3 {
  font-size: 32px;
}

.service-card__copy p {
  letter-spacing: 0;
}

.about-copy h2 {
  font-size: 68px;
}

.about-scene__content h3 {
  font-size: 32px;
}

.about-scene__content p {
  white-space: normal;
}

.about-benefit h3 {
  font-size: 24px;
}

.process-heading h2 {
  font-size: 64px;
}

.process-heading > p:last-child {
  font-size: 18px;
}

.process-card h3 {
  font-size: 28px;
}

.contacts-intro h2 {
  font-size: 60px;
}

.contacts-lead {
  font-size: 17px;
}

.legal-page h1 {
  font-size: 60px;
}

.legal-page p {
  font-size: 17px;
}

@media (min-width: 1600px) {
  .hero h1 {
    font-size: 68px;
  }
}

@media (max-width: 1360px) and (min-width: 1181px) {
  .hero__content {
    width: min(560px, 42vw);
  }

  .hero h1 {
    font-size: 58px;
  }

  .hero__visual img {
    transform: scale(0.72);
    transform-origin: center right;
  }
}

@media (max-width: 1180px) {
  .hero {
    min-height: auto;
    padding-bottom: 30px;
  }

  .hero__inner {
    min-height: auto;
    padding: 62px 0 0;
  }

  .hero__content {
    width: 100%;
    max-width: 760px;
  }

  .hero h1 {
    max-width: 720px;
    font-size: 56px;
  }

  .hero__visual {
    position: relative;
    inset: auto;
    display: block;
    width: 100%;
    height: 520px;
    margin-top: 30px;
  }

  .hero__visual::after {
    background: linear-gradient(180deg, #fff 0%, transparent 16%);
  }

  .hero__visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    transform: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 90%, transparent 100%);
  }

  .portfolio-copy h2,
  .about-copy h2,
  .process-heading h2,
  .contacts-intro h2 {
    font-size: 56px;
  }

  .services-heading h2 {
    font-size: 50px;
  }

  .portfolio-case h3,
  .service-card__copy h3,
  .service-card--websites .service-card__copy h3,
  .about-benefit h3,
  .process-card h3 {
    font-size: 26px;
  }

  .about-scene__content h3 {
    font-size: 30px;
  }
}

@media (max-width: 860px) {
  .hero__inner {
    padding-top: 52px;
  }

  .hero h1 {
    font-size: 50px;
  }

  .hero__visual {
    height: 420px;
    margin-top: 26px;
  }

  .portfolio-copy h2,
  .about-copy h2,
  .process-heading h2,
  .contacts-intro h2 {
    font-size: 48px;
  }

  .services-heading h2 {
    font-size: 44px;
  }

  .portfolio-case h3,
  .service-card__copy h3,
  .service-card--websites .service-card__copy h3,
  .about-benefit h3,
  .process-card h3 {
    font-size: 24px;
  }

  .portfolio-copy > p:last-child,
  .process-heading > p:last-child,
  .contacts-lead {
    font-size: 16px;
  }
}

@media (max-width: 680px) {
  .hero {
    padding-bottom: 22px;
  }

  .hero__inner {
    padding-top: 44px;
  }

  .hero__eyebrow {
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero__lead {
    font-size: 14px;
  }

  .hero__visual {
    height: 320px;
    margin-top: 22px;
  }

  .hero__visual img {
    object-position: 57% center;
  }

  .portfolio-copy h2,
  .about-copy h2,
  .process-heading h2,
  .contacts-intro h2 {
    font-size: 40px;
  }

  .services-heading h2 {
    font-size: 36px;
  }

  .portfolio-case h3,
  .service-card__copy h3,
  .service-card--websites .service-card__copy h3,
  .about-benefit h3,
  .process-card h3 {
    font-size: 22px;
  }

  .portfolio-copy > p:last-child,
  .services-heading__intro > p,
  .process-heading > p:last-child,
  .contacts-lead {
    font-size: 14px;
  }

  .service-card,
  .service-card--websites,
  .service-card--webapps,
  .service-card--miniapps,
  .service-card--bots,
  .service-card--mobile {
    min-height: 350px;
  }

  .about-scene:first-child .about-scene__image,
  .about-scene.is-active:first-child .about-scene__image {
    object-position: center;
    transform: none;
  }
}

@media (max-width: 520px) {
  .process-steps {
    --process-gutter: 0px;
    width: 100%;
    padding-left: 0;
    gap: 16px;
  }

  .process-steps::before,
  .process-step::before,
  .process-step__icon {
    display: none;
  }

  .process-card {
    width: 100%;
    min-height: 300px;
  }

  .process-card__content {
    min-height: 300px;
    padding-bottom: 112px;
  }

  .process-card__visual img,
  .process-card--talk .process-card__visual img,
  .process-card--analysis .process-card__visual img,
  .process-card--contract .process-card__visual img,
  .process-card--launch .process-card__visual img,
  .process-card--support .process-card__visual img,
  .process-card--growth .process-card__visual img {
    position: absolute;
    inset: auto 0 0;
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center bottom;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.34) 30%, #000 62%);
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.34) 30%, #000 62%);
  }

  .process-card__content::after {
    bottom: 112px;
  }

  .footer-cta {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .container {
    width: calc(100% - 24px);
  }

  .hero {
    padding-bottom: 16px;
  }

  .hero__inner {
    padding-top: 34px;
  }

  .hero__eyebrow {
    display: grid;
    width: 100%;
    padding: 10px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
    border-radius: 14px;
    text-align: center;
  }

  .hero__eyebrow i {
    display: none;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero__visual {
    height: 230px;
    margin-top: 18px;
  }

  .portfolio-copy h2,
  .about-copy h2,
  .contacts-intro h2 {
    font-size: 34px;
  }

  .process-heading h2 {
    font-size: 36px;
  }

  .services-heading h2 {
    font-size: 30px;
  }

  .portfolio-case h3,
  .service-card__copy h3,
  .service-card--websites .service-card__copy h3,
  .about-scene__content h3,
  .about-benefit h3,
  .process-card h3 {
    font-size: 21px;
  }

  .portfolio-shot {
    min-height: 0;
  }

  .service-card,
  .service-card--websites,
  .service-card--webapps,
  .service-card--miniapps,
  .service-card--bots,
  .service-card--mobile {
    min-height: 320px;
  }

  .process-card,
  .process-card__content {
    min-height: 300px;
  }

  .process-card__content {
    padding-bottom: 112px;
  }

  .contacts-intro h2 br {
    display: none;
  }

  .contact-form-wrap {
    padding: 18px 12px;
    border-radius: 18px;
  }

  .contact-form__head {
    gap: 10px;
  }

  .contact-form__call-art {
    width: 52px;
  }

  .contact-consent small {
    font-size: 12.5px;
  }

  .legal-page h1 {
    font-size: 34px;
  }

  .legal-page p {
    font-size: 15px;
  }
}

/* Desktop navigation, mobile burger */
.header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(18px, 2.2vw, 36px);
}

.site-header .brand {
  grid-column: 1;
}

.header-actions {
  grid-column: 3;
}

.desktop-nav {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.1vw, 38px);
  font-size: 13px;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.desktop-nav a {
  position: relative;
  padding: 12px 0;
  white-space: nowrap;
  transition: color 180ms ease;
}

.desktop-nav a::after {
  position: absolute;
  right: 0;
  bottom: 6px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: #0758f8;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.menu-toggle {
  display: none;
}

@media (hover: hover) {
  .desktop-nav a:hover {
    color: #0758f8;
  }

  .desktop-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .header-inner {
    gap: 18px;
  }

  .desktop-nav {
    gap: 18px;
    font-size: 12px;
  }

  .header-socials--desktop {
    display: none;
  }

  .site-header .button--header {
    padding: 0 15px;
  }
}

@media (min-width: 761px) {
  .header-menu {
    display: none;
  }
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-actions {
    grid-column: 2;
  }

  .desktop-nav,
  .header-socials--desktop {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  .header-menu {
    display: block;
  }
}

@media (min-width: 1181px) {
  .hero {
    --hero-desktop-offset: -100px;

    min-height: calc(100svh - 83px);
    overflow: visible;
  }

  .hero__inner {
    min-height: calc(100svh - 83px);
    padding: 46px 0 38px;
  }

  .hero__content {
    width: min(640px, 47%);
    max-width: none;
    transform: translateY(var(--hero-desktop-offset));
  }

  .hero h1 {
    max-width: 630px;
  }

  .hero h1 span {
    white-space: nowrap;
  }

  .hero__visual {
    position: absolute;
    inset: 0;
    width: 100%;
    height: auto;
    margin: 0;
    overflow: visible;
  }

  .hero__visual img {
    position: absolute;
    top: 50%;
    right: -120px;
    bottom: auto;
    left: auto;
    width: min(84vw, 1916px);
    height: auto;
    max-width: none;
    object-fit: contain;
    object-position: center;
    transform: translateY(calc(-50% + var(--hero-desktop-offset)));
    transform-origin: center right;
  }
}

@media (max-width: 1552px) and (min-width: 1181px) {
  .hero__visual img {
    width: 79vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .process-card__content::after {
    background-size: var(--process-progress, 100%) 100%;
    transition: none;
  }

  .contact-channel,
  .contact-channel > svg,
  .contact-field,
  .custom-select__icon,
  .custom-select__icon svg,
  .custom-select__menu,
  .custom-select__option,
  .contact-consent__box,
  .contact-consent svg,
  .contact-consent a,
  .contact-submit,
  .contact-submit::before,
  .contact-submit svg,
  .footer-nav a,
  .footer-docs a,
  .footer-social,
  .footer-cta,
  .footer-cta svg,
  .menu-toggle,
  .menu-toggle__lines i,
  .header-menu,
  .header-menu__backdrop,
  .header-menu__panel,
  .header-menu .main-nav a,
  .header-menu__social {
    transition: none;
  }
}

/* Mobile hero: keep the intro balanced and the category badge on one line. */
@media (max-width: 820px) {
  .hero__content {
    margin-inline: auto;
    text-align: center;
  }

  .hero__eyebrow {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
    white-space: nowrap;
  }

  .hero__eyebrow i {
    display: block;
    flex: 0 0 3px;
  }

  .hero h1,
  .hero__lead {
    margin-right: auto;
    margin-left: auto;
  }

  .hero__buttons {
    justify-content: center;
  }

  /* iOS Safari zooms the viewport when a focused form control is below 16px. */
  .contact-field input,
  .contact-field select,
  .contact-field textarea,
  .project-quiz__field input,
  .project-quiz__field textarea {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .hero__eyebrow {
    padding: 8px clamp(7px, 2.4vw, 11px);
    gap: clamp(4px, 1.7vw, 8px);
    border-radius: 999px;
    font-size: clamp(6px, 1.8vw, 8px);
  }
}
