/* Contact options for Direction A (html[data-contact]): simple (default) | email | calm.
   Each has one place to look and one primary action. contact.js rearranges the same form;
   core.js still validates and sends it. */

.ct-arrow { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease); }
.contact.ct-ready .contact__details { display: none; }
.contact.ct-ready .contact__grid { grid-template-columns: minmax(0, 1fr); max-width: calc(680px + 2 * var(--gutter)); row-gap: clamp(40px, 4.4vw, 56px); }
.contact.ct-ready .contact__side { gap: 16px; }
.contact.ct-ready .contact__sub { max-width: 40ch; text-wrap: balance; }
.contact.ct-ready .field textarea { display: block; }
/* email first: a quieter heading so the address leads */
.contact[data-ct="email"] .contact__side h2 { font-size: clamp(30px, 2.8vw, 40px); }
.contact[data-ct="simple"] .contact__side, .contact[data-ct="email"] .contact__side { justify-items: center; text-align: center; }
@keyframes ct-rise { from { opacity: 0; transform: translateY(14px); } }

/* the quiet way in */
.ct-alt { font-size: 15px; line-height: 1.5; color: var(--fg-3); text-align: center; }
.ct-alt a { color: var(--fg); font-weight: 500; border-bottom: 1px solid var(--ln-2); padding-bottom: 1px; transition: color .3s ease, border-color .3s ease; }
.ct-alt a:hover, .ct-alt a:focus-visible { color: var(--orange); border-color: var(--orange); }

/* inline errors sit just under the field, so the field keeps its size */
.ct-err {
  position: absolute; left: 0; top: 100%; padding-top: 7px; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateY(-4px);
  font: 500 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--orange);
  transition: opacity .3s ease, transform .4s var(--ease);
}
.field.is-invalid .ct-err { opacity: 1; transform: none; }

/* send another */
.ct-again {
  margin-top: 10px; height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--ln-2);
  font-size: 14px; font-weight: 500; color: var(--fg); transition: border-color .3s ease;
}
.ct-again:hover { border-color: var(--fg); }

/* =========================================================================
   SHORT FORM: simple, and email once opened
   ========================================================================= */
.contact[data-ct="simple"] .form, .contact[data-ct="email"] .form { gap: 26px; }
.contact[data-ct="simple"] .form__grid, .contact[data-ct="email"] .form__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.contact[data-ct="simple"] .field textarea, .contact[data-ct="email"] .field textarea { min-height: 120px; }
.contact.ct-ready .chips { gap: 8px; }
.contact.ct-ready .chips legend { margin-bottom: 12px; }
.contact.ct-ready .chip span { height: 38px; padding: 0 15px; font-size: 14px; }
.contact[data-ct="simple"] .form__foot, .contact[data-ct="email"] .form__foot { flex-direction: column-reverse; align-items: stretch; gap: 12px; margin-top: 4px; }
.contact[data-ct="simple"] .btn--send, .contact[data-ct="email"] .btn--send { width: 100%; height: 58px; }
.contact[data-ct="simple"] .form__status, .contact[data-ct="email"] .form__status { text-align: center; min-width: 0; }
.contact[data-ct="simple"] .form__status:empty, .contact[data-ct="email"] .form__status:empty { display: none; }

/* =========================================================================
   EMAIL FIRST: the address is the hero
   ========================================================================= */
