/* BRAINDANCE · Contact (Kontakt)
   The last stop of the lime thread: it lands on the form, the form fills a progress line, a real submission draws the check.
   Desktop: 5 + 7 split, left column sticky. Mobile: stacked, full-width CTA. No card around the form. */

.contact { position: relative; z-index: 2; background: var(--obsidian); padding-bottom: clamp(140px, 16vw, 240px); }

/* entry thread with a head pointing down onto the form */
.ct-entry { position: relative; height: clamp(72px, 10vh, 120px); }
.ct-entry-line { position: absolute; left: var(--tx, 50%); top: 0; bottom: 6px; width: 2px; margin-left: -1px; }
.ct-entry-line i { position: absolute; inset: 0; background: var(--lime); clip-path: inset(0 0 calc((1 - var(--t, 0)) * 100%) 0); }
.ct-entry-head { position: absolute; left: 50%; bottom: -6px; width: 16px; height: 10px; margin-left: -8px; opacity: var(--t-end, 0); transform: translateY(calc((1 - var(--t-end, 0)) * -8px)); transition: opacity 300ms var(--ease-out), transform 400ms var(--ease-out); }
.ct-entry-head svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--lime); stroke-width: 3; stroke-linecap: square; }

/* layout */
.ct-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.ct-left { grid-column: 1 / span 5; position: relative; align-self: stretch; }
.ct-left::before { content: ""; position: absolute; inset: -40px 0 -40px calc(-1 * var(--gutter)); z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(245, 245, 242, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(245, 245, 242, .035) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent); mask-image: radial-gradient(70% 60% at 30% 40%, #000, transparent); }
.ct-sticky { position: sticky; top: calc(var(--header-h) + 32px); display: grid; gap: 24px; }
.ct-right { grid-column: 7 / -1; }

.ct-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); display: flex; gap: 12px; }
.ct-eyebrow span { color: var(--lime); }
.ct-h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 104%; font-size: clamp(48px, 6vw, 100px); line-height: .92; letter-spacing: -.045em; }
.ct-h2 .row { display: block; overflow: hidden; padding-bottom: .08em; }
.ct-h2 .row > span { display: inline-block; transition: transform 900ms var(--ease-out); }
.ct-h2 .row:nth-child(2) > span { transition-delay: 100ms; }
.ct-h2 .row:nth-child(3) > span { transition-delay: 200ms; }
.ct-h2 em { font-style: normal; color: var(--lime); }
.ct-lead { margin: 0; max-width: 40ch; font-size: 17px; line-height: 1.6; font-weight: 500; color: var(--text-2); }

/* arrow pointing to the form */
.ct-pointer { position: relative; height: 16px; margin-top: 12px; display: flex; align-items: center; }
.ct-pointer-line { flex: 1; height: 2px; background: var(--lime); transform-origin: left; transform: scaleX(0); transition: transform 1100ms var(--ease-out) 300ms; }
.ct-pointer-head { width: 12px; height: 16px; flex-shrink: 0; margin-left: -9px; fill: none; stroke: var(--lime); stroke-width: 3; stroke-linecap: square; opacity: 0; transition: opacity 300ms var(--ease-out) 1200ms; }
.ct-pointer.is-in .ct-pointer-line { transform: scaleX(1); }
.ct-pointer.is-in .ct-pointer-head { opacity: 1; animation: ct-nudge 2.6s var(--ease-in-out) 1.8s infinite; }
@keyframes ct-nudge { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(6px); } }

/* reveals */
.ct-eyebrow, .ct-lead { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .ct-h2:not(.is-in) .row > span { transform: translateY(108%); }
.js .ct-eyebrow:not(.is-in), .js .ct-lead:not(.is-in) { opacity: 0; transform: translateY(24px); }
.ct-form { transition: opacity 700ms var(--ease-out) 150ms, transform 700ms var(--ease-out) 150ms; }
.js .ct-form:not(.is-in) { opacity: 0; transform: translateY(32px); }

/* form */
.ct-form { display: grid; gap: 36px; }
.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 24px; }
.ct-field { position: relative; display: grid; gap: 10px; }
.ct-field label, .ct-choice legend { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); transition: color var(--dur-ui) var(--ease-out); }
.ct-field:focus-within label, .ct-field.is-filled label { color: var(--text); }
.req { color: var(--lime); }
.opt { color: var(--text-2); text-transform: none; letter-spacing: .02em; margin-left: 6px; }
.ct-field input, .ct-field textarea {
  width: 100%; min-height: 48px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; background: transparent;
  color: var(--text); font: 500 18px/1.5 var(--font-body); outline: none; transition: border-color var(--dur-ui) var(--ease-out);
}
.ct-field textarea { resize: none; min-height: 96px; overflow: hidden; }
.ct-field input::placeholder, .ct-field textarea::placeholder { color: #858581; }
.ct-field input:hover, .ct-field textarea:hover { border-bottom-color: var(--muted); }
/* focus: a lime underline draws left to right */
.ct-field input, .ct-field textarea { background-image: linear-gradient(var(--lime), var(--lime)); background-repeat: no-repeat; background-position: left bottom; background-size: 0% 2px; transition: border-color var(--dur-ui) var(--ease-out), background-size 500ms var(--ease-out); }
.ct-field input:focus, .ct-field textarea:focus { background-size: 100% 2px; }
.ct-field input:focus-visible, .ct-field textarea:focus-visible { outline: none; }

.ct-err { margin: 0; min-height: 0; font-size: 14px; line-height: 1.4; color: #ff8a7a; }
.ct-err:empty { display: none; }
.ct-hint { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--text-2); }
.is-invalid input, .is-invalid textarea { border-bottom-color: #ff8a7a; }
.is-invalid input, .is-invalid textarea { background-image: linear-gradient(#ff8a7a, #ff8a7a); }

/* chips (radio groups) */
.ct-choice { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 14px; }
.ct-choice legend { padding: 0; margin-bottom: 14px; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chips label { position: relative; cursor: pointer; }
.ct-chips input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ct-chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--text-2); transition: background-color var(--dur-ui) var(--ease-out), border-color var(--dur-ui) var(--ease-out), color var(--dur-ui) var(--ease-out), transform 200ms var(--ease-out); }
.ct-chips label:hover span { border-color: var(--text-2); color: var(--text); }
.ct-chips input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--obsidian); }
.ct-chips input:active + span { transform: scale(.97); }
.ct-chips input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 3px; }
.ct-choice.is-invalid .ct-chips span { border-color: rgba(255, 138, 122, .6); }

