/* Contact page — extends neo-brutalist theme (variables from neo-styles.css) */

.contact-page-main {
  --contact-shadow-hard: color-mix(in srgb, var(--border) 88%, var(--primary));
  --contact-deep-1: #2f114a;
  --contact-deep-2: #4b1f73;
  --contact-soft-1: #b57af3;
  margin: 1.5rem auto 1.2rem;
  width: min(1200px, calc(100% - 2rem));
  padding-bottom: 3rem;
}

/* —— Hero —— Framed card + bold offset shadows (site-wide parity) */
.contact-hero {
  position: relative;
  margin: 0 0 2.5rem;
  padding: 0;
  overflow: hidden;
  border: var(--border-width) solid var(--border);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--contact-shadow-hard);
}

body[data-theme='dark'] .contact-hero {
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.52);
}

.contact-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(155, 93, 229, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 80%, rgba(181, 23, 158, 0.22) 0%, transparent 50%),
    linear-gradient(165deg, rgba(247, 242, 255, 0.95) 0%, rgba(224, 170, 255, 0.45) 45%, rgba(199, 125, 255, 0.35) 100%);
}

body[data-theme="dark"] .contact-hero__bg {
  background:
    radial-gradient(ellipse 70% 55% at 20% 25%, rgba(155, 93, 229, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% 75%, rgba(199, 125, 255, 0.18) 0%, transparent 50%),
    linear-gradient(170deg, #1a0f2e 0%, #120a1f 55%, #0a0512 100%);
}

.contact-hero__pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.08;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

body[data-theme="dark"] .contact-hero__pattern {
  opacity: 0.12;
}

/* Monitor-style lines at hero bottom (Impact / News parity: sine + EKG) */
.contact-hero__monitor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  height: clamp(76px, 11vw, 118px);
  padding: 0 0 0.65rem;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.contact-monitor__sine-wrap,
.contact-monitor__ekg-wrap {
  overflow: hidden;
  width: 100%;
  flex: 0 0 auto;
}

.contact-monitor__sine-wrap {
  height: clamp(28px, 4.5vw, 40px);
  color: color-mix(in srgb, var(--contact-deep-2) 82%, var(--contact-soft-1));
  opacity: 0.88;
}

.contact-monitor__sine {
  width: 200%;
  height: 100%;
  display: block;
  animation: contactSineFlow 22s linear infinite;
}

.contact-monitor__ekg-wrap {
  height: clamp(30px, 4.8vw, 44px);
  color: var(--contact-deep-1);
  opacity: 0.92;
}

body[data-theme='dark'] .contact-monitor__sine-wrap {
  color: color-mix(in srgb, #c4b5fd 55%, var(--contact-soft-1));
  opacity: 0.75;
}

body[data-theme='dark'] .contact-monitor__ekg-wrap {
  color: rgba(255, 255, 255, 0.72);
  opacity: 0.88;
}

.contact-monitor__ekg {
  width: 200%;
  height: 100%;
  display: block;
  animation: contactEkgSlide 10s linear infinite;
}

@keyframes contactSineFlow {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes contactEkgSlide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.contact-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.1rem) 1.25rem clamp(2rem, 5vw, 3.25rem);
  text-align: center;
}

.contact-hero__badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.55);
  border: var(--border-width) solid var(--border);
  border-radius: 999px;
  box-shadow: 5px 5px 0 var(--contact-shadow-hard);
  backdrop-filter: blur(8px);
}

body[data-theme="dark"] .contact-hero__badge {
  background: rgba(36, 19, 58, 0.75);
  color: var(--text);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.48);
}

.contact-hero__title {
  font-family: 'Baloo Da 2', sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 1rem;
  text-shadow: 3px 3px 0 rgba(155, 93, 229, 0.25);
}

body[data-theme="dark"] .contact-hero__title {
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.contact-hero__lead {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.65;
  color: var(--text);
  opacity: 0.92;
  max-width: 40rem;
  margin: 0 auto;
}

/* —— Layout —— */
.contact-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
}

@media (max-width: 960px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* —— Form card —— */
.contact-form-card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--contact-shadow-hard);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.contact-form-card:hover {
  box-shadow: 10px 10px 0 var(--contact-shadow-hard);
}

