body.page-contact {
  background: var(--bg-light);
}

.page-contact .site-header {
  background: linear-gradient(180deg, rgba(2, 11, 24, 0.42), rgba(2, 11, 24, 0));
}

.page-contact .site-header::after {
  opacity: 1;
}

.contact-hero {
  position: relative;
  overflow: clip;
  min-height: 990px;
  padding: 148px 0 108px;
  background:
    linear-gradient(90deg, rgba(2, 11, 24, 0.92) 0%, rgba(2, 11, 24, 0.84) 25%, rgba(2, 11, 24, 0.64) 52%, rgba(2, 11, 24, 0.8) 100%),
    url('../images/contact-lab.webp') center center / cover no-repeat,
    linear-gradient(90deg, #020b18 0%, #041327 42%, #081d36 100%);
}

.contact-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 520px at var(--mx, 78%) var(--my, 24%), rgba(255, 255, 255, 0.08), transparent 72%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.contact-hero-bg,
.contact-hero-lightbar,
.contact-hero-circuit,
.contact-hero-sparks {
  position: absolute;
  pointer-events: none;
}

.contact-hero-bg {
  inset: 0;
  background:
    radial-gradient(760px 440px at 82% 18%, rgba(165, 190, 230, 0.14), transparent 72%),
    radial-gradient(520px 340px at 74% 76%, rgba(224, 186, 46, 0.1), transparent 72%);
}

.contact-hero-lightbar {
  top: 28px;
  right: 4%;
  width: min(60vw, 980px);
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(248, 252, 255, 0.92), rgba(255, 255, 255, 0));
  filter: blur(6px);
  opacity: 0.82;
}

.contact-hero-circuit {
  inset: 18px auto 0 0;
  width: min(55vw, 860px);
  height: 660px;
  background: url('../images/hero-circuit.svg') left top / contain no-repeat;
  opacity: 0.94;
  mix-blend-mode: screen;
  animation: circuitFloat 11s ease-in-out infinite;
}

.contact-hero-sparks {
  inset: 0;
  background:
    radial-gradient(circle at 9% 18%, rgba(224, 186, 46, 0.84) 0 4px, transparent 5px),
    radial-gradient(circle at 20% 26%, rgba(224, 186, 46, 0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 14% 40%, rgba(224, 186, 46, 0.5) 0 4px, transparent 5px),
    radial-gradient(circle at 22% 52%, rgba(224, 186, 46, 0.42) 0 4px, transparent 5px),
    radial-gradient(circle at 79% 78%, rgba(224, 186, 46, 0.32) 0 5px, transparent 6px);
  opacity: 0.85;
}

.contact-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 56px), 1520px);
  margin: 0 auto;
  padding: 62px 72px 70px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(6, 16, 30, 0.34), rgba(6, 16, 30, 0.42));
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.contact-shell h1 {
  margin: 0 0 44px;
  text-align: center;
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 650;
  color: #fff;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 22px;
}

.contact-field {
  min-width: 0;
}

.contact-field-full {
  grid-column: 1 / -1;
}

.contact-field label {
  display: block;
  margin-bottom: 12px;
  font-size: 1.06rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
  color: #fff;
  font: inherit;
  letter-spacing: 0.01em;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
}

.contact-field input {
  min-height: 58px;
  padding: 0 18px;
}

.contact-field textarea {
  min-height: 172px;
  padding: 16px 18px;
  resize: vertical;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: rgba(224, 186, 46, 0.8);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 4px rgba(224, 186, 46, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.contact-field input[data-invalid="true"],
.contact-field textarea[data-invalid="true"] {
  border-color: rgba(255, 127, 127, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 127, 127, 0.08);
}

.contact-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.contact-actions .btn {
  min-width: 404px;
  max-width: 100%;
}

.contact-toast {
  position: absolute;
  top: 24px;
  right: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(224, 186, 46, 0.22);
  background: rgba(6, 18, 34, 0.9);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.97rem;
  line-height: 1.55;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.24s ease, visibility 0.24s ease, transform 0.24s ease;
}

.contact-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.contact-toast[data-tone="error"] {
  border-color: rgba(255, 127, 127, 0.26);
}

.contact-toast[data-tone="success"] {
  border-color: rgba(224, 186, 46, 0.24);
}

@media (max-width: 1180px) {
  .contact-hero {
    min-height: 920px;
    padding-bottom: 88px;
  }

  .contact-shell {
    padding: 54px 42px 58px;
  }
}

@media (max-width: 900px) {
  .contact-hero {
    min-height: 0;
    padding: 110px 0 72px;
  }

  .contact-hero-circuit {
    inset: 90px auto auto -10px;
    width: min(84vw, 540px);
    height: 430px;
    opacity: 0.74;
  }

  .contact-shell {
    width: min(calc(100% - 32px), 1520px);
    padding: 34px 18px 26px;
    border-radius: 24px;
  }

  .contact-form {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .contact-field-full {
    grid-column: auto;
  }

  .contact-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .contact-toast {
    position: static;
    max-width: none;
    margin-bottom: 18px;
  }
}

@media (max-width: 560px) {
  .contact-shell h1 {
    font-size: clamp(2.2rem, 10vw, 2.9rem);
  }

  .contact-field label,
  .contact-field input,
  .contact-field textarea {
    font-size: 0.98rem;
  }
}

/* Client polish update */
.contact-hero {
  min-height: 930px;
  padding: 138px 0 96px;
}

.contact-shell {
  padding: 52px 58px 60px;
}

.contact-shell h1 {
  margin-bottom: 36px;
  font-size: clamp(2.15rem, 3vw, 3.2rem);
}

.contact-form {
  gap: 22px 20px;
}

.contact-field label {
  font-size: 0.98rem;
}

.contact-field input {
  min-height: 54px;
}

.contact-field textarea {
  min-height: 156px;
}

@media (max-width: 1180px) {
  .contact-hero {
    padding-top: 124px;
  }
}

@media (max-width: 900px) {
  .contact-hero {
    padding-top: 110px;
  }

  .contact-shell {
    padding: 30px 18px 24px;
  }
}
