/* Contact · ATHAR — page layout. Logical properties only.
   One screen, one conversation (Oct 2026 polish): the invitation and our one line (WhatsApp) on one
   side; on the other, the form written as a chat under a dune arch. What you type appears as your
   message bubble, exactly as it will arrive in WhatsApp. Then the way in for companies and one next step. */

.contact-hero { padding-block-end: clamp(3rem, 6vw, 5rem); }
.contact-hero .dateline { margin-block-end: clamp(1rem, 1.6vw, 1.5rem); }
.contact-hero .display { max-width: 12ch; }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  grid-template-areas: "intro talk" "aside talk";
  grid-template-rows: auto 1fr;
  column-gap: var(--hero-gap); row-gap: clamp(1.75rem, 3vw, 2.5rem);
}
.contact-intro { grid-area: intro; padding-block-start: clamp(1rem, 3vw, 3rem); }
.contact-intro .label { margin-block-end: 1.1rem; }
.contact-intro .lead { max-width: 30ch; text-wrap: pretty; }
html[lang="ar"] .contact-intro .lead { max-width: 34ch; }

/* ---------- our one line: WhatsApp ---------- */
.wa-line {
  display: flex; align-items: center; gap: 1.1rem; max-width: 33rem;
  margin-block-start: clamp(1.75rem, 3.2vw, 2.75rem); padding-block: 1.15rem;
  border-block: 1px solid var(--line); text-decoration: none; color: inherit;
}
.wa-disc { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--athar-green); color: var(--athar-cream); }
.wa-disc .ms { font-size: 28px; font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.wa-t { display: grid; gap: .15rem; flex: 1; min-width: 0; justify-items: start; }
.wa-k { font-size: var(--fs-label); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--athar-brown); }
html[lang="ar"] .wa-k { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.wa-n { font-family: var(--font-num); font-weight: 700; font-size: clamp(1.6rem, 2.5vw, 2.3rem); line-height: 1.1; letter-spacing: .01em; color: var(--athar-green); white-space: nowrap; }
.wa-line .arrow-circle { transition: background-color .25s, color .25s, transform .35s var(--ease); }
.wa-line:hover .arrow-circle, .wa-line:focus-visible .arrow-circle { background: var(--athar-brown); color: var(--athar-cream); }
.wa-line:hover .wa-n { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.wa-where { display: flex; align-items: center; gap: .45rem; margin-block-start: 1rem; color: var(--muted); font-size: .9375rem; }
html[lang="ar"] .wa-where { font-size: 1rem; }
.wa-where .ms { font-size: 1.15rem; color: var(--athar-brown); }

/* ---------- the conversation: a chat card in front of a dune arch ---------- */
.talk {
  --aw: clamp(280px, 29vw, 430px);       /* the arch's width; its dome is half of it */
  grid-area: talk; position: relative; align-self: start;
  padding-block-start: clamp(1.5rem, 1.8vw, 1.75rem);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.talk-arch, .talk-arch-line { position: absolute; pointer-events: none; }
.talk-arch {
  inset-block-start: 0; inset-inline-end: 0; width: var(--aw); height: calc(100% - 2.5rem);
  border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 28px 28px;
  background: var(--athar-dune);   /* plain: the card covers its middle, and the thread carries the mark */
}
.talk-arch-line {
  inset-block-start: -14px; inset-inline-end: -14px; width: calc(var(--aw) + 28px); height: calc(100% - 2.5rem + 14px);
  border: 1px solid rgba(104, 73, 37, .3);
  border-radius: calc(var(--aw) / 2 + 14px) calc(var(--aw) / 2 + 14px) 34px 34px;
}
.talk-card {
  position: relative; z-index: 1; max-width: 31rem; margin-inline-end: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--athar-ivory); border-radius: 28px; overflow: hidden;
  box-shadow: 0 34px 70px rgba(56, 40, 20, .14), 0 3px 10px rgba(56, 40, 20, .06);
}

/* head: who you are writing to */
.talk-head { display: flex; align-items: center; gap: .85rem; padding: .75rem 1.25rem; background: var(--athar-green); color: var(--athar-cream); }
.talk-avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--athar-cream); }
.talk-avatar img { height: 29px; width: auto; }
.talk-ping { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--athar-sand); opacity: 0; pointer-events: none; }
.talk-who { display: grid; gap: .05rem; line-height: 1.25; min-width: 0; }
.talk-who strong { font-weight: 800; font-size: 1.0625rem; letter-spacing: .08em; }
html[lang="ar"] .talk-who strong { letter-spacing: 0; font-family: var(--font-arabic-display); font-weight: 700; font-size: 1.125rem; }
.talk-who > span { font-size: .8125rem; color: var(--athar-sand); }
html[lang="ar"] .talk-who > span { font-size: .875rem; }
.talk-head-icon { margin-inline-start: auto; color: var(--athar-sand); font-size: 1.4rem; }

