/* ==========================================================================
   Faster — landing page styles
   ========================================================================== */

:root {
  --primary: #3359e0;
  --secondary: #4f6af4;
  --accent: #4524cd;
  --dark: #101010;
  --light: #1a1a1a;
  --white: #fff;
  --muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.12);

  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --container: 1280px;
  --gutter: 48px;
  --radius-lg: 48px;
  --header-h: 88px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--dark);
  color: var(--white);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

h1,
h2,
h3,
h5 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.027em;
}

h1 {
  font-size: 80px;
  line-height: 1.1;
  text-transform: uppercase;
}

h2 {
  font-size: 56px;
  line-height: 1.2;
  text-transform: uppercase;
}

h3 {
  font-size: 32px;
  line-height: 1.2;
}

h5 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Blue section with the polygon texture used across the site */
.bg-blue {
  position: relative;
  background-color: var(--primary);
  isolation: isolate;
}

.bg-blue::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/hero-bg.webp") center top / 100% auto repeat-y;
  opacity: 0.5;
  mix-blend-mode: difference;
  border-radius: inherit;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 32px;
  border: 1px solid var(--white);
  border-radius: 100px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.25s;
}

.btn svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s;
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn--white {
  background: var(--white);
  color: var(--primary);
  border-color: var(--primary);
}

.btn--white:hover {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
}

.btn--outline {
  background: transparent;
  color: var(--white);
  font-size: 20px;
  font-weight: 400;
  padding: 18px 30px;
}

.btn--outline:hover {
  background: var(--white);
  color: var(--dark);
}

.btn--lg {
  font-size: 24px;
  padding: 24px 40px;
}

.btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 64px;
}

/* ---------- Header ---------- */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  transition: background-color 0.3s, height 0.3s;
}

.header.is-scrolled {
  background: var(--dark);
  --header-h: 72px;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo img {
  width: 120px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 48px;
}

.nav__list {
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list a,
.lang a {
  font-size: 14px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.nav__list a:hover,
.lang a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lang {
  display: flex;
  gap: 24px;
}

.lang a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang a[aria-current="true"] {
  font-weight: 700;
}

.flag {
  width: 16px;
  height: 11px;
  border-radius: 1px;
}

.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: none;
  color: var(--white);
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

.header.is-open .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header.is-open .burger span:nth-child(2) {
  opacity: 0;
}

.header.is-open .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: calc(var(--header-h) + 100px);
}

.hero__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 100px;
}

.hero__title img,
.headline img {
  display: inline-block;
  vertical-align: middle;
}

.hero__title img {
  width: 0.6em;
  height: 0.6em;
  margin: -0.1em 0 0 0.1em;
}

.hero__text p {
  max-width: 470px;
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.6;
}

.hero__media {
  position: relative;
}

.hero__media > img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.hero__arrow {
  position: absolute;
  top: -64px;
  right: 18%;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border: 10px solid var(--primary);
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  transition: transform 0.3s;
}

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

.hero__arrow svg {
  width: 40px;
  height: 40px;
}

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  padding: 32px 0;
  background: var(--dark);
  user-select: none;
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee__item {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.027em;
  white-space: nowrap;
}

.marquee__item svg {
  width: 48px;
  height: 48px;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Section commons ---------- */

.section {
  padding: 120px 0;
}

.section__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}

.section__head p {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
}

.section__head--center {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

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

.services__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.service:last-child {
  border-bottom: 1px solid var(--border);
}

.service img {
  width: 150px;
  height: 56px;
  object-fit: cover;
  border-radius: 100px;
}

.service h3 {
  text-transform: uppercase;
}

.service p {
  max-width: 420px;
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Stack ---------- */

.stack {
  padding-top: 0;
}

.stack h2 {
  text-align: center;
  margin-bottom: 64px;
}

.stack__grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 40px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack__grid img {
  width: 86px;
  margin: 0 auto;
  transition: transform 0.25s;
}

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

/* ---------- Statement ---------- */

.statement {
  padding: 120px 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.headline {
  font-size: 56px;
  line-height: 1.25;
}

.headline img {
  height: 0.9em;
  width: auto;
  border-radius: 100px;
  margin: -0.12em 0.1em 0;
}

/* ---------- Portfolio ---------- */

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  position: relative;
  display: block;
}

.project img {
  width: 100%;
  transition: transform 0.4s;
}

.project:hover img {
  transform: scale(1.03);
}

.project h3 {
  position: absolute;
  left: 0;
  right: 0;
  top: 46%;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ---------- Testimonials ---------- */

.reviews__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 var(--gutter);
  scroll-padding: 0 var(--gutter);
}

.reviews__track::-webkit-scrollbar {
  display: none;
}

.review {
  position: relative;
  flex: 0 0 min(560px, 85vw);
  scroll-snap-align: start;
  padding: 40px;
  border-radius: 24px;
  background: var(--light);
}

.review__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-right: 56px;
}

.review__head img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.review__name {
  font-size: 16px;
  font-weight: 600;
}

.review__role {
  color: var(--muted);
  font-size: 14px;
}

.review__quote {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 40px;
}

.review blockquote {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
}

.reviews__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.reviews__nav button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--white);
  border-radius: 50%;
  background: none;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.reviews__nav button:hover {
  background: var(--white);
  color: var(--dark);
}

.reviews__nav svg {
  width: 18px;
  height: 18px;
}

/* ---------- Partners ---------- */

.partners {
  padding: 0 0 120px;
  overflow: hidden;
}

.partners .marquee__track {
  animation-duration: 40s;
  align-items: center;
}

.partners img {
  height: 56px;
  width: auto;
  max-width: 180px;
  margin-right: 80px;
  object-fit: contain;
  opacity: 0.8;
  filter: grayscale(1) brightness(1.6);
  transition: opacity 0.2s, filter 0.2s;
}

.partners img:hover {
  opacity: 1;
  filter: none;
}

/* ---------- CTA / Contact ---------- */

.cta {
  padding: 120px 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  text-align: center;
}

.cta h2 {
  max-width: 1000px;
  margin: 0 auto 48px;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.form__field--full {
  grid-column: 1 / -1;
}

.form input,
.form textarea {
  width: 100%;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  background: rgba(16, 16, 16, 0.15);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s, background-color 0.2s;
}

.form textarea {
  min-height: 140px;
  resize: vertical;
}

.form input::placeholder,
.form textarea::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--white);
  background: rgba(16, 16, 16, 0.3);
}

