/* ===== Contact Section ===== */
/* Elliptical drift: 16 steps → browser interpolates a very smooth orbit (no scale/rotate jitter) */
@keyframes contact-mesh-drift {
  0% {
    transform: translate3d(0.5%, 0%, 0) scale(1.036) translateZ(0);
  }
  6.25% {
    transform: translate3d(0.462%, 0.138%, 0) scale(1.036) translateZ(0);
  }
  12.5% {
    transform: translate3d(0.354%, 0.255%, 0) scale(1.036) translateZ(0);
  }
  18.75% {
    transform: translate3d(0.191%, 0.333%, 0) scale(1.036) translateZ(0);
  }
  25% {
    transform: translate3d(0%, 0.36%, 0) scale(1.036) translateZ(0);
  }
  31.25% {
    transform: translate3d(-0.191%, 0.333%, 0) scale(1.036) translateZ(0);
  }
  37.5% {
    transform: translate3d(-0.354%, 0.255%, 0) scale(1.036) translateZ(0);
  }
  43.75% {
    transform: translate3d(-0.462%, 0.138%, 0) scale(1.036) translateZ(0);
  }
  50% {
    transform: translate3d(-0.5%, 0%, 0) scale(1.036) translateZ(0);
  }
  56.25% {
    transform: translate3d(-0.462%, -0.138%, 0) scale(1.036) translateZ(0);
  }
  62.5% {
    transform: translate3d(-0.354%, -0.255%, 0) scale(1.036) translateZ(0);
  }
  68.75% {
    transform: translate3d(-0.191%, -0.333%, 0) scale(1.036) translateZ(0);
  }
  75% {
    transform: translate3d(0%, -0.36%, 0) scale(1.036) translateZ(0);
  }
  81.25% {
    transform: translate3d(0.191%, -0.333%, 0) scale(1.036) translateZ(0);
  }
  87.5% {
    transform: translate3d(0.354%, -0.255%, 0) scale(1.036) translateZ(0);
  }
  93.75% {
    transform: translate3d(0.462%, -0.138%, 0) scale(1.036) translateZ(0);
  }
  100% {
    transform: translate3d(0.5%, 0%, 0) scale(1.036) translateZ(0);
  }
}

/* Grain: slow diagonal crawl; mid keyframe eases acceleration (no linear “machine” feel) */
@keyframes contact-noise-drift {
  0% {
    background-position:
      25% 40%,
      80% 55%,
      0 0;
  }
  50% {
    background-position:
      25% 40%,
      80% 55%,
      128px 128px;
  }
  100% {
    background-position:
      25% 40%,
      80% 55%,
      256px 256px;
  }
}

.contact-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 5rem 2.5rem;
  overflow: hidden;
  font-family: var(--font, 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  border-radius: 2rem;
  z-index: 8;
  margin: -2rem 0;
}

.contact-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  isolation: isolate;
}

/* Solid base (Framer stacks a very faint mesh image on top) */
.contact-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: #121212;
  pointer-events: none;
}

/* Framer: mesh PNG, saturate(0), ~12% opacity, slow drift */
.contact-bg__mesh {
  position: absolute;
  top: -14%;
  left: -14%;
  width: 128%;
  height: 128%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0);
  opacity: 0.1225;
  pointer-events: none;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transform: translateZ(0);
  animation: contact-mesh-drift 110s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform;
}

.contact-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 25% 40%, rgba(0,0,0,0.28) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 55%, rgba(0,0,0,0.4) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.18'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 256px 256px;
  background-position: 25% 40%, 80% 55%, 0 0;
  opacity: 0.92;
  pointer-events: none;
  backface-visibility: hidden;
  /* Same easing family as mesh; slower = calmer parallax */
  animation: contact-noise-drift 130s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: background-position;
}