body[data-theme="dark"] .contact-form-card {
  background: linear-gradient(145deg, rgba(36, 19, 58, 0.92) 0%, rgba(18, 10, 31, 0.98) 100%);
  border-color: var(--border);
}

.contact-form-card__title {
  font-family: 'Baloo Da 2', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: var(--border-width) solid var(--border);
  display: inline-block;
}

.cp-field {
  margin-bottom: 1.15rem;
}

.cp-label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.cp-optional {
  font-weight: 500;
  opacity: 0.65;
  font-size: 0.85em;
}

.cp-input,
.cp-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: var(--border-width) solid var(--border);
  border-radius: 10px;
  box-shadow: inset 0 2px 6px rgba(47, 23, 79, 0.06);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

body[data-theme="dark"] .cp-input,
body[data-theme="dark"] .cp-textarea {
  background: rgba(9, 5, 17, 0.55);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cp-input:hover,
.cp-textarea:hover {
  border-color: var(--primary);
}

.cp-input:focus,
.cp-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow:
    inset 0 2px 6px rgba(47, 23, 79, 0.06),
    0 0 0 3px rgba(155, 93, 229, 0.35);
}

body[data-theme="dark"] .cp-input:focus,
body[data-theme="dark"] .cp-textarea:focus {
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(199, 125, 255, 0.35);
}

.cp-textarea {
  min-height: 160px;
  resize: vertical;
}

.cp-field--error .cp-input,
.cp-field--error .cp-textarea {
  border-color: #c1121f;
  box-shadow: inset 0 2px 6px rgba(193, 18, 31, 0.12);
}

.cp-error-msg {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c1121f;
}

.cp-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.9rem 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: linear-gradient(180deg, var(--cyan) 0%, var(--primary) 100%);
  border: var(--border-width) solid var(--border);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--contact-shadow-hard);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cp-submit:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--contact-shadow-hard);
  filter: brightness(1.05);
}

.cp-submit:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--border);
}

.cp-submit:focus-visible {
  outline: none;
  box-shadow:
    5px 5px 0 var(--contact-shadow-hard),
    0 0 0 3px rgba(155, 93, 229, 0.45);
}

.cp-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Success state */
.contact-success {
  padding: 1.5rem;
  text-align: center;
  border-radius: 12px;
  border: var(--border-width) solid var(--border);
  background: linear-gradient(135deg, rgba(168, 230, 207, 0.55) 0%, rgba(155, 93, 229, 0.2) 100%);
  box-shadow: 8px 8px 0 var(--contact-shadow-hard);
}

body[data-theme="dark"] .contact-success {
  background: linear-gradient(135deg, rgba(36, 19, 58, 0.9) 0%, rgba(18, 80, 60, 0.35) 100%);
}

.contact-success__icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--border);
}

.contact-success__title {
  font-family: 'Baloo Da 2', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.contact-success__text {
  margin: 0;
  line-height: 1.55;
  opacity: 0.95;
}

.cp-send-another {
  margin-top: 1.25rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--contact-shadow-hard);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cp-send-another:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--contact-shadow-hard);
}

.cp-send-another:focus-visible {
  outline: none;
  box-shadow: 4px 4px 0 var(--contact-shadow-hard), 0 0 0 3px rgba(155, 93, 229, 0.4);
}

body[data-theme="dark"] .cp-send-another {
  background: rgba(36, 19, 58, 0.9);
}

#contact-form[hidden],
.contact-form-card__form-wrap[hidden] {
  display: none !important;
}

/* —— Info column —— */
.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-info-card {
  padding: 1.25rem 1.35rem;
  background: var(--white);
  border: var(--border-width) solid var(--border);
  border-radius: 12px;
  box-shadow: 8px 8px 0 var(--contact-shadow-hard);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-info-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--contact-shadow-hard);
}

body[data-theme="dark"] .contact-info-card {
  background: linear-gradient(160deg, rgba(36, 19, 58, 0.88) 0%, rgba(18, 10, 31, 0.95) 100%);
}

