/* contact.css — instrument-readout layout for /contact.
   One glass recipe, three text tokens, two corner radii.
   Cockpit accent for state changes only. */

/* ---------- Page shell ---------- */

.contact-page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  /* padding-bottom bumped so the cards have visible distance to the
     orange floor line in the footer (which sits ~28-40px below the
     footer's own top edge). */
  padding: clamp(8rem, 14vh, 10.5rem) clamp(1.25rem, 5vw, 3rem)
    clamp(4rem, 7vh, 5.5rem);
  gap: clamp(2.5rem, 6vh, 4rem);
}

/* ---------- Page head ---------- */

.contact-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 2vh, 1.35rem);
  text-align: center;
  max-width: 36rem;
}

.contact-title {
  margin: 0;
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--landing-fg);
}

.contact-lede {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  line-height: 1.6;
  color: var(--landing-fg-dim);
}

/* ---------- Two-card grid ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
  max-width: 1080px;
  align-items: stretch;
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--landing-line);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgb(8 14 26 / 70%) 0%,
    rgb(8 14 26 / 38%) 100%
  );
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 5%),
    0 8px 28px rgb(0 0 0 / 32%);
  backdrop-filter: saturate(140%) blur(12px);
}

.contact-card-info {
  gap: 1.5rem;
}

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

.contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.contact-form-label {
  display: block;
  font-family: Orbitron, system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--landing-fg-muted);
}

/* One control glass for inputs + phone-row + submit. The form reads
   as a single instrument cluster instead of three different chrome
   families. */
.contact-form input,
.contact-form textarea,
.contact-form-phone-row {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgb(0 0 0 / 22%);
  border: 1px solid var(--landing-line);
  border-radius: 8px;
  color: var(--landing-fg);
  font-family: Inter, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.contact-form textarea {
  resize: vertical;
  min-height: 110px;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--landing-fg-muted);
  opacity: 0.6;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  background: rgb(0 0 0 / 32%);
  border-color: var(--landing-cockpit-accent);
  box-shadow: 0 0 12px rgb(255 107 0 / 14%);
}

