/* ================================================================
   Cavrix Enhance Layer — CSS
   Matches existing tokens: General Sans (display), JetBrains Mono,
   #030303 base, white/5 borders. Additive only — no theme changes.
   ================================================================ */

/* ---------- Stay Connected section ---------- */
.cvx-nl {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 96px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
}
@media (min-width: 768px) { .cvx-nl { padding: 128px 24px; } }

.cvx-nl-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .cvx-nl-inner { grid-template-columns: 1.1fr 1fr; gap: 64px; }
}

.cvx-nl-kicker {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717a;
  margin-bottom: 20px;
  user-select: none;
}

.cvx-nl-heading {
  font-family: "General Sans", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 16px;
}

.cvx-nl-sub {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
  max-width: 26rem;
  margin: 0;
}

.cvx-nl-form { width: 100%; }

.cvx-nl-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cvx-nl-input {
  flex: 1 1 240px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 20px;
  color: #fff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}
.cvx-nl-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.cvx-nl-input:hover { border-color: rgba(255, 255, 255, 0.15); }
.cvx-nl-input:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.cvx-nl-input.is-invalid { border-color: rgba(248, 113, 113, 0.6); }

.cvx-nl-btn {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 16px;
  padding: 16px 28px;
  font-family: "General Sans", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, opacity 0.3s ease;
  user-select: none;
}
.cvx-nl-btn:hover { transform: translateY(-2px); }
.cvx-nl-btn:active { transform: translateY(0) scale(0.98); }
.cvx-nl-btn:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 3px; }
.cvx-nl-btn:disabled { opacity: 0.7; cursor: wait; transform: none; }

.cvx-nl-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid #000;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cvx-spin 0.8s linear infinite;
}
.cvx-nl-btn.is-busy .cvx-nl-spinner { display: inline-block; }
.cvx-nl-btn.is-busy .cvx-nl-btn-label { opacity: 0.6; }
@keyframes cvx-spin { to { transform: rotate(360deg); } }

.cvx-nl-msg {
  min-height: 20px;
  margin: 12px 2px 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: transparent;
  transition: color 0.3s ease;
}
.cvx-nl-msg.is-ok  { color: #34d399; }
.cvx-nl-msg.is-err { color: #f87171; }

/* honeypot + screen-reader-only */
.cvx-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cvx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Project modal "VISIT LIVE SITE" link ---------- */
.cvx-live-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
  padding: 15px 24px;
  background: #fff;
  color: #000;
  border-radius: 16px;
  font-family: "General Sans", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  user-select: none;
}
.cvx-live-link:hover { transform: translateY(-2px); }
.cvx-live-link:active { transform: scale(0.98); }
.cvx-live-link:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 3px; }
.cvx-live-link svg { transition: transform 0.3s ease; }
.cvx-live-link:hover svg { transform: translate(2px, -2px); }

.cvx-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  animation: cvx-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes cvx-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Global additive UX polish (no theme changes) ---------- */

/* Consistent, accessible keyboard focus everywhere (invisible for mouse users) */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect users who prefer reduced motion — pauses our additions only */
@media (prefers-reduced-motion: reduce) {
  .cvx-nl-btn, .cvx-live-link, .cvx-live-dot, .cvx-nl-spinner { animation: none !important; transition: none !important; }
}

/* Slightly smoother tap targets on touch devices */
@media (pointer: coarse) {
  .cvx-nl-input, .cvx-nl-btn { padding-top: 18px; padding-bottom: 18px; }
}

/* ============================================================
   DEVICE STABILITY LAYER (additive — theme untouched)
   ============================================================ */

/* kill accidental horizontal scroll from off-screen GSAP elements */
html, body { overflow-x: clip; }

/* stop iOS/Android font inflation from breaking the editorial layout */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* notch / home-indicator safe areas */
.cvx-nl { 
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* comfortable touch targets on coarse pointers */
@media (pointer: coarse) {
  .cvx-nl-btn,
  .cvx-nl-input,
  .cvx-live-link { min-height: 48px; }
  .cvx-live-link { padding: 14px 22px; }
}

/* small phones: newsletter stacks, no squeeze */
@media (max-width: 480px) {
  .cvx-nl-row { flex-direction: column; }
  .cvx-nl-row > * { width: 100%; }
  .cvx-nl-heading { font-size: clamp(26px, 8vw, 36px); }
}

/* landscape phones: keep section from eating the viewport */
@media (max-height: 480px) and (orientation: landscape) {
  .cvx-nl { padding-top: 32px; padding-bottom: 32px; }
}

/* cheaper compositing on mobile for our injected elements only */
@media (max-width: 768px) {
  .cvx-nl, .cvx-live-link { will-change: auto; }
  .cvx-live-dot { animation-duration: 2.4s; } /* slower pulse = fewer paints */
}