/* thread: our greeting, the hint for the chosen topic, then your message as it will arrive */
.talk-thread {
  /* a fixed window, like a chat: words arrive at the bottom. Once you start writing, our greeting steps
     aside so our reply for your topic stays just above your message, and contact.js cuts your bubble
     at whole lines (with "…") to what the window holds, so nothing is ever sliced or pushed out */
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: .4rem;
  height: 13.5rem; padding: .9rem 1.15rem .9rem; background: var(--athar-cream);
}
.talk-thread > .bubble { flex: none; }
.talk-thread.is-writing > .greet { display: none; }
.talk-thread::after { content: ""; position: absolute; z-index: 2; inset-inline: 0; inset-block-start: 0; height: .9rem; background: linear-gradient(var(--athar-cream), rgba(252, 248, 239, 0)); pointer-events: none; }
.talk-thread::before {
  content: ""; position: absolute; z-index: -1; inset-block-start: 10%; inset-inline-end: -4%; width: 30%; aspect-ratio: 149.6 / 189.1;
  background: url("/assets/logo/athar-mark-watermark.svg") center / contain no-repeat; opacity: .3;
}
.bubble {
  position: relative; max-width: 86%; margin: 0; padding: .5rem .9rem .55rem;
  border-radius: 18px; font-size: .9375rem; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(56, 40, 20, .08);
}
html[lang="ar"] .bubble { font-size: 1rem; line-height: 1.6; }
.bubble.in { background: var(--athar-ivory); color: var(--athar-ink); border-start-start-radius: 5px; }
.bubble.hint { color: var(--athar-green); font-weight: 600; }
.bubble.out {
  align-self: flex-end; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: .55rem; min-width: 5.5rem; margin-block-start: .2rem;
  background: var(--athar-sage); color: var(--athar-ink); border-start-end-radius: 5px;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.out-text { display: block; min-width: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: .875rem; line-height: 1.4; }
html[lang="ar"] .out-text { font-size: .9375rem; line-height: 1.5; }
.out-text b { display: block; margin-block-end: .2rem; color: var(--athar-green); font-weight: 800; }
/* whole lines only: contact.js keeps the words that fit the window and ends a cut with "…" */
.out-lines { display: block; }
.out-text .k { color: var(--athar-brown); font-weight: 700; }
.out-meta { justify-self: end; display: inline-flex; margin-block-end: .1rem; color: var(--athar-green); line-height: 1; }
.out-meta .ms { font-size: 1rem; }
.bubble.out.is-empty { padding-block: .55rem; }
.bubble.out.is-empty :is(.out-text, .out-meta) { display: none; }
.bubble.out:not(.is-empty) .typing { display: none; }
.typing { display: inline-flex; gap: 5px; align-items: center; justify-content: center; height: 1rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--athar-green); opacity: .35; }
.bubble.out.is-sent .out-meta { color: var(--athar-brown); }

