/* =========================================================
   Discuss a Project page (contact.html) only.
   Every rule is scoped to .contact-page or a class starting
   with cx-/cx__, so no other page can change.
   Palette: ivory #ece4dc, near-black #000001, cyan #00f0ff.
   ========================================================= */

.contact-page {
  --cx-bg: #ece4dc;
  --cx-ink: #000001;
  --cx-soft: rgba(0, 0, 1, .66);
  --cx-line: rgba(0, 0, 1, .26);
  --cx-line-hi: rgba(0, 0, 1, .55);
  --cx-field: rgba(255, 255, 255, .32);
  --cx-error: #a3132e;
  background: var(--canvas);
}
:where(.contact-page main) :where(h1, h2, p, ul, fieldset, legend) { margin: 0; }
.cx-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Shared header: "Discuss a Project" is the current page (cyan) */
.contact-page .header-cta[aria-current="page"],
.contact-page .mobile-menu__cta[aria-current="page"] { box-shadow: 0 0 0 1.5px var(--cx-ink); }
.contact-page .header-cta:focus-visible,
.contact-page .mobile-menu__cta:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 3px; }

/* ---------- Section ---------- */
.cx {
  position: relative;
  isolation: isolate;
  margin: var(--frame-gap) var(--frame-gap) var(--frame-gap);
  border-radius: var(--radius-frame);
  overflow: hidden;
  overflow: clip;
  background: var(--cx-bg);
  color: var(--cx-ink);
  padding: calc(var(--header-h) + clamp(40px, 5vw, 72px)) 0 clamp(64px, 7vw, 104px);
}
.cx::after {                       /* subtle paper texture over the whole section (no seams) */
  content: "";
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cx__grid {
  position: relative;
  width: min(100% - 2 * clamp(20px, 5vw, 64px), 1240px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-areas:
    "intro form"
    "art   form"
    "contact form";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(48px, 7vw, 112px);
}
.cx__intro { grid-area: intro; }
.cx__art { grid-area: art; }
.cx__form-wrap { grid-area: form; scroll-margin-top: 24px; }
.cx__contact { grid-area: contact; align-self: end; }

/* ---------- Left: introduction ---------- */
.cx__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 4.7vw, 4.75rem);
  line-height: .98;
  letter-spacing: -.02em;
}
.cx__line { display: block; }
@media (min-width: 1024px) { .cx__line { white-space: nowrap; } }
.cx__title em { font-style: italic; }
.cx__title::after {                /* short cyan rule under the headline */
  content: "";
  display: block;
  width: 56px; height: 4px;
  margin-top: clamp(22px, 2.4vw, 30px);
  border-radius: 2px;
  background: var(--cyan);
}
.cx__lede {
  margin-top: clamp(20px, 2.2vw, 28px);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 500;
  line-height: 1.4;
}
.cx__small { margin-top: 12px; font-size: 1.05rem; color: var(--cx-soft); }

/* ---------- Left: astronaut (compact) ---------- */
.cx__art { margin-top: clamp(20px, 2.6vw, 36px); }
.cx__art-move { width: min(100%, 430px); margin-left: -4%; will-change: transform; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.cx__art img { display: block; width: 100%; height: auto; }

/* ---------- Left: contact ---------- */
.cx__contact { margin-top: clamp(32px, 4vw, 56px); padding-top: 8px; }
.cx__contact-title { font-family: var(--sans); font-size: .875rem; font-weight: 400; color: var(--cx-soft); }
.cx__contact-list { margin-top: 12px; padding: 0; list-style: none; display: grid; gap: 4px; }
.cx__contact-list a {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 36px;
  font-size: 1rem; font-weight: 400;
  color: var(--cx-ink);
  text-decoration: none;
  border-radius: 6px;
}
.cx__contact-list a span { border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.cx__contact-list a:hover span { border-bottom-color: currentColor; }
.cx__contact-list a:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 3px; }
.cx-ico { width: 18px; height: 18px; flex: none; color: var(--cx-ink); opacity: .8; }

/* ---------- Right: form ---------- */
.cx__form-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 2.6vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
}
.cx-form { margin-top: clamp(24px, 2.8vw, 36px); display: grid; gap: 20px; }
.cx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cx-field { display: grid; gap: 8px; align-content: start; }
.cx-label { font-size: .95rem; font-weight: 500; color: var(--cx-ink); }
.cx-label--group { padding: 0; font-size: 1.05rem; font-weight: 600; }
.cx-field--group .cx-label { font-size: 1.05rem; font-weight: 600; }
.cx-req { color: var(--cx-soft); font-weight: 400; }
.cx-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--cx-line);
  border-radius: 10px;
  background: var(--cx-field);
  color: var(--cx-ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.cx-input::placeholder { color: rgba(0, 0, 1, .48); }
.cx-input:hover { border-color: var(--cx-line-hi); }
.cx-input:focus { outline: none; border-color: var(--cx-ink); background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px rgba(0, 240, 255, .55); }
.cx-input[aria-invalid="true"] { border-color: var(--cx-error); }
.cx-textarea { min-height: 128px; resize: vertical; }
.cx-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4.5L12.5 6' fill='none' stroke='%23000001' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 16px;
}
.cx-error { font-size: .9rem; color: var(--cx-error); }
.cx-error[hidden] { display: none; }

