:root {
  --c-text: #3a3a3a;
  --c-muted: #7d7d7d;
  --c-placeholder: #616161;
  --c-border: #c0c0c0;
  --c-bg: #fafafa;
  --c-red: #e41645;
  --c-red-hover: #c8103a;
  --c-footer: #3a3a3a;

  --font: 'Saira', 'Arial Narrow', Arial, sans-serif;
  --gutter: 12px;
  --max-width: 1440px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.33;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 3px;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 48px;
  border: 0;
  border-radius: 26px;
  background: var(--c-red);
  color: var(--c-bg);
  font: 700 20px/1.2 var(--font);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn:hover {
  background: var(--c-red-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Noise background (header + intro) ---------- */

.header,
.intro {
  position: relative;
  isolation: isolate;
}

.header::before,
.intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../img/main/noise.webp') repeat;
  opacity: 0.07;
  pointer-events: none;
}

.intro::before {
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, #000 80%, transparent);
}

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

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 8px;
}

.header__logo {
  display: block;
  flex-shrink: 0;
}

.header__logo img {
  width: 119px;
  height: 56px;
}

.header__contact {
  display: flex;
  align-items: center;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.33;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header__contact:hover {
  color: var(--c-red);
}

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

/* ---------- Intro: hero + theses ---------- */

.intro {
  overflow-x: clip;
}

.hero__inner {
  position: relative;
  padding-top: 48px;
  padding-bottom: 160px;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.hero__title {
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero__title-accent {
  display: block;
  color: var(--c-red);
}

.hero__subtitle {
  font-size: 14px;
  line-height: 1.25;
}

.hero__note {
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.25;
}

.hero__btn {
  margin-top: 16px;
  width: 100%;
}

.hero__art {
  position: absolute;
  right: -46px;
  bottom: -57px;
  width: 283px;
  pointer-events: none;
}

.hero__art img {
  width: 100%;
  height: auto;
}

.theses {
  position: relative;
  z-index: 1;
}

.theses__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 32px;
}

.thesis {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px;
  border: 1px solid var(--c-text);
  background: var(--c-bg);
}

.thesis__icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  padding: 4px;
  object-fit: contain;
}

.thesis__body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-right: 16px;
}

.thesis__title {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
}

.thesis__text {
  font-size: 14px;
  line-height: 1.2;
}

.thesis__mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
}

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

.contact {
  position: relative;
  z-index: 1;
  isolation: isolate;
  padding-top: 24px;
  padding-bottom: 0;
}

.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath fill='%233a3a3a' d='M30 6l24 24-24 24L6 30z'/%3E%3C/svg%3E");
  background-size: 44px 44px;
  opacity: 0.06;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000);
  mask-image: linear-gradient(to bottom, transparent, #000);
  pointer-events: none;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    'main main'
    'left right';
  row-gap: 16px;
}

.contact__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Mobile: decorations hang ~42px over the footer, as in the design. */
.contact__decor {
  justify-self: center;
  margin-bottom: -42px;
}

.contact__decor img {
  width: 100%;
  height: auto;
}

.contact__decor--left {
  grid-area: left;
  width: 123px;
  margin-top: -5px;
}

.contact__decor--right {
  grid-area: right;
  width: 120px;
}

.contact__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.contact__title {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
}

.contact__title b {
  font-weight: 700;
  color: var(--c-red);
}

.contact__text {
  font-size: 14px;
  line-height: 1.2;
}

/* ---------- Form ---------- */

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

.form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form__input {
  display: block;
  width: 100%;
  margin: 0;
  padding: 15px 16px;
  border: 1px solid var(--c-border);
  border-radius: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 500 16px/1.25 var(--font);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease;
}

.form__input::placeholder {
  color: var(--c-placeholder);
  opacity: 1;
}

.form__input:hover {
  border-color: var(--c-muted);
}

.form__input:focus {
  outline: none;
  border-color: var(--c-text);
}

.form__input[aria-invalid='true'] {
  border-color: var(--c-red);
}

.form__textarea {
  min-height: 52px;
  max-height: 200px;
  resize: none;
  overflow-y: auto;
}

