/* Connect popup — styles for the form dialog that every "Connect with me"
 * opens. Loaded only by pages that do NOT already carry the homepage's inline
 * copy of these rules.
 *
 * Everything here is scoped under .ep on purpose. The sub-pages have no
 * `input, select, textarea` styling of their own (only the homepage does), so
 * the fields would render as raw browser controls. Scoping means adding them
 * cannot leak out and restyle anything else on those pages.
 *
 * An external stylesheet rather than JS-injected <style>: `style-src 'self'`
 * already allows it, and it paints with the page instead of flashing in a
 * frame later.
 */

.ep {
  position: fixed; inset: 0; z-index: 88;
  display: grid; place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: color-mix(in oklab, var(--denim-down) 72%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-slow) ease, visibility 0s linear var(--t-slow);
  overscroll-behavior: contain;
}
.ep.on { opacity: 1; visibility: visible; transition: opacity var(--t-slow) ease, visibility 0s; }

.ep-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 80px);
  overflow-y: auto;                 /* short laptops scroll the panel, not the page */
  background: var(--denim-up);
  border: 1px solid var(--seam);
  padding: var(--s7) var(--s6) var(--s6);
  transform: translateY(18px) scale(0.985);
  transition: transform var(--t-amb) cubic-bezier(0.16, 1, 0.3, 1);
}
.ep.on .ep-panel { transform: none; }

.ep-eyebrow { color: var(--marker); margin: 0 0 var(--s2); }
.ep-panel h3 {
  font-family: var(--display); color: var(--chalk); font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.02;
  letter-spacing: -0.02em; text-transform: uppercase; margin: 0 0 var(--s5);
}

.ep-close {
  position: absolute; top: var(--s3); right: var(--s3);
  appearance: none; border: 0; background: none; padding: 8px;
  color: var(--chalk); cursor: pointer; opacity: 0.55;
  transition: opacity var(--t-base), transform var(--t-base);
}
.ep-close:hover { opacity: 1; transform: rotate(90deg); }
.ep-close svg { width: 18px; height: 18px; display: block; }

.ep-form { display: grid; gap: var(--s4); }
.ep label { display: grid; gap: var(--s2); }

/* Form controls, scoped. 16px minimum is NOT cosmetic: below it, iOS Safari
   zooms the page on focus and never zooms back, so the layout lurches on the
   one flow that earns money. */
.ep input, .ep select, .ep textarea {
  font-family: var(--body);
  font-size: max(16px, 0.98rem);
  color: var(--chalk);
  background: var(--denim);
  border: 1px solid var(--seam);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--t-base);
}
.ep input:hover, .ep textarea:hover { border-color: var(--chalk-low); }
.ep input:focus, .ep textarea:focus { border-color: var(--marker); }
.ep textarea { resize: vertical; min-height: 74px; line-height: 1.5; }

.ep .f-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.ep .f-note { font-size: 0.82rem; color: var(--chalk-low); margin: 0; }
.ep .opt {
  font-style: normal; font-family: var(--body);
  text-transform: none; letter-spacing: 0;
  color: var(--chalk-low); font-size: 0.78rem; margin-left: var(--s2);
}

/* honeypot: off-screen, never visible, tabindex -1 in the markup so keyboard
   users cannot land in it either */
.ep .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.ep .choice { border: 0; margin: 0; padding: 0; }
.ep .choice legend { padding: 0; margin-bottom: var(--s3); }
.ep .chips { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--s2); }
.ep .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--seam);
  background: var(--denim);
  color: var(--chalk-mid);
  font-size: 0.86rem;
  cursor: pointer; user-select: none;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.ep .chip:hover { border-color: var(--chalk-low); color: var(--chalk); }
.ep .chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.ep .chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--seam);
  transition: background var(--t-fast), transform var(--t-fast);
}
.ep .chip:has(input:checked) { border-color: var(--marker); color: var(--chalk); background: var(--marker-dim); }
.ep .chip:has(input:checked)::before { background: var(--marker); transform: scale(1.15); }
.ep .chip:focus-within { outline: 2px solid var(--marker); outline-offset: 2px; }

@media (max-width: 560px) {
  .ep .f-row { grid-template-columns: 1fr; }
  .ep .chips { grid-template-columns: repeat(2, auto); }
}

/* 44px touch targets, matching the rest of the site */
@media (max-width: 900px) {
  .ep-close { min-width: 44px; min-height: 44px; display: inline-flex;
              align-items: center; justify-content: center; }
}