/* honeypot */
.ct-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* progress, submit, status */
.ct-progress { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.ct-progress::before { content: ""; flex: 1; height: 2px; background: var(--border); }
.ct-progress i { position: absolute; }
.ct-progress { position: relative; }
.ct-progress i { left: 0; top: 50%; height: 2px; margin-top: -1px; width: calc((100% - 52px) * var(--p, 0)); background: var(--lime); transition: width 600ms var(--ease-out); }
.ct-progress span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); min-width: 38px; text-align: right; }
.ct-progress.is-done span { color: var(--lime); }

.ct-submit { width: 100%; justify-content: space-between; height: 64px; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; }
.ct-submit .btn-icon { width: 44px; height: 44px; }
/* larger icon: park the incoming arrow fully outside the circle */
.ct-submit .btn-icon svg + svg { transform: translateX(-34px); }
.ct-submit:hover .btn-icon svg:first-child { transform: translateX(34px); }
.ct-submit:hover .btn-icon svg + svg { transform: translateX(0); }
.ct-spin { position: absolute; inset: 11px; border-radius: 50%; border: 2px solid rgba(197, 255, 56, .25); border-top-color: var(--lime); opacity: 0; animation: ct-spin 800ms linear infinite; }
.ct-submit[aria-busy="true"] { cursor: progress; }
.ct-submit[aria-busy="true"] .btn-icon svg { opacity: 0; }
.ct-submit[aria-busy="true"] .ct-spin { opacity: 1; }
@keyframes ct-spin { to { transform: rotate(360deg); } }
.ct-privacy { margin: -18px 0 0; font-size: 13.5px; color: var(--text-2); }
.ct-status { margin: 0; font-size: 15px; line-height: 1.5; }
.ct-status:empty { display: none; }
.ct-status.is-error { color: #ff8a7a; padding-left: 14px; border-left: 2px solid #ff8a7a; }

/* success */
.ct-success { display: grid; gap: 16px; padding-block: 24px; outline: none; }
.ct-success[hidden] { display: none; }
.ct-check { width: 72px; height: 72px; fill: none; stroke: var(--lime); stroke-width: 4; stroke-linecap: square; }
.ct-check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: ct-draw 900ms var(--ease-out) 150ms forwards; }
@keyframes ct-draw { to { stroke-dashoffset: 0; } }
.ct-success-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 104%; font-size: clamp(32px, 3.4vw, 52px); letter-spacing: -.035em; line-height: 1; }
.ct-success-text { margin: 0; color: var(--text-2); font-size: 17px; max-width: 44ch; }
.ct-form.is-leaving { opacity: 0; transform: translateY(-16px); transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); }

/* exit thread into the footer */
.ct-thread { position: absolute; z-index: 1; left: var(--tx, 75%); top: var(--ty, 0px); height: var(--th, 0px); width: 2px; margin-left: -1px; pointer-events: none; }
.ct-thread i { position: absolute; inset: 0 0 10px; background: var(--lime); clip-path: inset(0 0 calc((1 - var(--t, 0)) * 100%) 0); }
.ct-thread b { position: absolute; left: 50%; bottom: 0; width: 10px; height: 10px; margin-left: -5px; background: var(--lime); transform: scale(var(--t-end, 0)); transition: transform 400ms var(--ease-out); }

/* tablet */
@media (max-width: 1023px) {
  .ct-left, .ct-right { grid-column: 1 / -1; }
  .ct-left::before { display: none; }
  .ct-sticky { position: static; }
  .ct-right { margin-top: 56px; }
  .ct-pointer { display: none; }
}
/* mobile */
@media (max-width: 639px) {
  .ct-h2 { font-size: clamp(42px, 12.5vw, 60px); }
  .ct-row { grid-template-columns: 1fr; }
  .ct-form { gap: 32px; }
  .ct-field input, .ct-field textarea { font-size: 16px; }
  .ct-chips span { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .ct-h2:not(.is-in) .row > span { transform: none; }
  .js .ct-eyebrow:not(.is-in), .js .ct-lead:not(.is-in), .js .ct-form:not(.is-in) { opacity: 1; transform: none; }
  .ct-pointer-line { transform: none; transition: none; }
  .ct-pointer-head { opacity: 1; animation: none !important; transition: none; }
  .ct-entry-line i, .ct-thread i { clip-path: none; }
  .ct-check path { animation: none; stroke-dashoffset: 0; }
  .ct-spin { animation-duration: 2s; }
}
