:root {
  --gap: 14px;
  --pad-x: clamp(20px, 5vw, 80px);
  --pad-y: clamp(24px, 4vw, 48px);

  --color-ultramarine: #0e1f52;
  --color-cobalt: #1f4fa8;
  --color-turquoise: #3fb3b6;
  --color-cream: #fdf6ea;
}

@media (max-width: 640px) {
  :root {
    --gap: 8px;
  }
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--color-cream);
  font-family: "Golos Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* read by screen readers, hidden on screen */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero, a rounded card inset from the page edges, full screen on a phone */
.hero {
  position: relative;
  height: calc(100vh - 2 * var(--gap));
  height: calc(100svh - 2 * var(--gap));
  min-height: 620px;
  margin: var(--gap);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-cobalt);
  color: #fff;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* keep the person on the hill in view when the screen is narrow */
  object-position: 70% center;
}

/* a tall phone screen crops the picture hard, so it moves left until the person on the hill is whole in view */
@media (max-width: 640px) {
  .hero {
    height: 100vh;
    height: 100svh;
    margin: 0;
    border-radius: 0;
  }

  .hero__image {
    object-position: 82% center;
  }
}

/* darken the image so text stays readable, more at the top and bottom, and on the left behind the text */
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    /* fades out before the man on the right, so that side of the painting stays bright */
    linear-gradient(
      to right,
      rgba(14, 31, 82, 0.4),
      rgba(14, 31, 82, 0.2) 40%,
      rgba(14, 31, 82, 0) 65%
    ),
    linear-gradient(
      to bottom,
      rgba(14, 31, 82, 0.5),
      rgba(14, 31, 82, 0.15) 60%,
      rgba(14, 31, 82, 0.4)
    );
  pointer-events: none;
}

.hero__header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: var(--pad-y) var(--pad-x);
}

.brand {
  font-weight: 800;
  font-size: 22px;
}

.brand b {
  color: var(--color-turquoise);
}

.lang-switcher__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}

/* a popover, so the browser handles outside taps, Esc, aria-expanded and one open list at a time */
.lang-switcher__menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: rgba(14, 31, 82, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* .\:popover-open is the class the polyfill sets in browsers without popover */
.lang-switcher__menu:is(:popover-open, .\:popover-open) {
  display: flex;
}

/* an open popover sits in the top layer, anchor positioning puts it back next to its button */
@supports (position-area: bottom) {
  .hero__header .lang-switcher__btn {
    anchor-name: --lang-hero;
  }

  .hero__header .lang-switcher__menu {
    position-anchor: --lang-hero;
    position-area: bottom span-left;
    margin: 6px 0 0;
  }
}

/* without anchor positioning (iOS 17 to 25) the list opens in the middle of the screen, over a dimmed page */
@supports not (position-area: bottom) {
  .lang-switcher__menu::backdrop {
    background: rgba(14, 31, 82, 0.4);
  }
}

.lang-switcher__menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: #fff;
  transition: background 0.2s;
}

.lang-switcher__menu a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-switcher__flag {
  width: 20px;
  height: 20px;
  margin-right: 2px;
  border-radius: 50%;
}

.hero__content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 0 var(--pad-x) 60px;
  /* the extra space below lifts the text off the glowing horizon and the city, onto the deeper blue sky */
  padding-bottom: clamp(60px, 26svh, 240px);
}

.hero__title {
  font-weight: 700;
  font-size: clamp(36px, 5.2vw, 80px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  /* the title sits over a bright sky, so a soft shadow keeps it readable */
  text-shadow: 0 2px 18px rgba(14, 31, 82, 0.55);
}

/* the typed word sits alone on its line, so typing and erasing it never moves the rest of the title */
.hero__typed {
  display: block;
  color: var(--color-turquoise);
  white-space: nowrap;
}

/* the cursor is a pseudo-element, so main.js only has to change the text */
.hero__typed.is-running::after {
  content: "";
  display: inline-block;
  width: 0.15em;
  height: 0.78em;
  margin-left: 0.08em;
  vertical-align: -0.04em;
  border-radius: 2px;
  background: #fff;
  /* the same soft shadow as the title text, which text-shadow does not give a box */
  box-shadow: 0 2px 18px rgba(14, 31, 82, 0.55);
  animation: hero-cursor-blink 1s steps(1) infinite;
}

/* like a real cursor, it stays solid while typing and blinks while waiting */
.hero__typed.is-typing::after {
  animation: none;
}

@keyframes hero-cursor-blink {
  50% { opacity: 0; }
}

.hero__offer {
  max-width: 560px;
  /* the flex gap would leave it as far from the title as from the buttons */
  margin-top: -16px;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.45;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(14, 31, 82, 0.55);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

/* cream pill like the painted clouds, with a cobalt arrow circle from the sky */
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 8px 8px 8px 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(253, 246, 234, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-ultramarine);
  font-weight: 500;
  font-size: 17px;
  transition: background 0.25s;
}

.hero__cta:hover {
  background: #fff;
}

.hero__cta-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-cobalt);
  color: #fff;
  font-size: 18px;
  transition: transform 0.25s;
}