/* service pills: real checkboxes */
.cx-services { min-width: 0; padding: 4px 0 0; border: 0; }
.cx-pills { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.cx-pill { position: relative; display: inline-flex; cursor: pointer; }
.cx-pill input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.cx-pill__face {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--cx-line-hi);
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--cx-ink);
  background: transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cx-pill__tick { width: 0; height: 16px; opacity: 0; transition: width .2s ease, opacity .2s ease; }
.cx-pill:hover .cx-pill__face { border-color: var(--cx-ink); background: rgba(255, 255, 255, .35); }
.cx-pill input:checked + .cx-pill__face { background: var(--cx-ink); border-color: var(--cx-ink); color: #fff; }
.cx-pill input:checked + .cx-pill__face .cx-pill__tick { width: 16px; opacity: 1; color: var(--cyan); }
.cx-pill input:focus-visible + .cx-pill__face { outline: 2px solid var(--cx-ink); outline-offset: 3px; box-shadow: 0 0 0 5px rgba(0, 240, 255, .5); }
.cx-services[aria-invalid="true"] .cx-pill__face { border-color: var(--cx-error); }
.cx-services .cx-error { margin-top: 10px; }

/* spam trap: off-screen, never shown */
.cx-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* submit */
.cx-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 8px; }
.cx-submit__btn { min-height: 58px; padding: 0 34px; font-size: 1.1rem; font-weight: 600; cursor: pointer; }
.cx-submit__btn:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 4px; }
.cx-submit__btn[aria-disabled="true"] { opacity: .7; cursor: progress; }
.cx-submit__help { font-size: .95rem; color: var(--cx-soft); }

/* status message */
.cx-status {
  padding: 18px 20px;
  border: 1px solid var(--cx-line);
  border-left: 4px solid var(--cx-ink);
  border-radius: 10px;
  background: rgba(255, 255, 255, .45);
  font-size: 1rem;
  line-height: 1.5;
}
.cx-status:focus { outline: none; }
.cx-status:focus-visible { outline: 2px solid var(--cx-ink); outline-offset: 3px; }
.cx-status[hidden] { display: none; }
.cx-status--ok { border-left-color: #00b8c4; }
.cx-status--error { border-left-color: var(--cx-error); }
.cx-status strong { display: block; font-weight: 600; }
.cx-status p { margin-top: 4px; }
.cx-status a { color: var(--cx-ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) { .cx-br { display: none; } }
@media (max-width: 1023px) {
  .cx__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "art" "form" "contact";
    grid-template-rows: none;
    max-width: 680px;
  }
  .cx__art-move { width: min(100%, 360px); margin-left: 0; }
  .cx__form-wrap { margin-top: clamp(28px, 5vw, 48px); }
  .cx__contact { margin-top: clamp(44px, 7vw, 64px); padding-top: 28px; border-top: 1px solid var(--cx-line); }
}
@media (max-width: 599px) {
  .cx { padding-top: calc(var(--header-h) + 32px); padding-bottom: 56px; }
  .cx__title { font-size: clamp(2.5rem, 12vw, 3.1rem); }

  .cx__art-move { width: min(86%, 300px); margin-inline: auto; }
  .cx__form-wrap { margin-top: 4px; }
  .cx-row { grid-template-columns: 1fr; }
  .cx-pills { gap: 10px; }
  .cx-pill__face { padding: 0 18px; }
  .cx-submit { flex-direction: column; align-items: stretch; }
  .cx-submit__btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cx__art-move, .cx-input, .cx-pill__face, .cx-pill__tick, .cx__contact-list a span { transition: none; }
  .cx__art-move { transform: none !important; }
}