/* Honeypot field — hidden from people, filled by bots */
.form__hp {
  position: absolute;
  left: -9999px;
}

.form__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.form__actions .btn[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.form__status {
  min-height: 1.5em;
  font-size: 16px;
}

.form__status.is-error {
  color: #ffd2d2;
}

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

.footer {
  padding: 80px 0 40px;
  background: var(--dark);
  font-size: 16px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
}

.footer h5 {
  margin-bottom: 20px;
  font-size: 16px;
}

.footer__contacts {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.footer__contacts li + li {
  margin-top: 12px;
}

.footer a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer address {
  font-style: normal;
  color: var(--muted);
}

.socials {
  display: flex;
  gap: 12px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--light);
  transition: background-color 0.2s;
}

.socials a:hover {
  background: var(--primary);
}

.socials svg {
  width: 18px;
  height: 18px;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer__links {
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Back to top ---------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.to-top svg {
  width: 16px;
  height: 16px;
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

  .marquee__track {
    animation: none;
  }

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  h1 {
    font-size: 64px;
  }

  h2,
  .headline {
    font-size: 44px;
  }

  .nav__list {
    gap: 28px;
  }

  .stack__grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 1024px) {
  :root {
    --gutter: 32px;
    --header-h: 72px;
  }

  .burger {
    display: block;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    padding: 32px var(--gutter) 40px;
    background: var(--dark);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform 0.35s, visibility 0.35s;
  }

  .header.is-open {
    background: var(--dark);
  }

  .header.is-open .nav {
    transform: none;
    visibility: visible;
  }

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

  .nav__list a {
    font-size: 24px;
  }

  .lang a {
    font-size: 18px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 64px);
  }

  .hero__top,
  .section__head {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__top {
    padding-bottom: 80px;
  }

  .hero__media > img {
    height: 420px;
  }

  .hero__arrow {
    width: 100px;
    height: 100px;
    top: -50px;
  }

  .section,
  .statement,
  .cta {
    padding: 88px 0;
  }

  .service {
    grid-template-columns: 120px 1fr;
  }

  .service img {
    width: 120px;
    height: 48px;
  }

  .service p {
    grid-column: 2;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
    --radius-lg: 28px;
  }

  body {
    font-size: 16px;
  }

  h1 {
    font-size: 44px;
  }

  h2,
  .headline {
    font-size: 30px;
  }

  h3 {
    font-size: 22px;
  }

  .hero__media > img {
    height: 300px;
  }

  .hero__arrow {
    width: 80px;
    height: 80px;
    top: -40px;
    border-width: 6px;
  }

  .hero__arrow svg {
    width: 28px;
    height: 28px;
  }

  .marquee {
    padding: 20px 0;
  }

  .marquee__item {
    font-size: 32px;
    gap: 24px;
    padding-right: 24px;
  }

  .marquee__item svg {
    width: 28px;
    height: 28px;
  }

  .section,
  .statement,
  .cta {
    padding: 64px 0;
  }

  .section__head {
    margin-bottom: 40px;
  }

  .service {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 0;
  }

  .service p {
    grid-column: auto;
  }

  .stack__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 12px;
  }

  .stack__grid img {
    width: 64px;
  }

  .portfolio__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .review {
    padding: 28px 24px;
  }

  .review__quote {
    top: 28px;
    right: 24px;
    width: 32px;
  }

  .review blockquote {
    font-size: 16px;
  }

  .partners {
    padding-bottom: 64px;
  }

  .partners img {
    height: 40px;
    margin-right: 48px;
  }

  .btn--lg {
    font-size: 18px;
    padding: 20px 32px;
  }

  .form {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer__bottom {
    flex-direction: column;
  }

  .footer__links {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   Case study pages
   ========================================================================== */

.case-hero {
  padding: calc(var(--header-h) + 100px) 0 0;
  overflow: hidden;
}

.case-hero__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: end;
  padding-bottom: 80px;
}

.case-hero h1 img {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin: -0.1em 0.15em 0;
  vertical-align: middle;
}

.case-hero h1 span {
  display: block;
}

.case-hero__text p {
  margin-bottom: 40px;
  font-size: 16px;
  line-height: 1.6;
}

.case-hero__text ul,
.case-hero__text ol {
  margin: -24px 0 40px;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.6;
}

.case-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn--ghost {
  background: transparent;
  color: var(--white);
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--primary);
}

.case-slider {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 var(--gutter) 80px;
  scroll-padding: 0 var(--gutter);
}

.case-slider::-webkit-scrollbar {
  display: none;
}

.case-slider img {
  flex: 0 0 min(820px, 82vw);
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  border-radius: 24px;
  scroll-snap-align: start;
  background: var(--light);
}

.case-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-card {
  padding: 40px 32px;
  border-radius: 24px;
  background: var(--light);
}

.case-card__num {
  display: block;
  margin-bottom: 24px;
  color: var(--secondary);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
}

.case-card h3 {
  margin-bottom: 16px;
  font-size: 22px;
  line-height: 1.3;
}

.case-card p {
  color: var(--muted);
  font-size: 16px;
}

.case-steps .case-card__num {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.case-statement .headline {
  max-width: 1100px;
}

.counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0 0 64px;
  padding: 0;
  list-style: none;
}

.counter {
  padding: 40px 32px;
  border: 1px solid var(--border);
  border-radius: 24px;
}

.counter__num {
  display: block;
  margin-bottom: 8px;
  font-size: 72px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.counter__label {
  color: var(--muted);
  font-size: 16px;
}

.case-gallery {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.case-gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--light);
}

.case-gallery figure:nth-child(3n + 1) {
  grid-row: span 2;
}

.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.case-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.case-next__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.case-next a {
  font-size: 40px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.027em;
  transition: color 0.2s;
}

.case-next a:hover {
  color: var(--secondary);
}

.case-next a:last-child {
  text-align: right;
}

@media (max-width: 1024px) {
  .case-hero {
    padding-top: calc(var(--header-h) + 64px);
  }

  .case-hero__top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 56px;
  }

  .case-cards,
  .counters {
    grid-template-columns: 1fr;
  }

  .counter__num {
    font-size: 56px;
  }
}

@media (max-width: 767px) {
  .case-slider {
    padding-bottom: 56px;
    gap: 12px;
  }

  .case-slider img {
    border-radius: 16px;
  }

  .case-card,
  .counter {
    padding: 28px 24px;
  }

  .case-gallery {
    grid-template-columns: 1fr;
  }

  .case-gallery figure:nth-child(3n + 1) {
    grid-row: auto;
  }

  .case-next {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-next a {
    font-size: 26px;
  }

  .case-next a:last-child {
    text-align: left;
  }
}