/* Phone — dial + national-format input share one bordered shell */
.contact-form-phone-row {
  display: grid;
  grid-template-columns: minmax(96px, max-content) 1fr;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.contact-form-phone-row:focus-within {
  background: rgb(0 0 0 / 32%);
  border-color: var(--landing-cockpit-accent);
  box-shadow: 0 0 12px rgb(255 107 0 / 14%);
}

.contact-form-field.is-error input,
.contact-form-field.is-error textarea,
.contact-form-field.is-error .contact-form-phone-row {
  border-color: #ef4444;
}

.contact-form-phone-dial {
  appearance: none;
  border: none;
  border-right: 1px solid var(--landing-line);
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='rgba(245,245,245,0.45)' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 7px;
  padding: 0.75rem 1.6rem 0.75rem 0.9rem;
  color: var(--landing-fg);
  font-family: Inter, system-ui, sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

.contact-form-phone-dial:focus {
  outline: none;
}

.contact-form-phone-dial option {
  background: #050814;
  color: var(--landing-fg);
}

.contact-form-phone-row input[type='tel'] {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.9rem;
}

.contact-form-phone-row input[type='tel']:focus {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Honeypot */
.contact-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* Consent checkbox — soft anti-bot (most bots skip checkboxes) plus
   compliance signal. Visually quiet so it doesn't crowd the form. */
.contact-form-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.25rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--landing-fg-dim);
  cursor: pointer;
}

/* Custom checkbox that matches the cockpit chrome — square with the
   same dark glass fill + 1px line border as the form inputs above,
   flips to filled cockpit-orange with a navy checkmark when checked.
   appearance:none drops the native widget; background-image SVG
   draws the tick (more reliable cross-browser than ::after on inputs). */
.contact-form-consent input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  background: rgb(0 0 0 / 22%);
  border: 1px solid var(--landing-line);
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.contact-form-consent input[type='checkbox']:hover {
  border-color: rgb(255 107 0 / 55%);
}

.contact-form-consent input[type='checkbox']:checked {
  background-color: var(--landing-cockpit-accent, #ff6b00);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23050814' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 8.5l3 3 6-7'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  border-color: var(--landing-cockpit-accent, #ff6b00);
}

.contact-form-consent input[type='checkbox']:focus-visible {
  outline: none;
  border-color: var(--landing-cockpit-accent, #ff6b00);
  box-shadow: 0 0 0 3px rgb(255 107 0 / 22%);
}

/* Submit — earns weight by position (right-aligned) not by scale.
   Same border + glass family as the inputs above so the control
   cluster reads as one. */
.contact-form-submit {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 0.7rem;
  padding: 0.75rem 1.6rem;
  margin-top: 0.5rem;
  border: 1px solid var(--landing-line);
  border-radius: 8px;
  background: rgb(0 0 0 / 22%);
  color: var(--landing-fg);
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.contact-form-submit:focus-visible {
  outline: 2px solid var(--landing-cockpit-accent);
  outline-offset: 3px;
}

.contact-form-submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.contact-form-submit:hover:not(:disabled) {
  background: rgb(0 0 0 / 32%);
  border-color: var(--landing-cockpit-accent);
  box-shadow: 0 0 16px rgb(255 107 0 / 18%);
}

.contact-form-arrow {
  display: inline-block;
  transition:
    transform 200ms ease,
    color 200ms ease;
}

.contact-form-submit:hover:not(:disabled) .contact-form-arrow {
  color: var(--landing-cockpit-accent);
  transform: translateX(3px);
}

.contact-form-status {
  margin: 0;
  text-align: right;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--landing-cockpit-accent);
}

.contact-form-status.is-error {
  color: #ff8a8a;
}

/* ---------- Success state (replaces the form after a successful send) ---------- */

/* The class-level `display: flex` rules on .contact-form and
   .contact-form-success would override the UA's [hidden]{display:none}
   (same specificity, author wins), so JS toggling `hidden` alone
   wouldn't hide them. This selector raises specificity so the hidden
   attribute actually takes effect on the swap. */
.contact-form[hidden],
.contact-form-success[hidden] {
  display: none;
}

/* flex:1 lets the success state fill whatever vertical space the form
   was occupying inside .contact-card-form (which itself stretches to
   match the taller .contact-card-info via the grid's align-items:
   stretch). justify-content:center then vertically centers the icon +
   text inside that filled area. align-self:stretch covers the case
   where the parent is in a flex layout that doesn't auto-stretch. */
.contact-form-success {
  flex: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.85rem, 2vh, 1.25rem);
  padding: clamp(1.5rem, 4vh, 2.5rem) 0.5rem;
  animation: contact-form-success-enter 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.contact-form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  border: 1.5px solid var(--landing-cockpit-accent, #ff6b00);
  background: rgb(255 107 0 / 8%);
  color: var(--landing-cockpit-accent, #ff6b00);
  box-shadow:
    0 0 0 6px rgb(255 107 0 / 6%),
    0 6px 22px rgb(255 107 0 / 18%);
}

.contact-form-success-icon svg {
  width: 32px;
  height: 32px;
}

.contact-form-success-kicker {
  margin: 0;
  font-family: Orbitron, system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--landing-cockpit-accent, #ff6b00);
}

.contact-form-success-title {
  margin: 0;
  max-width: 22em;
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--landing-fg);
}

/* Reassurance line under the headline — small + dim so it reads as
   supplementary, not as another headline. */
.contact-form-success-body {
  margin: 0;
  max-width: 28em;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(0.8rem, 1.05vw, 0.9rem);
  line-height: 1.55;
  color: var(--landing-fg-dim);
}

@keyframes contact-form-success-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Identity card ---------- */

.contact-identity {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-identity-brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--landing-line);
}

.contact-identity-name-primary {
  margin: 0;
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--landing-fg);
}

.contact-identity-tagline {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.85rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--landing-fg-muted);
}

.contact-identity-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.contact-identity-org {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-identity-prefix {
  font-family: Orbitron, system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--landing-fg-muted);
}