.hero__cta:hover .hero__cta-arrow {
  transform: rotate(-45deg);
}

/* phones get the Telegram button and this link in place of the consultation button */
.hero__tg,
.hero__services {
  display: none;
}

/* the arrow hints that the page goes on below the hero, phones have the services link instead */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: var(--pad-y);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(14, 31, 82, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(-50%);
  animation: hero-scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* bottom-right sits over the grass, so it gets a dark glass pill to stay readable */
.hero__phone {
  position: absolute;
  right: var(--pad-x);
  bottom: var(--pad-y);
  z-index: 1;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(14, 31, 82, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.02em;
}

/* ---------- Services ---------- */

.services {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--pad-x);
  color: var(--color-ultramarine);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-eyebrow {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-turquoise);
}

.section-title {
  font-weight: 800;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.section-lead {
  max-width: 560px;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.55;
  text-wrap: pretty;
  color: rgba(14, 31, 82, 0.7);
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  list-style: none;
}

.service {
  /* leave room for the sticky top bar when jumping to a card from a footer link */
  scroll-margin-top: 90px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(20px, 2.5vw, 32px);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(14, 31, 82, 0.04), 0 20px 50px -30px rgba(14, 31, 82, 0.25);
}

/* every second card swaps sides, so five cards in a row do not read as one long column */
.service:nth-child(even) .service__panel {
  order: -1;
}

.service__body {
  padding: 8px clamp(0px, 1.5vw, 16px);
}

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

  .service:nth-child(even) .service__panel {
    order: 0;
  }

  .service__body {
    padding: 4px 4px 0;
  }
}

.service__title {
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.service__text {
  max-width: 440px;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
  color: rgba(14, 31, 82, 0.7);
}

/* the examples take the place of the old mockup, so visitors see them without clicking anything,
   and the gradient keeps each service recognisable at a glance */
.service__panel {
  padding: clamp(14px, 3vw, 36px);
  border-radius: 20px;
}

/* each gradient is built on the color of its service, which the phone layout draws as a top line */
.service__panel--web { --service-color: #1f4fa8; background: linear-gradient(135deg, #6f9be0, var(--service-color)); }
.service__panel--bot { --service-color: #2aabee; background: linear-gradient(135deg, #7fd6f0, var(--service-color)); }
.service__panel--crm { --service-color: #f2a07b; background: linear-gradient(135deg, #fbdcc0, var(--service-color)); }
.service__panel--mobile { --service-color: #3d7a3a; background: linear-gradient(135deg, #9fdcc0, var(--service-color)); }
.service__panel--ai { --service-color: #3fb3b6; background: linear-gradient(135deg, var(--service-color), #0e1f52); }

.service__examples {
  padding: 18px 12px 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.35);
}

.service__examples-label {
  display: block;
  margin: 0 8px 6px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-turquoise);
}

.service__examples ul {
  list-style: none;
}

.service__examples a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px solid #eef1f7;
  transition: color 0.2s, background 0.2s;
}

.service__examples li:last-child a {
  border-bottom: 0;
}

.service__examples a:hover {
  background: #f3fbfb;
  color: var(--color-cobalt);
}

/* cover picture of the example, a plain tile until its picture is painted */
.service__thumb {
  flex: none;
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #eef1f7;
  object-fit: cover;
}

.service__examples a > div {
  flex: 1;
  min-width: 0;
}

.service__examples b {
  display: block;
  /* long domains and bot usernames must wrap on narrow phones */
  overflow-wrap: anywhere;
  font-weight: 500;
  font-size: 16px;
}

.service__examples small {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: rgba(14, 31, 82, 0.6);
}

.service__examples a > span {
  flex: none;
  color: var(--color-turquoise);
  font-size: 18px;
  transition: transform 0.2s;
}

.service__examples a:hover > span {
  transform: translateX(2px);
}

/* the rows need the width on a phone, so the gradient frame and the shadow cast on it go, and only the color stays as a top line */
@media (max-width: 640px) {
  .service__panel {
    padding: 0;
    background: none;
  }

  .service__examples {
    border-top: 4px solid var(--service-color);
    box-shadow: none;
  }

  .service__examples a {
    gap: 12px;
  }

  .service__thumb {
    width: 44px;
    height: 44px;
  }
}

/* ---------- Project modal ---------- */

/* the screenshot is a whole page, so the modal takes almost the full screen and the picture scrolls inside */
.project-modal {
  width: min(1240px, calc(100% - 2 * var(--gap)));
  height: calc(100vh - 2 * var(--gap));
  height: calc(100dvh - 2 * var(--gap));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  color: var(--color-ultramarine);
}

.project-modal[open] {
  animation: rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-modal::backdrop {
  background: rgba(14, 31, 82, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.project-modal[open]::backdrop {
  animation: fade-in 0.35s ease;
}

.project-modal__body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-modal__head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 20px 20px 32px;
}

.project-modal__info {
  flex: 1;
  min-width: 0;
}

.project-modal__label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-turquoise);
}

.project-modal__title {
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.project-modal__text {
  max-width: 640px;
  margin-top: 6px;
  line-height: 1.55;
  color: rgba(14, 31, 82, 0.7);
}

/* the same dark pill as the floating Telegram button, because it opens the same chat */
.project-modal__cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--color-ultramarine);
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  transition: background 0.2s;
}

.project-modal__cta:hover {
  background: var(--color-cobalt);
}

.project-modal .menu-toggle {
  display: grid;
  flex: none;
  background: rgba(14, 31, 82, 0.08);
}

/* the form only exists to close the dialog, the button stays an item of the head's flex and grid */
.project-modal__close {
  display: contents;
}

.project-modal__shot {
  flex: 1;
  min-height: 0;
  margin: 0 12px 12px;
  border-radius: 18px;
  overflow-y: auto;
  /* the page behind must not start scrolling once the screenshot reaches its end */
  overscroll-behavior: contain;
  background: #eef1f7;
}

.project-modal__shot img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 860px) {
  .project-modal {
    border-radius: 20px;
  }

  /* the label shares the first row with the close button, the title, the text and the button get the full width below it */
  .project-modal__head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    padding: 16px 16px 16px 20px;
  }

  .project-modal__info {
    display: contents;
  }

  .project-modal__label {
    margin: 0;
    align-self: center;
  }

  .project-modal .menu-toggle {
    grid-area: 1 / 2;
  }

  .project-modal__title,
  .project-modal__text,
  .project-modal__cta {
    grid-column: 1 / -1;
  }

  .project-modal__text {
    margin-top: 0;
    font-size: 15px;
  }

  .project-modal__cta {
    justify-content: space-between;
    font-size: 15px;
  }

  .project-modal__shot {
    margin: 0 8px 8px;
    border-radius: 14px;
  }
}

/* ---------- Contact form ---------- */

.contact {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 80px);
  margin: var(--gap);
  padding: clamp(32px, 6vw, 88px) var(--pad-x);
  border-radius: 28px;
  overflow: hidden;
  background: var(--color-ultramarine);
  color: #fff;
}

