/* «Обговорити» pop-up: a clip window cut into the page. It opens from the middle like a splice
   (a red cut line, then the window spreads to both sides), closes the same way back. */

.talk { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: clamp(12px, 3vw, 40px); color: var(--text); }
.talk[hidden] { display: none; }
.talk-bg { position: absolute; inset: 0; background: rgba(4, 4, 5, 0.72); backdrop-filter: blur(10px) saturate(0.8); -webkit-backdrop-filter: blur(10px) saturate(0.8);
  opacity: 0; transition: opacity 0.35s var(--ease-out); }
.talk.in .talk-bg { opacity: 1; }

.talk-win { position: relative; width: min(1080px, 100%); max-height: calc(100svh - 2 * clamp(12px, 3vw, 40px)); overflow: auto; overscroll-behavior: contain;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4);
  clip-path: inset(0 50% 0 50% round 18px); transition: clip-path 0.6s var(--ease-out); }
.talk.in .talk-win { clip-path: inset(0 0 0 0 round 18px); }
/* the cut: a red line in the middle that the window opens from */
.talk-win::before { content: ''; position: absolute; z-index: 3; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--rec);
  box-shadow: 0 0 18px rgba(255, 69, 58, 0.8); opacity: 1; transition: opacity 0.5s 0.15s; pointer-events: none; }
.talk.in .talk-win::before { opacity: 0; }

/* header = a clip head on the V1 track */
.talk-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 8px 0 clamp(18px, 2.4vw, 32px);
  background: color-mix(in oklab, var(--bg-2) 92%, #000); border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: 0.06em; }
.talk-head > i { width: 26px; height: 12px; border-radius: 3px; background: var(--rec); }
.talk-head > span { color: var(--muted); }
.talk-head > b { font-weight: 500; }
.talk-tc { margin-left: auto; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.talk-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background-color 0.2s; }
.talk-x:hover { background: rgba(255, 255, 255, 0.08); }
.talk-x:focus-visible { outline: 2px solid var(--text); outline-offset: 0; }
.talk-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.talk-body { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px); padding: clamp(26px, 4vw, 52px) clamp(18px, 3.4vw, 48px) clamp(26px, 3.6vw, 46px); }
.talk-main { min-width: 0; }
.talk-ref { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.talk-ref b { font-weight: 500; color: var(--text); letter-spacing: 0.06em; }
.talk-h { margin: 0 0 14px; font-family: var(--f-display); font-weight: 300; letter-spacing: -0.02em;
  font-size: clamp(40px, 5vw, 76px); line-height: 1.02; }
.talk-lead { margin: 0 0 26px; font-size: clamp(16px, 1.3vw, 20px); color: var(--muted); }
.talk-brief { display: inline-flex; margin-top: 26px; }
.talk-quick { margin-top: 0; align-self: start; align-content: start; }

/* content rises after the window has opened */
.talk-body > * { opacity: 0; transform: translate3d(0, 14px, 0); transition: opacity 0.4s, transform 0.6s var(--ease-out); }
.talk.in .talk-body > * { opacity: 1; transform: none; transition-delay: 0.28s; }
.talk.in .talk-body > * + * { transition-delay: 0.36s; }

/* channels and the short form — self-contained, so the window looks the same on the direction pages */
.talk .channels { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0 0; }
.talk .channels a { position: relative; overflow: hidden; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text); transition: border-color 0.2s, background-color 0.2s; }
.talk .channels a:hover { border-color: var(--text); }
.talk-quick { padding: clamp(20px, 2.2vw, 28px); border-radius: 18px; border: 1px solid var(--line); display: grid; gap: 12px; }
.talk-quick .quick-h { margin: 0; font-weight: 700; }
.talk-quick label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.talk-quick input { min-height: 46px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 16px; }
.talk-quick input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent); }
.talk-quick .quick-err { margin: 0; color: var(--rec); font-size: 14px; }
.talk-quick .quick-ok { margin: 0; font-size: 12.5px; color: var(--muted); }
.talk-quick .btn { justify-self: start; }

/* two ways to write: Telegram (left button) and an email straight from the site (the mail button) */
.talk-acts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.talk-mailbtn { gap: 10px; }
.talk-mailbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

.talk-side { align-self: start; min-width: 0; display: grid; gap: 12px; }
.talk-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.talk-seg button { position: relative; z-index: 1; min-height: 34px; border: 0; background: none; color: var(--muted); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; border-radius: 999px; transition: color 0.3s; }
.talk-seg button[aria-selected='true'] { color: #0b0b0c; }
.talk-seg button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.talk-seg > i { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--text); transition: transform 0.45s var(--ease-out); }
.talk-side[data-mode='mail'] .talk-seg > i { transform: translateX(100%); }

/* the two forms share one cell; switching is a cut with a short slide */
.talk-panes { display: grid; }
.talk-pane { grid-area: 1 / 1; transition: opacity 0.3s, transform 0.45s var(--ease-out), visibility 0s 0.45s; }
.talk-side[data-mode='tg'] .talk-pane[data-pane='mail'], .talk-side[data-mode='mail'] .talk-pane[data-pane='tg'] { opacity: 0; visibility: hidden; pointer-events: none; }
.talk-side[data-mode='tg'] .talk-pane[data-pane='mail'] { transform: translate3d(24px, 0, 0); }
.talk-side[data-mode='mail'] .talk-pane[data-pane='tg'] { transform: translate3d(-24px, 0, 0); }
.talk-side[data-mode='tg'] .talk-pane[data-pane='tg'], .talk-side[data-mode='mail'] .talk-pane[data-pane='mail'] { transition: opacity 0.35s 0.08s, transform 0.5s 0.08s var(--ease-out), visibility 0s; }

.talk-mail { padding: clamp(20px, 2.2vw, 28px); border-radius: 18px; border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.talk-mail .quick-h { margin: 0; font-weight: 700; }
.talk-mail label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.talk-mail input, .talk-mail textarea { min-height: 46px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); padding: 10px 12px; font: inherit; font-size: 16px; }
.talk-mail textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.talk-mail input:focus, .talk-mail textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent); }
.talk-mail .quick-err { margin: 0; color: var(--rec); font-size: 14px; }
.talk-mail .btn { justify-self: start; }
.talk-mail .btn[disabled] { opacity: 0.6; cursor: progress; }
.talk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* sent: the fields step aside, a short confirmation stays */
.talk-mail.sent > :not(.talk-sent):not(.quick-h) { display: none; }
.talk-sent { display: grid; gap: 8px; }
.talk-sent[hidden], .talk [hidden] { display: none !important; }
.talk-sent-h { font-family: var(--f-display); font-weight: 300; font-size: clamp(22px, 2vw, 30px); }
.talk-sent p { margin: 0; color: var(--muted); }
.talk-sent p b { color: var(--text); font-weight: 600; }
.talk-again { justify-self: start; background: none; border: 0; padding: 0; color: var(--text); font: inherit; cursor: pointer; }

html.talk-open { overflow: hidden; }

@media (max-width: 759px) {
  .talk { padding: 0; place-items: end stretch; }
  .talk-win { width: 100%; max-height: 92svh; border-radius: 18px 18px 0 0; clip-path: inset(100% 0 0 0 round 18px 18px 0 0); }
  .talk.in .talk-win { clip-path: inset(0 0 0 0 round 18px 18px 0 0); }
  .talk-win::before { display: none; }
  .talk-body { grid-template-columns: minmax(0, 1fr); }
  .talk-head > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .talk-win, .talk-bg, .talk-body > * { transition: none !important; }
  .talk-win { clip-path: none !important; }
  .talk-win::before { display: none; }
}