/* Identity names sit at fg-dim (78%) by default — both static and
   linked. The link still inherits this color until :hover, where it
   flips to the cockpit accent. Reads as quiet metadata where
   interaction is signaled by hover state, not by base color. */
.contact-identity-name {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--landing-fg-dim);
  text-decoration: none;
}

.contact-identity-meta {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--landing-fg-muted);
}

.contact-identity-link {
  color: inherit;
  transition: color 200ms ease;
}

/* When the link also carries .contact-identity-name (the "Grapes Vision
   Fund" case), the `color: inherit` above would otherwise win by source
   order and pull the body's full-white color. Higher-specificity rule
   pins the link to the same fg-dim as the static <strong> name, so both
   labels read identically at rest. The :hover rule below still wins
   because it has matching specificity AND comes later. */
a.contact-identity-name {
  color: var(--landing-fg-dim);
}

.contact-identity-link:hover,
.contact-identity-link:focus-visible {
  color: var(--landing-cockpit-accent);
  outline: none;
}

/* ---------- Map ---------- */

.contact-map {
  position: relative;
  flex: 1;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--landing-line);
  border-radius: 8px;
  background: #050814;
}

.contact-map #map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
}

.contact-map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 220px;
  gap: 0.55rem;
  color: var(--landing-fg-muted);
}

.contact-map-fallback svg {
  opacity: 0.45;
}

.contact-map-fallback p {
  margin: 0;
  font-size: 0.85rem;
}

.contact-map-fallback a {
  font-family: Orbitron, system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--landing-cockpit-accent);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 200ms ease;
}

.contact-map-fallback a:hover,
.contact-map-fallback a:focus-visible {
  opacity: 1;
  outline: none;
}

.contact-map-caption {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--landing-fg-muted);
}

.contact-map-caption svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Strip Google Maps' default chrome */
.contact-map .gm-style {
  background: #050814 !important;
  border: none !important;
  outline: none !important;
}

.contact-map .gm-style > div,
.contact-map .gm-style iframe {
  border: none !important;
  outline: none !important;
}

.contact-map .gm-style-cc,
.contact-map .gmnoprint:not(.gm-bundled-control) {
  opacity: 0.4 !important;
  transform: scale(0.85);
  transform-origin: bottom right;
}

.contact-map .gm-style-cc:hover,
.contact-map .gmnoprint:not(.gm-bundled-control):hover {
  opacity: 0.7 !important;
}

/* ---------- Entry animations ---------- */

@media (prefers-reduced-motion: no-preference) {
  .contact-page > *,
  .contact-form > * {
    opacity: 0;
    transform: translateY(8px);
    animation: landing-enter 700ms ease forwards;
  }

  .contact-head {
    animation-delay: 100ms;
  }

  .contact-grid {
    animation-delay: 200ms;
  }

  .contact-form > *:nth-child(1) {
    animation-delay: 300ms;
  }

  .contact-form > *:nth-child(2) {
    animation-delay: 360ms;
  }

  .contact-form > *:nth-child(3) {
    animation-delay: 420ms;
  }

  .contact-form > *:nth-child(4) {
    animation-delay: 480ms;
  }

  .contact-form > *:nth-child(5),
  .contact-form > *:nth-child(6) {
    animation-delay: 540ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-page > *,
  .contact-form > * {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (width <= 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .contact-card-info {
    order: 2;
  }
}

@media (width <= 640px) {
  .contact-page {
    padding-top: clamp(6.5rem, 12vh, 8rem);
  }

  .contact-form-phone-row {
    grid-template-columns: minmax(86px, max-content) 1fr;
  }

  .contact-form-phone-dial {
    padding: 0.75rem 1.4rem 0.75rem 0.7rem;
    font-size: 0.9rem;
  }

  .contact-form-submit {
    align-self: stretch;
    justify-content: center;
  }

  .contact-form-status {
    text-align: center;
  }

  .contact-card {
    padding: clamp(1.25rem, 5vw, 1.6rem);
  }
}
