/*
 * "Contact Us" pop-up (src/components/site/ContactModal.astro). Black panel, white text,
 * Oswald headings and thin corner brackets, like the site's bracketed buttons.
 */
.cm {
  --cm-line: rgba(255, 255, 255, 0.28);
  --cm-line-strong: #fff;
  --cm-error: #ff8a8a;
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
  font-family: 'Host Grotesk', 'Mulish', Arial, sans-serif;
  color-scheme: dark;
}
.cm *, .cm *::before, .cm *::after { box-sizing: border-box; }
.cm:not([open]) { display: none; }

.cm::backdrop {
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.cm[open] { animation: cm-in 0.22s ease-out; }
.cm[open]::backdrop { animation: cm-fade 0.22s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes cm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cm[open], .cm[open]::backdrop { animation: none; }
}

/* Page scroll lock while open (Lenis is also stopped by the script). */
html.cm-lock { overflow: hidden; }

.cm-panel {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 40px 36px 36px;
  background: #000;
  border: 1px solid var(--cm-line);
}

/* Corner brackets */
.cm-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 0 solid var(--cm-line-strong);
}
.cm-corner--tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.cm-corner--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.cm-corner--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.cm-corner--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.cm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.cm-close:hover { border-color: var(--cm-line); }
.cm-close:focus-visible, .cm-send:focus-visible, .cm-input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cm-title {
  margin: 0 0 8px;
  font-family: 'Oswald', Arial, sans-serif;
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}
.cm-title:focus { outline: none; }
.cm-lead {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

.cm-form { display: grid; gap: 20px; }
.cm-field { display: grid; gap: 8px; }
.cm-label {
  font-family: 'Oswald', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.cm-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cm-line);
  border-radius: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px; /* >= 16px stops iOS zooming into the field */
  line-height: 1.4;
  transition: border-color 0.2s;
}
.cm-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.cm-input:hover { border-color: rgba(255, 255, 255, 0.5); }
.cm-input:focus { border-color: var(--cm-line-strong); outline: none; }
.cm-input:focus-visible { outline: none; border-color: var(--cm-line-strong); box-shadow: 0 0 0 1px var(--cm-line-strong); }
.cm-input[aria-invalid='true'] { border-color: var(--cm-error); }
.cm-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.cm-select:invalid { color: rgba(255, 255, 255, 0.4); }
.cm-select option { background: #000; color: #fff; }
.cm-textarea { min-height: 128px; resize: vertical; }

.cm-meta { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cm-count { margin: 0 0 0 auto; font-size: 12px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; }
.cm-error, .cm-form-error { margin: 0; font-size: 13px; line-height: 1.4; color: var(--cm-error); }
.cm-error[hidden], .cm-form-error[hidden] { display: none; }
.cm-form-error { padding: 10px 12px; border: 1px solid var(--cm-error); }

/* Honeypot: off-screen, never visible to people or screen readers. */
.cm-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Send / Close reuse the site's bracketed "button-secondary" (label + arrow box). */
.cm-send {
  justify-self: start;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cm-send:disabled { opacity: 0.6; cursor: progress; }
.cm-view[hidden] { display: none; }

@media (max-width: 479px) {
  .cm-panel { padding: 36px 20px 24px; }
}
