.cm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(12,10,20,.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s cubic-bezier(.23,1,.32,1);
}
.cm-overlay.open { opacity: 1; pointer-events: auto; }

.cm-modal {
  position: relative;
  width: 100%; max-width: 920px;
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
  transform: translateY(24px) scale(.98);
  opacity: 0;
  transition: transform .45s cubic-bezier(.23,1,.32,1), opacity .35s cubic-bezier(.23,1,.32,1);
  display: grid; grid-template-columns: 1.3fr 1fr;
  cursor: auto;
}
.cm-overlay.open .cm-modal { transform: translateY(0) scale(1); opacity: 1; }

.cm-close {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink);
  cursor: none;
  transition: background .2s, transform .2s, border-color .2s;
}
.cm-close:hover { background: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

.cm-form-side {
  padding: 48px 44px 44px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 20px;
}
.cm-eyebrow {
  font-family: 'SF Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; letter-spacing: .14em;
  color: var(--ink3); text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
}
.cm-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(180,216,0,.2);
  animation: pulse 2s infinite;
}
.cm-h {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400; font-style: italic;
  font-size: 38px; line-height: 1.1; letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.cm-sub { font-size: 14px; color: var(--ink2); line-height: 1.55; margin-bottom: 4px; }
/* Floating-label fields. Label sits inside the input as a placeholder, floats
   up to the label position on hover, focus, or when the field has content. */
.cm-field {
  position: relative;
  padding-top: 18px;
}
.cm-label {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink3);
  transform-origin: left center;
  /* Default position: sits at input baseline, full size — looks like a placeholder */
  transform: translateY(28px) scale(1);
  transition: transform .3s cubic-bezier(.23,1,.32,1), color .25s;
}
.cm-input, .cm-textarea {
  font-family: 'Inter', sans-serif;
  font-size: 15px; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--border);
  padding: 10px 0;
  outline: none;
  width: 100%;
  transition: border-color .25s;
}
/* Placeholder hidden until focus; label acts as the placeholder when empty */
.cm-input::placeholder, .cm-textarea::placeholder {
  color: transparent;
  transition: color .2s .05s;
}
.cm-input:focus::placeholder,
.cm-textarea:focus::placeholder {
  color: var(--ink3);
}
.cm-input:focus, .cm-textarea:focus { border-bottom-color: var(--accent); }

/* On hover/focus/has-content: label floats up and shrinks */
.cm-field:hover .cm-label,
.cm-input:focus ~ .cm-label,
.cm-input:not(:placeholder-shown) ~ .cm-label,
.cm-textarea:focus ~ .cm-label,
.cm-textarea:not(:placeholder-shown) ~ .cm-label {
  transform: translateY(0) scale(0.72);
  color: var(--ink2);
}
.cm-input:focus ~ .cm-label,
.cm-textarea:focus ~ .cm-label { color: var(--accent-dark); }
.cm-textarea {
  resize: none; min-height: 76px;
  font-family: 'Inter', sans-serif;
}
.cm-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }

.cm-submit {
  margin-top: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  align-self: flex-start;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--accent); border: 1.5px solid var(--accent);
  height: 46px; padding: 0 22px; border-radius: 6px;
  cursor: none;
  transition: box-shadow .25s, transform .2s;
}
.cm-submit:hover { box-shadow: 0 4px 16px rgba(180,216,0,.45); transform: translateY(-1px); }
.cm-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }
.cm-submit-arrow { transition: transform .25s; }
.cm-submit:hover .cm-submit-arrow { transform: translateX(3px); }

.cm-form-error {
  font-size: 12px; color: #c4443a;
  min-height: 14px;
  margin: 0;
}
.cm-form-error:empty { display: none; }

.cm-side {
  padding: 48px 40px 44px;
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column; gap: 28px;
  position: relative; overflow: hidden;
}
.cm-side::after {
  content: ''; position: absolute;
  right: -120px; bottom: -120px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(180,216,0,.18), transparent 70%);
  pointer-events: none;
}
.cm-side-eyebrow {
  font-family: 'SF Mono', monospace;
  font-size: 10px; letter-spacing: .14em;
  color: rgba(255,255,255,.5); text-transform: uppercase;
}
.cm-side h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400; font-size: 22px; line-height: 1.25;
  color: #fff;
  letter-spacing: -.005em;
  max-width: 14ch;
}
.cm-detail {
  display: flex; flex-direction: column; gap: 4px;
  position: relative; z-index: 1;
}
.cm-detail-label {
  font-family: 'SF Mono', monospace;
  font-size: 10px; letter-spacing: .12em;
  color: rgba(255,255,255,.4); text-transform: uppercase;
}
.cm-detail-val {
  font-size: 15px; color: #fff; font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
a.cm-detail-val:hover { color: var(--accent); }

.cm-socials {
  display: flex; flex-direction: column; gap: 12px;
  position: relative; z-index: 1;
}
.cm-social {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 14px; color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color .2s, padding .2s;
}
.cm-social:last-child { border-bottom: 1px solid rgba(255,255,255,.1); }
.cm-social:hover { color: var(--accent); padding-left: 6px; }
.cm-social-arrow { font-size: 13px; opacity: .5; transition: opacity .2s, transform .2s; }
.cm-social:hover .cm-social-arrow { opacity: 1; transform: translate(3px, -3px); }

.cm-thanks {
  display: none;
  flex-direction: column; gap: 12px; align-items: flex-start;
  padding-top: 8px;
}
.cm-thanks.show { display: flex; }
.cm-form-content.hidden { display: none; }
.cm-thanks-h {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-size: 32px;
  color: var(--ink); letter-spacing: -.005em;
}
.cm-thanks-p { font-size: 14px; color: var(--ink2); }

@media (max-width: 720px) {
  .cm-modal { grid-template-columns: 1fr; max-width: 480px; }
  .cm-form-side { padding: 36px 28px 28px; }
  .cm-side { padding: 32px 28px; }
  .cm-h { font-size: 30px; }
}

/* Mobile: stack modal at top, allow vertical scrolling inside the overlay */
@media (max-width: 600px) {
  .cm-overlay {
    overflow-y: auto;
    align-items: flex-start;
    padding: 16px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .cm-modal {
    max-width: 100%;
    margin: 0 auto;
    grid-template-columns: 1fr;
    border-radius: 12px;
  }
  .cm-form-side { padding: 56px 22px 24px; }
  .cm-side { padding: 28px 22px; gap: 22px; }
  .cm-h { font-size: 26px; }
  .cm-sub { font-size: 13px; }
  .cm-input, .cm-textarea { font-size: 14px; padding: 8px 0; }
  .cm-textarea { min-height: 64px; }
  .cm-form { gap: 14px; }
  .cm-submit { height: 42px; padding: 0 18px; font-size: 13px; }
  .cm-side h3 { font-size: 18px; }
  .cm-detail-val { font-size: 14px; }
  .cm-social { padding: 10px 0; font-size: 13px; }
  .cm-thanks-h { font-size: 26px; }
  /* Close button: keep clickable inside the rounded corner on tight viewports */
  .cm-close { top: 12px; right: 12px; width: 32px; height: 32px; font-size: 16px; }
}