/* composer: the form itself */
.talk-form { display: grid; gap: .65rem; padding: .85rem 1.25rem 1.05rem; border-block-start: 1px solid var(--line); }
.talk-form .field { gap: .3rem; }
.talk-form .field > label, .talk-form .field > .field-label { font-size: .875rem; }
html[lang="ar"] .talk-form .field > label, html[lang="ar"] .talk-form .field > .field-label { font-size: .9375rem; }
.talk-form .chips { gap: .45rem; }
.talk-form .chip { padding-inline: .9rem; }
.talk-form .chip .ms { font-size: 1.15rem; }
.talk-form .chip[aria-checked="true"] .ms { color: var(--athar-cream); }
.talk-form .chip:not([aria-checked="true"]):hover { border-color: var(--athar-brown); }
.talk-form .input { min-height: 48px; }
.talk-form .textarea { min-height: 5rem; padding-block: 10px; }
html[lang="ar"] .talk-form .field > :is(label, .field-label) { line-height: 1.4; }
html[lang="ar"] .talk-form .textarea { line-height: 1.6; }
.talk-send { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.talk-note { flex: 1; min-width: 12rem; font-size: .8125rem; line-height: 1.45; color: var(--muted); text-wrap: balance; }
html[lang="ar"] .talk-note { font-size: .9375rem; line-height: 1.6; }

/* confirmation, inside the same card */
.talk-done { display: grid; justify-items: start; gap: .65rem; padding: 1.4rem 1.25rem 1.5rem; border-block-start: 1px solid var(--line); }
.talk-done:focus { outline: none; }
.talk-done:focus-visible { outline: 3px solid var(--athar-green); outline-offset: -3px; }
.talk-done .h3 { color: var(--athar-brown); }
.talk-done p { color: var(--athar-ink); max-width: 40ch; }
.done-actions { margin-block-start: .5rem; --cluster: .5rem; }

/* ---------- the way in for companies ---------- */
.contact-aside { grid-area: aside; align-self: start; max-width: 33rem; }
.contact-companies {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: 20px; border: 1px solid var(--line); background: var(--athar-ivory);
  text-decoration: none; color: inherit; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.contact-companies .t { display: grid; gap: .15rem; }
.contact-companies strong { color: var(--athar-green); font-weight: 800; font-size: 1.0625rem; }
html[lang="ar"] .contact-companies strong { font-family: var(--font-arabic-display); font-weight: 700; }
.contact-companies .t > span { color: var(--muted); font-size: .9375rem; line-height: 1.45; text-wrap: pretty; }
html[lang="ar"] .contact-companies .t > span { font-size: 1rem; line-height: 1.7; }
.contact-companies .go { color: var(--athar-brown); font-size: 1.4rem; transition: transform .25s var(--ease); }
.contact-companies:hover { transform: translateY(-2px); border-color: transparent; box-shadow: var(--shadow-card); }

/* ---------- the next step, closing the page ---------- */
.contact-next { margin-block-start: clamp(3rem, 6vw, 4.5rem); }

/* ---------- motion: the typing dots, and a ripple from our mark when your words arrive ---------- */
@media (prefers-reduced-motion: no-preference) {
  .typing i { animation: talk-typing 1.4s ease-in-out infinite; }
  .typing i:nth-child(2) { animation-delay: .18s; }
  .typing i:nth-child(3) { animation-delay: .36s; }
  .talk-ping.is-on { animation: talk-ping 1.6s cubic-bezier(.15, .6, .25, 1); }
  .wa-line:hover .arrow-circle { transform: rotate(-8deg); }
}
@keyframes talk-typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }
@keyframes talk-ping { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.3); } }

/* ---------- responsive ---------- */
@media (min-width: 961px) and (max-width: 1240px) {
  .talk-card { margin-inline-end: 1.25rem; }
}
/* one column: the invitation, then the conversation, then the way in for companies */
@media (max-width: 960px) {
  .contact-grid { grid-template-columns: 1fr; grid-template-areas: "intro" "talk" "aside"; grid-template-rows: none; }
  .contact-intro { padding-block-start: 0; }
  /* one column, one edge: the WhatsApp line, the chat card and the companies card share one width */
  .contact-intro, .talk, .contact-aside { width: 100%; max-width: 36rem; }
  .wa-line { max-width: none; }
  /* the arch becomes a dome rising behind the head of the card */
  .talk { --aw: min(76%, 380px); padding-block-start: clamp(2.5rem, 8vw, 3.5rem); }
  .talk-arch { inset-inline: 0; margin-inline: auto; height: calc(var(--aw) * .62); border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 0 0; }
  .talk-arch-line { inset-inline: 0; margin-inline: auto; height: calc(var(--aw) * .62 + 14px); border-block-end: 0; border-radius: calc(var(--aw) / 2 + 14px) calc(var(--aw) / 2 + 14px) 0 0; }
  .talk-card { max-width: none; margin-inline: 0; }
}
@media (max-width: 620px) {
  .wa-line { gap: .9rem; }
  .wa-disc { width: 52px; height: 52px; }
  .wa-line .arrow-circle { width: 44px; height: 44px; }
  .talk { --aw: 78%; }
  .talk-card { border-radius: 24px; }
  .talk-head { padding: .85rem 1rem; }
  /* narrower bubbles wrap more: a taller window keeps our reply and a few lines of yours in view */
  .talk-thread { height: 15rem; padding: 1rem .9rem .95rem; }
  .bubble.out { max-width: 92%; }
  .talk-form { padding: 1rem 1rem 1.15rem; }
  .talk-send .btn, .done-actions .btn:not(.ghost) { flex: 1 1 100%; }
  .talk-done { padding-inline: 1rem; }
}