@media (max-width: 640px) {
  .contact {
    border-radius: 20px;
  }
}

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

/* the painted sky, faded into the dark background */
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("hero-image.webp") center top / cover;
  opacity: 0.18;
  pointer-events: none;
}

.contact > * {
  position: relative;
}

.contact .section-eyebrow {
  color: #7fe0e0;
}

.contact__text {
  max-width: 420px;
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.contact__direct {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 40px;
}

.contact__direct small {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.contact__direct > a {
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 28px);
  letter-spacing: -0.01em;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.contact__links a {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}

.contact__links a:hover {
  border-color: #7fe0e0;
  background: rgba(255, 255, 255, 0.08);
}

.contact__tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact__tg svg {
  color: #229ed9;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: start;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.field input,
.field textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.field input:focus,
.field textarea:focus {
  border-color: #7fe0e0;
  background: rgba(255, 255, 255, 0.12);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.form__submit {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 6px;
  border: 0;
  cursor: pointer;
}

.form__note {
  grid-column: 1 / -1;
  font-size: 13px;
  text-wrap: pretty;
  color: rgba(255, 255, 255, 0.5);
}

.form__success {
  display: none;
  align-self: center;
  padding: 32px;
  border: 1px solid rgba(127, 224, 224, 0.4);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.form__success b {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 24px;
}

.form__success p {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.contact.is-sent .form {
  display: none;
}

.contact.is-sent .form__success {
  display: block;
}

/* ---------- Footer ---------- */

.footer {
  margin: var(--gap);
  padding: clamp(32px, 5vw, 64px) var(--pad-x) 28px;
  border-radius: 28px;
  background: #fff;
  color: var(--color-ultramarine);
}

@media (max-width: 640px) {
  .footer {
    border-radius: 20px;
  }
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 3fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(14, 31, 82, 0.12);
}

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

.footer .brand {
  font-size: 26px;
}

.footer__tagline {
  max-width: 300px;
  margin-top: 12px;
  line-height: 1.55;
  color: rgba(14, 31, 82, 0.65);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}

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

.footer__col h4 {
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(14, 31, 82, 0.5);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer__col a:hover,
.footer__bottom a:hover {
  color: var(--color-cobalt);
}

.footer__col li {
  overflow-wrap: anywhere;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 14px;
  color: rgba(14, 31, 82, 0.55);
}

/* ---------- Navigation ---------- */

.hero__nav {
  display: flex;
  gap: clamp(20px, 2.5vw, 36px);
  margin-left: auto;
  margin-right: clamp(8px, 2vw, 24px);
  font-weight: 500;
  font-size: 15px;
}

.hero__nav a {
  opacity: 0.85;
  transition: opacity 0.2s;
}

.hero__nav a:hover {
  opacity: 1;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .hero__nav {
    display: none;
  }

  .menu-toggle {
    display: grid;
  }

  /* the switcher sits next to the menu button, as tall as it */
  .hero__header {
    gap: 8px;
  }

  .hero__header .lang-switcher {
    margin-left: auto;
  }

  .hero__header .lang-switcher__btn {
    height: 44px;
    border-radius: 12px;
  }
}

/* slim bar that slides in once the hero is scrolled past */
.topbar {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 32px);
  width: min(1100px, calc(100% - 20px));
  padding: 8px 8px 8px 22px;
  border: 1px solid rgba(14, 31, 82, 0.08);
  border-radius: 999px;
  background: rgba(253, 246, 234, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px -12px rgba(14, 31, 82, 0.25);
  color: var(--color-ultramarine);
  transform: translate(-50%, -140%);
  transition: transform 0.35s ease;
}

.topbar.is-visible {
  transform: translate(-50%, 0);
}

.topbar .brand {
  font-size: 20px;
}

.topbar__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  font-weight: 500;
  font-size: 15px;
}

.topbar__nav a {
  padding: 12px 20px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.topbar__nav a:hover {
  background: rgba(14, 31, 82, 0.06);
}

/* the section currently on screen */
.topbar__nav a.is-active {
  background: var(--color-ultramarine);
  color: #fff;
}

.topbar .menu-toggle {
  background: rgba(14, 31, 82, 0.08);
}

@media (max-width: 860px) {
  .topbar__nav {
    display: none;
  }

  /* with the nav hidden, the menu button goes to the right edge */
  .topbar .menu-toggle {
    margin-left: auto;
  }
}

/* Telegram button that slides in after the hero, dark so it stays readable on the cream sections */
.tg-cta {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--color-ultramarine);
  box-shadow: 0 10px 30px -8px rgba(14, 31, 82, 0.5);
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.tg-cta.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.tg-cta.is-visible:hover {
  transform: translateY(-2px);
}

.tg-cta__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #229ed9;
  /* white plane also inside the cream hero button, whose text is dark */
  color: #fff;
}

@media (max-width: 640px) {
  .tg-cta {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    font-size: 15px;
  }
}

/* full-screen menu for phones, a popover so the browser handles opening, closing, Esc and aria-expanded */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  flex-direction: column;
  padding: 20px 24px 32px;
  background: var(--color-ultramarine);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
  /* where allow-discrete is known the menu also fades out before display switches off */
  transition: opacity 0.25s, display 0.25s allow-discrete, overlay 0.25s allow-discrete;
}

.mobile-menu:is(:popover-open, .\:popover-open) {
  display: flex;
  opacity: 1;
}

@starting-style {
  .mobile-menu:popover-open {
    opacity: 0;
  }
}

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

.mobile-menu__head .menu-toggle {
  display: grid;
  background: rgba(255, 255, 255, 0.12);
}

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 40px;
  list-style: none;
}

.mobile-menu__links a {
  display: block;
  padding: 10px 0;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.mobile-menu__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-top: auto;
}

/* :is() forgives an unknown :popover-open, so browsers without popover still lock the page for the modal */
body:has(.project-modal[open], .mobile-menu:is(:popover-open, .\:popover-open)) {
  overflow: hidden;
}

/* ---------- How we work ---------- */

.process {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-x) clamp(64px, 9vw, 120px);
  color: var(--color-ultramarine);
}

/* steps sit on a timeline, numbers joined by a line and a card below each number */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.step__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--color-cobalt);
  color: var(--color-cobalt);
  font-weight: 800;
  font-size: 16px;
}

/* line from this number to the next one */
.step__marker::after {
  content: "";
  flex: 1;
  height: 2px;
  margin-right: -20px;
  background: repeating-linear-gradient(90deg, rgba(31, 79, 168, 0.35) 0 8px, transparent 8px 14px);
}

.step:last-child .step__marker::after {
  display: none;
}

.step__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(14, 31, 82, 0.04), 0 20px 50px -30px rgba(14, 31, 82, 0.25);
  transition: transform 0.25s ease;
}

