/* Contact: the details first, a real person's reply, the form in three short steps, and the quicker way to a plan.
   Tokens of system.css only. Every card that stands on a photo on the computer stays at least half on it at every width,
   clear of her face (upper left third). */

/* Every scene's place: the runtime's own rules make a scene's box relative, so its place here keeps the absolute
   position that gives it its size. */
.quick__host { position: absolute !important; inset: 0; }

/* The header: the words, the details set large across the top, then the wide framed photo */
.contact-hero { padding-block: var(--space-5) var(--section-y); }
.contact-hero__in { display: grid; gap: var(--space-4); }
.contact-hero__words { display: grid; gap: var(--space-2); max-width: 48rem; }
.contact-hero__line { margin: 0; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem); line-height: 1.5; color: var(--c-ink-soft); text-wrap: pretty; }
.contact-details { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3) var(--space-5); margin: 0; padding: var(--space-3) 0 0; border-top: 1.5px solid var(--c-line); list-style: none; }
.contact-detail { display: grid; gap: 4px; align-content: start; }
.contact-detail__label { font-size: var(--fs-small); font-weight: 800; color: var(--c-ink-soft); }
.contact-detail__value { font-family: var(--font-display); font-size: clamp(1.25rem, 1.1rem + 0.45vw, 1.5rem); font-weight: 600; line-height: 1.25; color: var(--c-brand-dark); }
.contact-detail--big .contact-detail__value { font-size: clamp(1.5rem, 1.05rem + 1.4vw, 2.25rem); }
a.contact-detail__value { text-decoration: underline; text-decoration-color: var(--c-brand); text-decoration-thickness: 2px; text-underline-offset: 0.18em; overflow-wrap: anywhere; }
a.contact-detail__value:hover { color: var(--c-brand-text); }
.contact-hero__frame { aspect-ratio: 2 / 1; }
.contact-hero__pic { position: absolute; inset: 0; overflow: hidden; }
.contact-hero__pic img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 40% 18%; }
.contact-hero__stop { top: 16px; left: 16px; }

/* Her message and a person's reply: the chat's head, its messages from the top */
.contact-chat { position: absolute; z-index: 2; right: 3%; top: 8%; display: flex; flex-direction: column; box-sizing: border-box; width: min(380px, 32%); height: 244px; overflow: hidden; background: var(--c-card); border-radius: var(--radius-m); box-shadow: var(--shadow-l); }
.ch-head { flex: none; display: flex; align-items: center; gap: 0.65rem; padding: 12px 16px; border-bottom: 1.5px solid var(--c-line); }
.ch-head__mark { flex: none; box-sizing: border-box; width: 36px; height: 36px; padding: 6px; border-radius: 50%; background: var(--c-brand-light); fill: var(--c-brand-dark); }
.ch-head__text { display: grid; line-height: 1.25; }
.ch-head__text b { font-weight: 800; color: var(--c-ink); }
.ch-head__text span { font-size: var(--fs-small); color: var(--c-ink-soft); }
.ch-list { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 14px 16px 16px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }
.ch-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: auto; }
.ch { position: relative; max-width: 86%; margin: 0; padding: 0.6rem 0.85rem; border-radius: 16px; font-size: var(--fs-small); line-height: 1.4; opacity: calc(var(--kit-in, 1) * (1 - var(--kit-out, 0))); transform: translateY(calc((1 - var(--kit-in, 1)) * 8px)); }
.ch--first { opacity: var(--kit-in, 1); }
.ch--them { align-self: flex-start; background: var(--c-paper-alt); color: var(--c-ink); border-bottom-left-radius: 6px; }
.ch--me { align-self: flex-end; background: var(--c-brand); color: var(--c-on-brand); font-weight: 800; border-bottom-right-radius: 6px; }
.ch--typing { display: flex; gap: 5px; padding-block: 0.85rem; }
.ch--typing[hidden] { display: none; }
.ch--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-ink-soft); animation: ch-dot 1s ease-in-out infinite; }
.ch--typing i:nth-child(2) { animation-delay: 0.15s; }
.ch--typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ch-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ch--typing i { animation: none; } }
/* the hum lines run out of the reply's lower corner, into the room under it */
.ch__hum { position: absolute; right: -14px; bottom: -24px; width: 30px; transform: scaleY(-1); --hum-off: calc((1 - var(--kit-in, 1)) * 100); }