.contact[data-ct="email"] .contact__grid { max-width: calc(980px + 2 * var(--gutter)); }
.contact[data-ct="email"] .form { width: 100%; max-width: 680px; justify-self: center; }
.contact[data-ct="email"]:not(.ct-open) .form { display: none; }
.contact[data-ct="email"].ct-open .form { animation: ct-rise .6s var(--ease) both; }
.ct-hero { display: grid; justify-items: center; gap: 18px; margin-top: clamp(26px, 3.4vw, 44px); }
.ct-hero__addr {
  margin-bottom: 10px; color: var(--fg);
  font-size: clamp(40px, 5.8vw, 84px); font-weight: 600; line-height: 1.04; letter-spacing: -.045em;
  background: linear-gradient(var(--orange), var(--orange)) no-repeat 0 100% / 0 3px; padding-bottom: .06em;
  transition: background-size .6s var(--ease);
}
.ct-hero__addr:hover, .ct-hero__addr:focus-visible { background-size: 100% 3px; }
.ct-hero .ct-copy {
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 30px; border-radius: 999px;
  background: var(--fg); color: var(--page); font-size: 15.5px; font-weight: 500;
  transition: background-color .3s ease, color .3s ease, box-shadow .4s var(--ease), transform .4s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ct-hero .ct-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ct-hero .ct-copy:hover { background: var(--orange); color: #fff; box-shadow: 0 16px 40px -10px rgba(239, 67, 35, .45); }
.ct-hero .ct-copy.is-done { background: var(--orange); color: #fff; }
.ct-hero .ct-copy:active { transform: scale(.96); }
.ct-formlink { padding: 8px 4px; font-size: 15px; color: var(--fg-3); text-decoration: underline; text-decoration-color: var(--ln-2); text-underline-offset: 4px; transition: color .3s ease; }
.ct-formlink:hover { color: var(--fg); }

/* =========================================================================
   CALM STEPS: one question at a time
   ========================================================================= */
.contact[data-ct="calm"] .contact__grid { max-width: calc(760px + 2 * var(--gutter)); }
.contact[data-ct="calm"] .form__grid { display: none; }
.contact[data-ct="calm"] .ct-alt { text-align: left; }
.ct-calm__top { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(26px, 3vw, 38px); }
.ct-calm__n { font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.ct-calm__top i { position: relative; flex: 1; height: 2px; border-radius: 2px; background: var(--ln); overflow: hidden; }
.ct-calm__top b { position: absolute; inset: 0; background: var(--orange); transform-origin: 0 50%; transform: scaleX(.33); transition: transform .8s var(--ease); }
.ct-stage { position: relative; overflow: clip; overflow-clip-margin: 8px; transition: height .6s var(--ease); }
.ct-step { position: absolute; left: 0; right: 0; top: 0; opacity: 0; transform: translateX(36px); pointer-events: none; transition: opacity .45s var(--ease), transform .7s var(--ease); }
.ct-step.is-past { transform: translateX(-36px); }
.ct-step.is-on { opacity: 1; transform: none; pointer-events: auto; transition-delay: .06s; }
.ct-step__q { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.04; letter-spacing: -.04em; font-weight: 600; color: var(--fg); }
.ct-step__hint { margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--fg-2); }
.ct-step__body { display: grid; gap: 24px; margin-top: clamp(22px, 2.6vw, 32px); padding-bottom: 26px; }
.ct-calm .field input, .ct-calm .field textarea { font-size: clamp(19px, 1.6vw, 21px); }
.ct-calm .field textarea { min-height: 120px; }
.ct-calm__nav { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "go back status"; align-items: center; gap: 12px 22px; margin-top: 10px; }
.ct-calm__nav .form__foot { display: contents; }
.ct-next, .ct-calm__nav .btn--send { grid-area: go; }
.ct-calm__nav .form__status { grid-area: status; min-width: 0; font-size: 14px; }
.ct-next {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 56px; padding: 0 26px 0 30px; border-radius: 999px;
  background: var(--fg); color: var(--page); font-size: 15.5px; font-weight: 500;
  transition: background-color .3s ease, color .3s ease, box-shadow .4s var(--ease), opacity .3s ease, visibility 0s, transform .4s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ct-next:hover { background: var(--orange); color: #fff; box-shadow: 0 16px 40px -10px rgba(239, 67, 35, .45); }
.ct-next:hover .ct-arrow { transform: translateX(3px); }
.ct-next:active { transform: scale(.96); }
.ct-back { grid-area: back; padding: 10px 4px; font-size: 15px; color: var(--fg-3); transition: color .3s ease; }
.ct-back:hover { color: var(--fg); }
.ct-back[hidden] { display: none; }
.ct-calm__nav .btn--send { height: 56px; transition: color .4s var(--ease), background-color .5s var(--ease), box-shadow .5s var(--ease), transform .5s var(--ease), opacity .3s ease, visibility 0s; }
/* Send and Next share one spot: Next until the last question, then Send */
.ct-calm:not(.is-last) .ct-calm__nav .btn--send, .ct-calm:not(.is-last) .ct-calm__nav .form__status, .ct-calm.is-last .ct-next { opacity: 0; visibility: hidden; pointer-events: none; }
/* A5: the journey pours into Send; before the last question that spot belongs to Next */
.ct-calm__nav:has(.btn--send.is-poured) .ct-next { background: var(--orange); color: #fff; }
[data-variant="a2k"] .ct-next, [data-variant="a2k"] .ct-hero .ct-copy { color: var(--ink); }
[data-variant="a2k"] .ct-next:hover, [data-variant="a2k"] .ct-hero .ct-copy:hover { color: #fff; }

/* =========================================================================
   PHONES
   ========================================================================= */
@media (max-width: 640px) {
  .contact[data-ct="simple"] .form__grid, .contact[data-ct="email"] .form__grid { grid-template-columns: minmax(0, 1fr); }
  .contact.ct-ready .chip span { height: 40px; }
  .ct-alt { font-size: 15px; }
  .ct-hero__addr { font-size: min(11vw, 52px); }
  .ct-hero__addr span { display: block; }
  .ct-hero .ct-copy { width: 100%; justify-content: center; }
  .ct-step__q { font-size: 32px; line-height: 1.06; }
  .ct-step__hint { font-size: 15.5px; }
  .ct-step__body { gap: 20px; }
  .ct-calm__nav { grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "go" "back"; justify-items: center; gap: 6px; }
  .ct-next, .ct-calm__nav .btn--send { width: 100%; }
  .ct-calm__nav .form__status:empty { display: none; }
}

/* =========================================================================
   POPUP: a call-to-action band, and the form in a modal
   ========================================================================= */
.contact[data-ct="popup"] { padding-block: clamp(96px, 11vw, 160px); }
.contact[data-ct="popup"] .contact__grid { max-width: var(--max); grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 56px; }
.ct-band { display: grid; justify-items: start; gap: 16px; padding-bottom: 6px; }
.ct-band .ct-alt { text-align: left; }
.ct-band__btn { height: 62px; padding: 0 34px; font-size: 16px; }
html.ct-locked { overflow: hidden; }

.ct-modal {
  --fg: #0d0d0d; --fg-2: rgba(13, 13, 13, .72); --fg-3: rgba(13, 13, 13, .5); --ln: rgba(13, 13, 13, .1); --ln-2: rgba(13, 13, 13, .24); --page: #fff;
  --ct-field: #f4f3ef;
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 24px;
  border: 0; background: transparent; color: var(--fg); overflow: hidden; display: none; place-items: center;
}
.ct-modal[open] { display: grid; }
.ct-modal::backdrop { background: transparent; }
.ct-modal__scrim { position: absolute; inset: 0; background: rgba(10, 10, 10, .4); -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1); }
.ct-modal__card {
  position: relative; z-index: 1; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  width: min(860px, 100%); max-height: calc(100dvh - 48px); border-radius: 32px; background: #fff;
  box-shadow: 0 0 0 1px rgba(13, 13, 13, .04), 0 50px 120px -40px rgba(0, 0, 0, .55);
}
.ct-modal__scroll { position: relative; z-index: 1; overflow-y: auto; overscroll-behavior: contain; padding: 52px 56px 46px; }

/* the live blob in the corner: the site's goo recipe */
.ct-modal__goo { position: absolute; z-index: 0; right: -90px; top: -110px; width: 360px; height: 360px; filter: url('#goo') blur(.5px); pointer-events: none; transform: translateZ(0); transform-origin: 75% 30%; transition: transform 1s var(--ease); }
.ct-modal__goo i { position: absolute; border-radius: 50%; filter: blur(8px); transition: scale 1s var(--ease); }
.ct-modal__goo i:nth-child(1) { width: 220px; height: 220px; right: 70px; top: 70px; background: var(--g1); scale: calc(1 + var(--ct-fill, 0) * .22); }
.ct-modal__goo i:nth-child(2) { width: 96px; height: 96px; right: 250px; top: 196px; background: var(--g2); animation: ct-m-a 9s ease-in-out infinite alternate; }
.ct-modal__goo i:nth-child(3) { width: 54px; height: 54px; right: 74px; top: 296px; background: var(--g3); animation: ct-m-b 7s ease-in-out infinite alternate; }
.ct-modal__card.is-typing .ct-modal__goo i:nth-child(2) { scale: 1.18; }
.ct-modal__card.is-typing .ct-modal__goo i:nth-child(3) { scale: 1.25; }
@keyframes ct-m-a { 50% { translate: 44px -40px; } 100% { translate: -12px 14px; } }
@keyframes ct-m-b { 50% { translate: -40px -52px; } 100% { translate: 12px 8px; } }

.ct-modal__x {
  position: absolute; z-index: 4; top: 22px; right: 22px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--fg); box-shadow: 0 6px 20px -8px rgba(13, 13, 13, .35);
  transition: transform .5s var(--ease), background-color .3s ease;
}
.ct-modal__x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ct-modal__x:hover { transform: rotate(90deg); background: #fff; }
.ct-modal__x:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.ct-modal__k { font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.ct-modal__h { margin-top: 18px; font-size: clamp(38px, 4.2vw, 58px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; }
.ct-modal__p { margin-top: 16px; font-size: 16.5px; line-height: 1.55; color: var(--fg-2); max-width: 44ch; }

/* soft filled fields */
.ct-modal .form { margin-top: 34px; gap: 12px; }
.ct-modal .form__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ct-modal .chips { display: none; }
.ct-modal .field { border-radius: 16px; background: var(--ct-field); transition: background-color .3s ease, box-shadow .3s ease; }
.ct-modal .field::after { display: none; }
.ct-modal .field:hover { background: #efeee9; }
.ct-modal .field:focus-within { background: #fff; box-shadow: 0 0 0 1.5px var(--fg), 0 14px 30px -18px rgba(13, 13, 13, .35); }
.ct-modal .field.is-invalid { box-shadow: 0 0 0 1.5px var(--orange); }
.ct-modal .field input, .ct-modal .field select, .ct-modal .field textarea {
  display: block; width: 100%; height: 62px; padding: 26px 18px 8px; border: 0; border-radius: 16px; background: transparent;
  font: inherit; font-size: 16.5px; line-height: 1.4; color: var(--fg); outline: none;
}
.ct-modal .field textarea { height: auto; min-height: 128px; padding-top: 32px; resize: none; line-height: 1.5; }
.ct-modal .field label { left: 18px; top: 21px; font-size: 16px; color: var(--fg-3); }
.ct-modal .field input:focus + label, .ct-modal .field input:not(:placeholder-shown) + label,
.ct-modal .field textarea:focus + label, .ct-modal .field textarea:not(:placeholder-shown) + label, .ct-modal .field--select label {
  transform: translateY(-10px); font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3);
}
.ct-modal .field.is-invalid label { color: var(--orange); }
.ct-modal .field--select select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer; }
.ct-chev { position: absolute; right: 20px; top: 50%; width: 14px; height: 14px; margin-top: -7px; fill: none; stroke: var(--fg-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* an error takes the label's place, in orange, until the field is fixed */
.ct-modal .ct-err { top: 11px; left: 18px; right: 18px; padding: 0; font-size: 10px; letter-spacing: .14em; overflow: hidden; text-overflow: ellipsis; }
.ct-modal .field.is-invalid label { opacity: 0; }
.ct-modal .form__foot { display: flex; flex-flow: row wrap; align-items: center; justify-content: flex-start; gap: 14px 26px; margin-top: 14px; }
.ct-modal .btn--send { order: 1; height: 58px; padding: 0 30px; }
.ct-modal .ct-alt { order: 2; text-align: left; }
.ct-modal .form__status { order: 3; flex: 0 0 100%; min-width: 0; font-size: 14px; }
.ct-modal .form__status:empty { display: none; }
.ct-modal .form.is-sent .form__status { position: absolute; }
.ct-modal .form__done { display: none; }
.ct-modal .ct-alt a { color: var(--fg); }

/* sent: the blob swells and the card floods orange from its corner */
.ct-modal__ok {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 48px; text-align: center;
  color: #fff; background: linear-gradient(155deg, #f4572f, #ef4323 52%, #e3391a);
  clip-path: circle(0 at 88% 8%); visibility: hidden; transition: clip-path .5s var(--ease), visibility 0s linear .5s;
}
.ct-modal__card.is-sent .ct-modal__ok { clip-path: circle(150% at 88% 8%); visibility: visible; transition: clip-path 1.1s var(--ease) .3s, visibility 0s; }
.ct-modal__card.is-sent .ct-modal__goo { transform: scale(1.5); }
.ct-modal__card.is-sent .ct-modal__scroll { opacity: 0; transition: opacity .4s ease .3s; }
.ct-modal__tick { width: 84px; height: 84px; margin-bottom: 8px; fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; }
.ct-modal__tick circle { stroke-width: 2.5; opacity: .45; stroke-dasharray: 214; stroke-dashoffset: 214; }
.ct-modal__tick path { stroke-width: 3.6; stroke-dasharray: 44; stroke-dashoffset: 44; }
.ct-modal__card.is-sent .ct-modal__tick circle { stroke-dashoffset: 0; transition: stroke-dashoffset .9s var(--ease) .8s; }
.ct-modal__card.is-sent .ct-modal__tick path { stroke-dashoffset: 0; transition: stroke-dashoffset .5s var(--ease) 1.35s; }
.ct-modal__ok-h { font-size: clamp(40px, 4.6vw, 64px); font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.ct-modal__ok-p { max-width: 36ch; font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.ct-modal__ok-acts { display: flex; align-items: center; gap: 22px; margin-top: 14px; }
.ct-modal__done { height: 54px; padding: 0 30px; border-radius: 999px; background: #fff; color: var(--fg); font-size: 15.5px; font-weight: 500; transition: transform .4s var(--ease); }
.ct-modal__done:hover { transform: scale(1.04); }
.ct-modal__again { padding: 8px 2px; font-size: 15px; color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .5); text-underline-offset: 4px; }
.ct-modal__ok :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ct-modal__card.is-sent .ct-modal__x { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }

@media (max-width: 880px) {
  .contact[data-ct="popup"] .contact__grid { grid-template-columns: minmax(0, 1fr); row-gap: 30px; }
}
@media (max-width: 640px) {
  .ct-band { justify-items: stretch; }
  .ct-band__btn { width: 100%; }
  .ct-band .ct-alt { text-align: center; }
  .ct-modal { padding: 0; place-items: end stretch; }
  .ct-modal__card { width: 100%; height: calc(100dvh - 10px); max-height: none; border-radius: 26px 26px 0 0; }
  .ct-modal__card::before { content: ''; position: absolute; z-index: 5; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(13, 13, 13, .16); }
  .ct-modal__scroll { flex: 1; padding: 34px 20px calc(28px + env(safe-area-inset-bottom)); }
  .ct-modal__goo { scale: .62; transform-origin: 100% 0; }
  .ct-modal__x { top: 18px; right: 16px; }
  .ct-modal__h { font-size: 38px; }
  .ct-modal__p { font-size: 16px; }
  .ct-modal .form { margin-top: 28px; }
  .ct-modal .form__grid { grid-template-columns: minmax(0, 1fr); }
  .ct-modal .field input, .ct-modal .field select, .ct-modal .field textarea { font-size: 17px; }
  .ct-modal .form__foot { flex-flow: column nowrap; align-items: stretch; gap: 16px; }
  .ct-modal .form__status { flex: none; }
  .ct-modal .btn--send { width: 100%; }
  .ct-modal .ct-alt { text-align: center; }
  .ct-modal__ok { padding: 32px 24px; }
  .ct-modal__ok-acts { flex-direction: column; gap: 10px; }
}

/* pop-up mode: the footer straight below already says Start a project and opens the form, so the band would repeat it */
html[data-contact="popup"] section#contact { display: none; }