.step__card:hover {
  transform: translateY(-4px);
}

.step h3 {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.step p {
  margin-top: 10px;
  line-height: 1.55;
  text-wrap: pretty;
  color: rgba(14, 31, 82, 0.7);
}

/* what the client gets at the end of the step */
.step__result {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 20px;
}

.step__result span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(63, 179, 182, 0.12);
  color: #1f7f82;
  font-weight: 500;
  font-size: 14px;
}

.step__result span::before {
  content: "✓";
  font-weight: 800;
}

/* the last step is the goal, so it stands out */
.step:last-child .step__num {
  background: var(--color-cobalt);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(31, 79, 168, 0.6);
}

.step:last-child .step__card {
  background: var(--color-ultramarine);
  color: #fff;
}

.step:last-child p {
  color: rgba(255, 255, 255, 0.75);
}

.step:last-child .step__result span {
  background: rgba(127, 224, 224, 0.15);
  color: #7fe0e0;
}

/* tablets and phones get a vertical timeline, number on the left and card on the right */
@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step {
    position: relative;
    flex-direction: row;
    gap: 16px;
  }

  .step__marker {
    flex-direction: column;
    align-self: stretch;
  }

  .step__marker::after {
    width: 2px;
    height: auto;
    margin: 0 0 -16px;
    background: repeating-linear-gradient(180deg, rgba(31, 79, 168, 0.35) 0 8px, transparent 8px 14px);
  }

  .step__card {
    padding: 22px 20px 20px;
  }
}