/* The form: the words beside it, the kit's three steps in a card */
.contact-form__in { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: var(--space-6); align-items: start; }
.contact-form__head { position: sticky; top: 120px; margin: 0; }
.contact-form__aside { display: flex; align-items: center; gap: 0.75rem; margin: var(--space-3) 0 0; padding: var(--space-3); border-radius: var(--radius-m); background: var(--c-paper-alt); font-weight: 700; color: var(--c-ink); }
.contact-form__aside a { color: var(--c-brand-text); white-space: nowrap; }
.contact-form__mark { flex: none; box-sizing: border-box; width: 40px; height: 40px; padding: 7px; border-radius: 50%; background: var(--c-brand-light); fill: var(--c-brand-dark); }
.kform { box-sizing: border-box; min-width: 0; padding: var(--space-5); background: var(--c-card); border-radius: var(--radius-l); box-shadow: var(--shadow-m); }
.kform__marks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.kform__mark { display: grid; gap: 8px; font-size: var(--fs-small); font-weight: 800; color: var(--c-ink-soft); }
.kform__mark::before { content: ""; height: 6px; border-radius: 3px; background: var(--c-line); }
.kform__mark[aria-current="step"], .kform__mark[data-kit-past] { color: var(--c-brand-dark); }
.kform__mark[aria-current="step"]::before, .kform__mark[data-kit-past]::before { background: var(--c-brand); }
.kform__step { min-width: 0; margin: 0; padding: 0; border: 0; }
.kform__step legend { display: block; width: 100%; margin: 0 0 var(--space-3); padding: 0; font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.2; color: var(--c-brand-dark); }
.kform__cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kform__card { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; padding: 1.1rem 0.6rem 1rem; border-radius: var(--radius-m); background: var(--c-paper); box-shadow: inset 0 0 0 2px var(--c-line); text-align: center; font-weight: 800; line-height: 1.25; color: var(--c-ink); cursor: pointer; transition: background-color var(--dur-fast), box-shadow var(--dur-fast); }
.kform__card input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.kform__card:hover { background: var(--c-brand-light); }
.kform__card[data-kit-on], .kform__card:has(input:checked) { background: var(--c-brand-light); box-shadow: inset 0 0 0 3px var(--c-brand-dark); }
.kform__card:has(input:focus-visible) { outline: 3px solid var(--c-brand-text); outline-offset: 2px; }
.kform__card svg { width: 72px; height: 54px; }
.kp-card { fill: var(--c-card); stroke: var(--c-brand-dark); stroke-width: 2; }
.kp-ink { fill: var(--c-brand-dark); }
.kp-hum { fill: none; stroke: var(--c-brand); stroke-width: 4; stroke-linecap: round; }
.kp-star { fill: var(--c-accent); }
.kp-line { fill: none; stroke: var(--c-brand-dark); stroke-width: 2; }
.kp-dot, .kp-sky { fill: var(--c-brand); }
.kp-soft { fill: var(--c-line); }
.kform__counts .picker__choice span { min-height: 76px; font-family: var(--font-display); font-size: 1.625rem; font-weight: 600; }
.kform__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.kform__field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.kform__field--wide { grid-column: 1 / -1; }
.kform__field > label { font-weight: 800; color: var(--c-ink); }
.kform__field > label span { font-weight: 600; color: var(--c-ink-soft); }
.kform__field > input, .kform__field > textarea { box-sizing: border-box; width: 100%; min-height: 52px; margin: 0; padding: 0.7rem 0.95rem; border: 2px solid var(--c-line); border-radius: var(--radius-s); background: var(--c-paper); font: inherit; color: var(--c-ink); }
.kform__field > textarea { min-height: 120px; resize: vertical; }
.kform__field > input:focus-visible, .kform__field > textarea:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; border-color: var(--c-brand-dark); }
.kform [aria-invalid="true"], .kform [data-kit-invalid] > input, .kform [data-kit-invalid] > textarea { border-color: var(--c-accent-text); }
.kform__error { margin: 4px 0 0; font-size: var(--fs-small); font-weight: 700; color: var(--c-accent-text); }
.kform__nav { display: flex; justify-content: flex-end; gap: 12px; margin-top: var(--space-4); }
.kform__back { margin-right: auto; }
.kform__next { background: var(--c-brand-dark); color: var(--c-on-ink); }
.kform__next:hover { background: var(--c-ink); }
.kform[data-kit-sending] .kform__next { opacity: 0.7; }

/* The quicker way: the plan building itself on Slate */
.quick__in { display: grid; grid-template-columns: minmax(0, 1fr) 720px; align-items: center; gap: 64px; }
.quick__words { display: grid; gap: var(--space-2); }
.quick__go { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-2); }
.quick__go .promise { justify-content: flex-start; }
.quick__frame { position: relative; }
.quick__stage { position: relative; height: 560px; }
.quick__stop { top: calc(100% + 12px); right: 0; }

/* Narrower screens */
@media (max-width: 1180px) {
  .contact-form__in { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .contact-form__head { position: static; }
  .quick__in { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--space-4); }
  .quick__words { justify-self: start; }
  .quick__frame { width: min(100%, 720px); }
  .quick__stop { top: -56px; }
}
@media (max-width: 1100px) {
  .contact-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-hero__frame { aspect-ratio: 16 / 10; }
  .contact-chat { width: min(380px, 44%); }
}
@media (max-width: 760px) {
  /* the details first; the photo at a set height, the chat over its foot, below her face */
  .contact-hero__frame { --ph: 300px; --sh: 244px; aspect-ratio: auto; height: calc(var(--ph) + var(--sh) * 0.5); background: var(--c-paper-alt); }
  .contact-hero__pic { inset: 0 0 auto 0; height: var(--ph); }
  .contact-hero__pic img { object-position: 30% 20%; }
  .contact-chat { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; height: var(--sh); }
  .contact-hero__stop { top: 12px; left: 12px; }
  .kform { padding: var(--space-4) var(--space-3); border-radius: var(--radius-m); }
  .kform__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kform__fields { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 660px) {
  .quick__stage { height: 700px; }
  .quick__stop { top: 10px; right: 10px; }
}
@media (max-width: 600px) {
  .contact-details { grid-template-columns: minmax(0, 1fr); }
}