.contact-info-card__title {
  font-family: 'Baloo Da 2', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.contact-info-row {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.95rem;
}

.contact-info-row:last-child {
  margin-bottom: 0;
}

.contact-info-row__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  background: var(--accent);
  border: var(--border-width) solid var(--border);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--contact-shadow-hard);
}

.contact-info-row__body {
  flex: 1;
  min-width: 0;
}

.contact-info-row__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.2rem;
}

.contact-info-row__value {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.contact-info-row__value a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-info-row__value a:hover {
  color: var(--pink);
}

.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contact-tag-pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--accent);
  box-shadow: 4px 4px 0 var(--contact-shadow-hard);
  transition: transform 0.15s ease;
}

.contact-tag-pill:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--contact-shadow-hard);
}

/* —— Map —— */
.contact-map-section {
  margin-top: 2.5rem;
  padding: 0 1.25rem 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.contact-map-section__title {
  font-family: 'Baloo Da 2', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 1rem;
  text-align: center;
}

.contact-map-section__hint {
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.85;
  max-width: 36rem;
  margin: -0.35rem auto 1.25rem;
}

/* Leaflet journey map (matches home page; heights override neo #journey-map) */
.contact-map-section .journey-map-container {
  height: 520px;
  border-radius: 14px;
  overflow: hidden;
  max-width: 100%;
  position: relative;
}

.contact-map-section #contact-journey-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
}

/* Match Previous Project map mascot overlay */
.contact-map-pirate-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 240px;
  height: auto;
  z-index: 1000;
  pointer-events: none;
}

.contact-map-badge {
  position: absolute;
  bottom: 22px;
  left: 22px;
  z-index: 1001;
  pointer-events: none;
  display: none;
}

.contact-map-badge__pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 23, 158, 0.28) 0%, rgba(181, 23, 158, 0) 70%);
  display: none;
}

.contact-map-badge__chip {
  position: relative;
  width: 120px;
  height: 120px;
  border: none;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  transform: rotate(-2deg);
  display: block;
  animation: contactMapBob 3s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
  overflow: hidden;
}

.contact-map-badge__chip:focus-visible {
  outline: 3px solid rgba(47, 17, 74, 0.45);
  outline-offset: 3px;
}

.contact-map-badge__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: var(--border-width) solid var(--border);
  box-shadow: 6px 6px 0 var(--contact-shadow-hard);
}

body[data-theme="dark"] .contact-map-badge__img {
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.52);
}

@media (max-width: 640px) {
  .contact-map-section .journey-map-container,
  .contact-map-section #contact-journey-map {
    height: 360px;
  }

  .contact-map-badge {
    bottom: 14px;
    left: 14px;
  }

  .contact-map-pirate-overlay {
    width: 100px;
    bottom: 5px;
    left: 5px;
  }

  .contact-map-badge__chip {
    width: 84px;
    height: 84px;
  }
}

/* —— Animations —— */
@media (prefers-reduced-motion: no-preference) {
  .contact-animate {
    opacity: 0;
    animation: contactFadeUp 0.65s ease forwards;
  }

  .contact-animate--delay-1 {
    animation-delay: 0.08s;
  }

  .contact-animate--delay-2 {
    animation-delay: 0.16s;
  }

  .contact-animate--delay-3 {
    animation-delay: 0.24s;
  }

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

  @keyframes contactMapPulse {
    0% {
      opacity: 0.65;
      transform: translate(-50%, -50%) scale(0.72);
    }
    100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(1.3);
    }
  }

  @keyframes contactMapBob {
    0%,
    100% {
      transform: rotate(-6deg) translateY(0);
    }
    50% {
      transform: rotate(-4deg) translateY(-4px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-animate {
    opacity: 1;
  }

  .contact-map-badge__chip {
    animation: none;
  }

  .contact-monitor__sine,
  .contact-monitor__ekg {
    animation: none;
  }
}

/* Contact map popup: remove outer white rounded container */
.contact-map-section .leaflet-popup-content-wrapper {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.contact-map-section .leaflet-popup-content {
  margin: 0 !important;
}

.contact-map-section .leaflet-popup-tip-container {
  display: none !important;
}

.contact-map-section .map-popup {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 14px;
  overflow: hidden;
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 var(--contact-shadow-hard);
}

.contact-map-section .map-popup-country {
  border-bottom: none;
}

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