@media (max-width: 560px) {
  .step__num {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }

  .step h3 {
    font-size: 20px;
  }
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-x) clamp(64px, 9vw, 120px);
  scroll-margin-top: 90px;
  color: var(--color-ultramarine);
}

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

.about__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 560px;
  border-radius: 28px;
  object-fit: cover;
  /* the photo is square, so keep the face in view when the box crops it */
  object-position: 50% 30%;
}

@media (max-width: 860px) {
  .about__photo {
    justify-self: center;
    width: 140px;
    height: 140px;
    border-radius: 50%;
  }
}

.about__quote {
  margin-top: 24px;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.5;
}

.about__name {
  margin-top: 28px;
  font-weight: 800;
  font-size: 18px;
}

.about__role {
  margin-top: 4px;
  color: rgba(14, 31, 82, 0.6);
}

.about__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.about__links a {
  padding: 10px 18px;
  border: 1px solid rgba(14, 31, 82, 0.18);
  border-radius: 999px;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
}

.about__links a:hover {
  border-color: var(--color-cobalt);
  background: #fff;
}

/* ---------- Phone tweaks ---------- */

@media (max-width: 640px) {
  .hero {
    min-height: 560px;
  }

  /* darker at the bottom, so the title stays readable over the pale horizon
     no left shade, because here the text sits at the bottom across the whole width */
  .hero__overlay {
    background: linear-gradient(
      to bottom,
      rgba(14, 31, 82, 0.5),
      rgba(14, 31, 82, 0.1) 40%,
      rgba(14, 31, 82, 0.5)
    );
  }

  .hero__content {
    justify-content: flex-end;
    padding-bottom: 48px;
  }

  .hero__offer {
    font-size: 17px;
  }

  .hero__cta {
    font-size: 16px;
  }

  /* the menu and the form keep their consultation buttons, only the hero drops it */
  .hero__actions .hero__cta {
    display: none;
  }

  /* most ad visitors are on phones, where Telegram opens in one tap, so it is the hero's lead button there */
  .hero__actions .hero__tg {
    display: inline-flex;
  }

  .hero__actions {
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
  }

  /* Apple-style liquid glass: a faint white tint, blur with boosted color, a bright top rim and a soft shadow
     plain blur and not the SVG refraction, because that one renders only in Chromium and not on iPhones */
  .hero__services {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(255, 255, 255, 0.12),
      0 8px 24px rgba(14, 31, 82, 0.3);
    font-weight: 500;
    font-size: 15px;
    text-shadow: 0 1px 6px rgba(14, 31, 82, 0.4);
  }

  /* the services link already leads down the page */
  .hero__scroll {
    display: none;
  }

  /* on a phone the number only crowds the hero */
  .hero__phone {
    display: none;
  }

  .form__submit {
    width: 100%;
    justify-content: space-between;
  }

  .contact__links a,
  .about__links a {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ---------- Motion (kept subtle) ---------- */

/* in the hero the painting settles in, then the text rises */
.hero__image {
  animation: hero-settle 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__title,
.hero__offer,
.hero__actions {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__title { animation-delay: 0.15s; }
.hero__offer { animation-delay: 0.25s; }
.hero__actions { animation-delay: 0.35s; }

@keyframes hero-settle {
  from { transform: scale(1.05); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* sections fade up once as they scroll into view (only when JS runs) */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* asks a foreign visitor to switch to English, opened by redirect-to-english.js */
/* a non-modal notice in the bottom-right corner, so the page stays usable */
.lang-modal {
  position: fixed;
  inset: auto 20px 20px auto;
  z-index: 58;
  width: min(340px, calc(100% - 2 * var(--gap)));
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px -8px rgba(14, 31, 82, 0.5);
  color: var(--color-ultramarine);
  overflow: hidden;
}

.lang-modal[open] {
  animation: lang-modal-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* slides in with a small overshoot, then the flag waves and the button pulses to catch the eye */
@keyframes lang-modal-in {
  from { opacity: 0; transform: translateX(56px) scale(0.92); }
}

@keyframes lang-modal-up {
  from { opacity: 0; transform: translateY(100%); }
}

@keyframes lang-flag-wave {
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}

@keyframes lang-button-pulse {
  from { box-shadow: 0 0 0 0 rgba(31, 79, 168, 0.55); }
  to { box-shadow: 0 0 0 12px rgba(31, 79, 168, 0); }
}

.lang-modal__text .lang-switcher__flag {
  animation: lang-flag-wave 0.8s ease-in-out 0.6s 2;
}

.lang-modal__yes {
  animation: lang-button-pulse 1.2s ease-out 0.7s 3;
}

@media (prefers-reduced-motion: reduce) {
  .lang-modal[open],
  .lang-modal__text .lang-switcher__flag,
  .lang-modal__yes,
  .lang-modal::after {
    animation: none;
  }
}

/* the bar shrinks over the same 10 seconds as the timer in the script */
.lang-modal::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--color-turquoise);
  transform-origin: left;
  animation: lang-modal-timer 10s linear forwards;
}

@keyframes lang-modal-timer {
  to { transform: scaleX(0); }
}

.lang-modal__text .lang-switcher__flag {
  vertical-align: -4px;
  margin: 0 4px 0 2px;
}

.lang-modal__text {
  margin: 0 0 12px;
  font-weight: 500;
  line-height: 1.4;
}

.lang-modal__actions {
  display: flex;
  gap: 8px;
}

.lang-modal__yes,
.lang-modal__no {
  padding: 10px 18px;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.lang-modal__yes {
  background: var(--color-ultramarine);
  color: #fff;
}

.lang-modal__no {
  background: var(--color-cream);
  color: var(--color-ultramarine);
}

/* on phones it sticks to the bottom edge like a cookie banner */
@media (max-width: 640px) {
  .lang-modal {
    inset: auto 0 0 0;
    width: auto;
    padding: 18px 16px calc(max(16px, env(safe-area-inset-bottom)) + 2px);
    border-radius: 20px 20px 0 0;
  }

  .lang-modal[open] {
    animation-name: lang-modal-up;
  }

  .lang-modal::after {
    inset: 0 0 auto 0;
  }

  .lang-modal__text {
    font-size: 16px;
  }

  .lang-modal__actions > * {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
  }
}