.form__error {
  color: var(--c-red);
  font-size: 12px;
  line-height: 1.25;
}

.form__error:empty,
.form__status:empty {
  display: none;
}

.form__captcha {
  display: flex;
  justify-content: center;
  min-height: 78px;
  margin-top: 4px;
}

.form__error--captcha {
  text-align: center;
}

.form__status {
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
}

.form__status.is-error {
  color: var(--c-red);
}

.form__btn {
  width: 100%;
  margin-top: 4px;
}

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

.footer {
  background: var(--c-footer);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 48px;
  padding-bottom: 24px;
}

.footer__logo {
  width: 136px;
  height: 64px;
}

.footer__copy {
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.33;
}

/* ---------- ≥768: tablet ---------- */

@media (min-width: 768px) {
  .hero__content {
    align-items: flex-start;
  }

  .hero__title {
    font-size: 44px;
  }

  .hero__subtitle {
    font-size: 16px;
    line-height: 1.33;
  }

  .hero__note {
    font-size: 14px;
  }

  .hero__btn {
    width: 351px;
  }

  .hero__art {
    right: -58px;
    bottom: -65px;
    width: 391px;
  }

  .theses__list {
    padding-inline: 16px;
  }

  .thesis {
    padding: 17px;
  }

  .thesis__title {
    font-size: 20px;
  }

  .thesis__text {
    line-height: 1.25;
  }

  .thesis__mark {
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
  }

  .contact {
    padding-bottom: 16px;
  }

  .contact__decor {
    width: 160px;
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* ---------- ≥1024: desktop ---------- */

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
  }

  .header__inner {
    padding-block: 10px;
  }

  .header__logo img {
    width: 136px;
    height: 64px;
  }

  .header__contact-text {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .header__contact-icon {
    display: none;
  }

  .hero__inner {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    padding-top: 86px;
    padding-bottom: 96px;
  }

  .hero__content {
    grid-column: span 7;
    justify-content: center;
    gap: 0;
  }

  .hero__title {
    padding-bottom: 16px;
  }

  .hero__subtitle {
    font-size: 20px;
    line-height: 1.3;
    text-wrap: balance;
  }

  .hero__note {
    max-width: 560px;
    padding-top: 8px;
  }

  .hero__btn {
    width: auto;
    margin-top: 32px;
  }

  .hero__art {
    position: static;
    grid-column: span 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 364px;
  }

  .hero__art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .theses__list {
    flex-direction: row;
    gap: 24px;
    padding-top: 0;
    padding-inline: var(--gutter);
  }

  .thesis {
    flex: 1 1 0;
    min-width: 0;
  }

  .contact {
    padding-top: 56px;
    padding-bottom: 80px;
  }

  .contact::before {
    background-size: 60px 60px;
  }

  .contact__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas: none;
    column-gap: 24px;
    row-gap: 0;
  }

  .contact__decor {
    grid-column: span 3;
    grid-area: auto;
    justify-self: stretch;
    align-self: start;
    width: auto;
    max-width: 290px;
  }

  .contact__decor--left {
    grid-row: 1;
    grid-column: 1 / span 3;
    margin-top: 66px;
  }

  .contact__decor--right {
    grid-row: 1;
    grid-column: 10 / span 3;
    justify-self: end;
    margin-top: 163px;
  }

  .contact__main {
    grid-row: 1;
    grid-column: 4 / span 6;
    gap: 24px;
  }

  .contact__head {
    gap: 24px;
  }

  .contact__title {
    font-size: 32px;
  }

  .contact__text {
    font-size: 16px;
    line-height: 1.33;
  }

  .form {
    gap: 16px;
  }

  .form__input {
    font-size: 14px;
  }

  .form__textarea {
    min-height: 50px;
  }

  .form__btn {
    align-self: center;
    width: auto;
    margin-top: 16px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    padding-block: 10px;
  }
}

/* ---------- ≥1280: wide desktop ---------- */

@media (min-width: 1280px) {
  :root {
    --gutter: 60px;
  }
}
