/* Roboto Flex and Rubik as default fonts, with sensible fallbacks */
/* Prevent FOUT: the HTML will get class 'fonts-loading' until fonts are ready */

* {
  box-sizing: border-box;
  padding: 0;
  font-smooth: always;
  margin: 0;
  text-decoration: none;
}

@font-face {
  font-family: 'Advaken Sans';
  src: url('./advaken_sans/Advaken Sans.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

/* Base font setup */
html {
  font-family: 'Rubik', 'Roboto Flex', system-ui, -apple-system, Segoe UI,
    Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

/* Hide text while fonts are loading to avoid layout shift/flash */
html.fonts-loading body {
  visibility: hidden;
}

/* Optional: when fonts failed, ensure content is visible */
html.fonts-failed body {
  visibility: visible;
}

/* Example body reset */
body {
  margin: 0;
  background: #0a0804;
  min-height: 100vh;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  overflow-x: hidden;
}

.header {
  max-width: 1296px;
  padding: 0 16px;
  width: 100%;
}

.header > div {
  height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header__phone {
  font-size: 26px;
  font-weight: 800 !important;
  color: #b8dcf4 !important;
  text-decoration: none;
}

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

.header__left div {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  max-width: 135px;
}

.gradient-circle {
  position: absolute;
  top: -10px;
  left: -400px;
  width: 875px;
  height: 875px;
  background: radial-gradient(circle, rgb(1, 29, 48) 0%);
  filter: blur(294px);
  z-index: -2;
}

.bgg {
  background-image: url('./bg-logo.svg');
  background-size: 974px 970px;
  background-position: right -121px top 202px;
  background-repeat: no-repeat;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 96px;
  width: 100%;
  max-width: 1280px;
  padding-top: 138px;
  padding-bottom: 172px;
}

.title__container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
}

.title {
  font-family: 'Advaken Sans', 'Roboto Flex';
  font-size: 70px;
  line-height: 0.9;
  max-width: 612px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.title__container p {
  font-size: 20px;
  font-weight: 500;
  max-width: 400px;
  color: rgba(255, 255, 255, 0.6);
}

.contacts {
  padding: 0 16px;
}

.contacts__container {
  gap: 24px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 0;
}

.contacts__item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 386px;
}

.contacts__item-title {
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.form h2 {
  font-size: 34px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
  max-width: 505px;
  font-family: 'Advaken Sans', 'Roboto Flex';
  text-transform: uppercase;
}

.form {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.form__input-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}

.form__input {
  height: 64px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(90deg, #223037 0%, #272827 100%);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.form__input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form__input-phone {
  height: 64px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(90deg, #282725 0%, #31302d 100%);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.form__input-phone::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form__button {
  height: 64px;
  padding: 25px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background: #b8dcf4;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: black;
  text-transform: uppercase;
  cursor: pointer;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  background: #333333;
  height: 50px;
  margin-top: auto;
  padding: 0 16px;
}

.footer span {
  font-size: 12px;
  font-weight: 500;
  color: #707070;
}

.footer div {
  max-width: 1296px;
  padding-left: 16px;
  padding-right: 16px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__logo {
  width: 36px;
  height: 36px;
  filter: opacity(0.5) drop-shadow(0 0 0 #d5d3d3);
}

.form__logo {
  display: none;
}

@media (max-width: 950px) {
  .main {
    gap: 50px;
  }

  .form__input-container {
    grid-template-columns: 1fr 1fr;
  }

  .contacts__container {
    flex-wrap: wrap;
  }

  .title {
    font-size: 48px;
  }

  .header > div {
    height: 60px;
  }
}

@media (max-width: 822px) {
  .title {
    font-size: 38px;
  }

  .title__container {
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
  }

  .gradient-circle {
    display: none;
  }

  .main {
    padding-top: 50px;
    padding-bottom: 0;
  }

  .bgg {
    background-size: 381px 379px;
    background-position: left 50% top 60px;
  }

  .header .header__phone {
    font-size: 20px;
  }

  .header__left div {
    display: none;
  }

  .header__logo-container {
    width: 36px;
    overflow: hidden;
  }

  .header__logo {
    width: 110px;
  }

  .form {
    background: #282623;
    padding-top: 24px;
    border-top-right-radius: 24px;
    border-top-left-radius: 24px;
    padding-bottom: 40px;
  }

  .form h2 {
    font-size: 22px;
    max-width: 307px;
  }

  .form__input-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form__input {
    background: #40403c;
  }

  .form__input-phone {
    background: #40403c;
  }

  .form__logo {
    margin-top: 30px;
    height: 48px;
    display: block;
  }

  .form__button {
    text-wrap: nowrap;
  }

  .contacts__item:nth-child(2) {
    order: 1;
  }
}

/* Appear animations for fade-up and fade-down */
.fade-up {
  opacity: 0;
  transform: translateY(35px);
  will-change: transform, opacity;
  animation: fadeUp 2500ms ease forwards;
  animation-delay: var(--fade-delay, 0ms);
}

.fade-down {
  opacity: 0;
  transform: translateY(-35px);
  will-change: transform, opacity;
  animation: fadeDown 2500ms ease forwards;
  animation-delay: var(--fade-delay, 0ms);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .fade-down {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