.contact-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Scroll in + out (contact-animations.js toggles .contact-section--in-view) */
.contact-section:not(.contact-section--in-view) .contact-left > * {
  opacity: 0;
  transform: translate3d(0, 2.25rem, 0);
  transition:
    opacity 0.7s var(--ease-smooth-opacity, cubic-bezier(0.33, 1, 0.68, 1)),
    transform 0.78s var(--ease-smooth-transform, cubic-bezier(0.22, 1, 0.42, 1));
  transition-delay: 0ms;
}

.contact-section.contact-section--in-view .contact-left > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 0.84s var(--ease-smooth-opacity, cubic-bezier(0.33, 1, 0.68, 1)),
    transform 0.92s var(--ease-smooth-transform, cubic-bezier(0.22, 1, 0.42, 1));
}

.contact-section.contact-section--in-view .contact-left > *:nth-child(1) {
  transition-delay: 0.03s;
}

.contact-section.contact-section--in-view .contact-left > *:nth-child(2) {
  transition-delay: 0.06s;
}

.contact-section.contact-section--in-view .contact-left > *:nth-child(3) {
  transition-delay: 0.1s;
}

.contact-section.contact-section--in-view .contact-left > *:nth-child(4) {
  transition-delay: 0.14s;
}

.contact-section:not(.contact-section--in-view) .contact-form-card {
  opacity: 0;
  transform: translate3d(2rem, 1.25rem, 0) scale(0.97);
  transition:
    opacity 0.7s var(--ease-smooth-opacity, cubic-bezier(0.33, 1, 0.68, 1)),
    transform 0.78s var(--ease-smooth-transform, cubic-bezier(0.22, 1, 0.42, 1));
  transition-delay: 0ms;
}

.contact-section.contact-section--in-view .contact-form-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 0.86s var(--ease-smooth-opacity, cubic-bezier(0.33, 1, 0.68, 1)),
    transform 0.86s var(--ease-smooth-transform, cubic-bezier(0.22, 1, 0.42, 1));
  transition-delay: 0.18s;
}

.contact-left {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.contact-brand {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}

.contact-heading {
  font-family: var(--font-display, 'Apfel Grotezk', sans-serif);
  font-size: 80px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
}

.contact-heading__star {
  display: inline-block;
  margin: 0 0.12em;
  font-size: 0.34em;
  font-weight: 400;
  vertical-align: 0.12em;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0.95;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-email,
.contact-phone {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.contact-email:hover,
.contact-phone:hover {
  opacity: 0.85;
}

.contact-location {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin: 0;
}

.contact-social {
  display: flex;
  gap: 1rem;
}

.contact-social-link {
  color: #ffffff;
  opacity: 0.85;
  transition:
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-social-link:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.contact-social-link svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Contact form card */
.contact-form-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2.5rem 2.25rem;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.contact-form-title {
  font-family: var(--font-display, 'Apfel Grotezk', sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 1.75rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 0.9375rem 1.125rem;
  font-size: 1rem;
  font-family: var(--font);
  color: #1a1a1a;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-input::placeholder,
.contact-textarea::placeholder {
  color: #999999;
}

.contact-input:focus,
.contact-textarea:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.contact-textarea {
  resize: vertical;
  min-height: 128px;
  max-height: 240px;
}

.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.contact-submit {
  padding: 0.8125rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  color: #ffffff;
  background: #1a1a1a;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.contact-submit:hover {
  background: #333333;
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .contact-bg::before,
  .contact-bg::after,
  .contact-bg__mesh {
    animation: none !important;
    transform: none !important;
  }

  .contact-section:not(.contact-section--in-view) .contact-left > *,
  .contact-section:not(.contact-section--in-view) .contact-form-card {
    opacity: 1;
    transform: none;
  }

  .contact-section.contact-section--in-view .contact-left > *,
  .contact-section.contact-section--in-view .contact-form-card {
    transition: none;
    transition-delay: 0s !important;
  }

  .contact-social-link:hover {
    transform: none;
  }
}

@media (max-width: 768px) {
  .contact-section {
    padding: 3rem 1.5rem;
    min-height: auto;
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-form-card {
    padding: 2rem 1.5rem;
  }
}
