/* "Let's talk design" contact section: floating shapes, quick-contact buttons, city pins, a form card with
   animated fields and service chips, and sending / sent / error states on the button. Builds on site.css. */

.contact { position: relative; overflow: hidden; isolation: isolate; }

/* ----- Floating background shapes (move a little with the pointer) ----- */
.ct-decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ct-decor > * { position: absolute; display: block; transform: translate(calc(var(--mx, 0) * var(--k, 10px)), calc(var(--my, 0) * var(--k, 10px))); transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.ct-blob { --k: 26px; width: clamp(180px, 22vw, 320px); aspect-ratio: 1; left: -6%; bottom: -18%; }
.ct-blob::before { content: ""; position: absolute; inset: 0; background: var(--pink); border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%; opacity: .55; animation: ct-morph 12s ease-in-out infinite alternate; }
.ct-ring { --k: -18px; width: clamp(110px, 12vw, 170px); aspect-ratio: 1; right: 4%; top: -40px; }
.ct-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 18px solid var(--blue); opacity: .7; animation: ct-float 7s ease-in-out infinite; }
.ct-dots { --k: 14px; width: 120px; height: 80px; left: 40%; top: 12%; background-image: radial-gradient(rgba(43, 34, 32, .22) 2px, transparent 2.5px); background-size: 16px 16px; }
.ct-star { --k: -30px; width: 46px; height: 46px; left: 44%; bottom: 10%; fill: var(--orange); }
.ct-star path { transform-box: fill-box; transform-origin: center; animation: ct-twinkle 4s ease-in-out infinite; }
@keyframes ct-morph { 0% { border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%; transform: rotate(0); } 100% { border-radius: 58% 42% 38% 62% / 55% 60% 40% 45%; transform: rotate(40deg) scale(1.08); } }
@keyframes ct-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(18px); } }
@keyframes ct-twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(90deg) scale(.7); } }

/* ----- Heading squiggle draws itself and wiggles ----- */
.contact h2 .ct-squig path { stroke-dasharray: 40; stroke-dashoffset: 0; }
.ct-ready.ct-in h2 .ct-squig path { animation: ct-draw .9s .5s cubic-bezier(.6, 0, .2, 1) both; }
.ct-ready.ct-in h2 .ct-squig { animation: ct-wiggle 3.5s 1.6s ease-in-out infinite; transform-origin: 0 100%; }
@keyframes ct-draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@keyframes ct-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }

/* ----- Quick contact buttons ----- */
.ct-quick { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.ct-q { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1rem; border-radius: 999px; border: 1.5px solid var(--fixed-ink); color: var(--fixed-ink); font-weight: 600; font-size: .88rem; text-decoration: none; background: transparent; transition: background .3s ease, color .3s ease, transform .35s cubic-bezier(.2, .9, .3, 1.4), box-shadow .3s ease; }
.ct-q svg { width: 18px; height: 18px; flex: none; }
.ct-q:hover, .ct-q:focus-visible { background: var(--fixed-ink); color: var(--yellow); transform: translateY(-3px); box-shadow: 0 10px 20px -10px rgba(43, 34, 32, .6); }
.ct-q.ct-wa:hover, .ct-q.ct-wa:focus-visible { background: #25D366; border-color: #25D366; color: #fff; }
.ct-q:hover svg { animation: ct-ring .5s ease; }
@keyframes ct-ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* ----- City pins ----- */
.ct-cities { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; padding: 0; list-style: none; }
.ct-cities li { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem .35rem .55rem; border-radius: 999px; background: rgba(255, 248, 238, .75); font-size: .85rem; font-weight: 600; }
.ct-cities svg { width: 16px; height: 16px; fill: var(--orange); }
.ct-cities svg circle { fill: #FFF8EE; }
.ct-ready.ct-in .ct-cities svg { animation: ct-drop .7s calc(.9s + var(--i, 0) * .15s) cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ct-drop { 0% { transform: translateY(-14px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ----- Form card ----- */
.contact-grid > form.ct-card { position: relative; border-left: 0; padding: clamp(1.4rem, 3.5vw, 2.4rem); background: #FFF8EE; border-radius: 24px; box-shadow: 0 30px 60px -30px rgba(43, 34, 32, .45), 0 0 0 1.5px rgba(43, 34, 32, .08); }
.ct-hello { position: absolute; top: -14px; right: 22px; padding: .35rem .85rem; border-radius: 8px; background: var(--pink); color: var(--fixed-ink); font-weight: 700; font-size: .85rem; transform: rotate(4deg); box-shadow: 0 6px 14px -8px rgba(43, 34, 32, .5); animation: ct-bob 4s ease-in-out infinite; }
@keyframes ct-bob { 0%, 100% { transform: rotate(4deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-4px); } }

.ct-card .field { position: relative; }
.ct-card .field label { transition: color .25s ease, transform .25s ease; transform-origin: 0 50%; }
.ct-card .field:focus-within label { color: var(--orange); transform: translateX(2px); }
.ct-card .field input, .ct-card .field select, .ct-card .field textarea { border-bottom-width: 1.5px; transition: border-color .25s ease; }
.ct-card .field input:focus, .ct-card .field select:focus, .ct-card .field textarea:focus { border-bottom-width: 1.5px; border-bottom-color: transparent; }
.fl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; border-radius: 2px; background: linear-gradient(90deg, var(--orange), var(--pink)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s cubic-bezier(.2, .8, .2, 1); pointer-events: none; }
.ct-card .field:focus-within .fl-bar { transform: scaleX(1); }
.ct-card .field.ct-err input { border-bottom-color: #D93A1B; }
.ct-card .field.ct-err label { color: #C2341A; }
.ct-card textarea { min-height: 4.5rem; }

/* Service chips (shown instead of the dropdown when JavaScript runs) */
.chips-on .f2:has(#fs) { grid-template-columns: 1fr; }
.chips-on .field:has(#fs) { display: none; }
.ct-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.ct-chips::before { content: "What do you need?"; flex-basis: 100%; font-size: .8rem; font-weight: 500; margin-bottom: .1rem; }
.ct-chip { font: 600 .84rem var(--body); color: var(--fixed-ink); background: transparent; border: 1.5px solid rgba(43, 34, 32, .35); border-radius: 999px; padding: .45rem .9rem; cursor: pointer; transition: background .25s ease, border-color .25s ease, transform .35s cubic-bezier(.2, .9, .3, 1.4), box-shadow .25s ease; }
.ct-chip:hover { border-color: var(--fixed-ink); transform: translateY(-2px); }
.ct-chip:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.ct-chip[aria-pressed="true"] { background: var(--fixed-ink); border-color: var(--fixed-ink); color: #FFF8EE; box-shadow: 0 8px 16px -10px rgba(43, 34, 32, .7); }
.ct-chip[aria-pressed="true"]::before { content: "✓ "; }
.ct-chip.pop { animation: ct-pop .4s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes ct-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ----- Submit button states ----- */
.ct-submit { position: relative; }
.ct-card .btn { position: relative; min-height: 3.1rem; border-radius: 12px; overflow: hidden; }
.ct-card .btn .btn-label { display: inline-block; transition: transform .35s ease, opacity .25s ease; }
.ct-card .btn:hover .btn-label { transform: translateX(4px); }
.btn-spin, .btn-check { position: absolute; left: 50%; top: 50%; opacity: 0; pointer-events: none; }
.btn-spin { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; }
.btn-check { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.btn-check path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.ct-card.sending .btn-label, .ct-card.sent .btn-label { opacity: 0; transform: translateY(-120%); }
.ct-card.sending .btn-spin { opacity: 1; animation: ct-spin .8s linear infinite; }
.ct-card.sent .btn { background: #1E9E5A; }
.ct-card.sent .btn-check { opacity: 1; }
.ct-card.sent .btn-check path { animation: ct-draw-check .5s .1s ease forwards; }
.ct-card.failed .ct-submit, .ct-card.failed .ct-err { animation: ct-shake .45s ease; }
@keyframes ct-spin { to { transform: rotate(360deg); } }
@keyframes ct-draw-check { to { stroke-dashoffset: 0; } }
@keyframes ct-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.fnote { transition: color .3s ease; }
.ct-card.sent .fnote { color: #17713F; font-weight: 600; }
.ct-card.failed .fnote { color: #C2341A; font-weight: 600; }

/* Confetti burst on success */
.ct-confetti { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; background: var(--cc); animation: ct-burst 1.1s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes ct-burst { 0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; } }

/* ----- Entrance (only when JavaScript marked the section ready) ----- */
.ct-ready .ct-intro > *, .ct-ready .ct-card, .ct-ready .ct-card > [style*="--d"], .ct-ready .ct-card .f2 > .field { transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.ct-ready:not(.ct-in) .ct-intro > * { opacity: 0; transform: translateY(26px); }
.ct-ready:not(.ct-in) .ct-card { opacity: 0; transform: perspective(1000px) translateY(50px) rotateX(10deg) rotate(2deg); }
.ct-ready:not(.ct-in) .ct-card > [style*="--d"], .ct-ready:not(.ct-in) .ct-card .f2 > .field { opacity: 0; transform: translateY(16px); }
.ct-ready.ct-in .ct-intro > :nth-child(2) { transition-delay: .1s; }
.ct-ready.ct-in .ct-intro > :nth-child(3) { transition-delay: .2s; }
.ct-ready.ct-in .ct-intro > :nth-child(4) { transition-delay: .3s; }
.ct-ready.ct-in .ct-card { transition-delay: .15s; }
.ct-ready.ct-in .ct-card > [style*="--d"], .ct-ready.ct-in .ct-card .f2 > .field { transition-delay: calc(.35s + var(--d, 0) * .07s); }
.ct-ready.ct-in .ct-chip { animation: ct-pop .45s calc(.8s + var(--i, 0) * .05s) both; }

@media (max-width: 820px) {
  .contact-grid > form.ct-card { padding: 1.4rem 1.2rem; }
  .ct-dots, .ct-star { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-decor *, .ct-decor *::before, .ct-hello, .ct-squig, .ct-squig path, .ct-cities svg, .ct-chip, .ct-q svg { animation: none !important; }
  .ct-decor > * { transform: none; transition: none; }
}
