/* ===== ЭКРАН 5 — КОНТАКТЫ (подвал) =====
   Макет шириной 1440, масштабируется под ширину окна. Финальный фрейм «как в Figma»:
   неоновый заголовок, контакты-слои (при наведении — синее выделение с ручками),
   комментарий A.Chuchukin с полем ответа (уходит в Телеграм). Оживляет js/contacts.js. */

.contacts {
  /* — настройки — */
  --pad-x: 180;          /* отступ слева/справа */
  --title-size: 118;     /* кегль заголовка */
  --row-h: 50;           /* высота строки контакта */
  --value-size: 16;      /* кегль контакта */
  --figma-blue: #0D99FF;

  container-type: inline-size;
  position: relative;
  overflow-x: clip;
  background: var(--bg);
}
.contacts__stage {
  --c: calc(100cqw / 1440);
  --u: var(--c); /* курсор и выделение считают размеры в --u */
  position: relative;
  min-height: max(100vh, calc(760 * var(--c)));
  display: flex; flex-direction: column; justify-content: center; /* последний экран — содержимое по центру по высоте */
  padding: calc(110 * var(--c)) calc(var(--pad-x) * var(--c)) calc(150 * var(--c));
}
/* мягкое неоновое зарево под заголовком */
.contacts__stage::after {
  content: ""; position: absolute; pointer-events: none;
  left: calc(60 * var(--c)); top: calc(80 * var(--c)); width: calc(900 * var(--c)); height: calc(420 * var(--c));
  background: radial-gradient(closest-side, rgba(231, 85, 174, 0.16), rgba(58, 122, 196, 0.08) 60%, transparent);
  filter: blur(calc(20 * var(--c)));
}
.contacts__stage > * { position: relative; z-index: 1; }

/* имя фрейма, как в Figma — шутка про «финальные» версии */
.contacts__frame-name {
  display: flex; align-items: center; gap: calc(6 * var(--c));
  margin: 0 0 calc(14 * var(--c));
  font-size: calc(12 * var(--c)); font-weight: 400;
  color: rgba(255, 255, 255, 0.45);
}
.contacts__frame-name svg { width: calc(11 * var(--c)); height: calc(11 * var(--c)); fill: none; stroke: currentColor; stroke-width: 1.3; }

/* ===== НЕОНОВЫЙ ЗАГОЛОВОК ===== */
.contacts__title {
  margin: 0;
  font-weight: 800;
  font-size: calc(var(--title-size) * var(--c));
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.contacts__title { display: flex; align-items: baseline; width: max-content; }
/* «Поработаем» — залито градиентом с неоновым свечением */
.contacts__title span:first-child {
  background: linear-gradient(90deg, var(--pink), #b56be0 50%, var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 calc(18 * var(--c)) rgba(231, 85, 174, 0.45));
}
/* «?» — его притаскивает курсор из-за кадра; горит тем же неоном, с лёгким наклоном */
.contacts__q {
  display: inline-block; margin-left: calc(6 * var(--c));
  color: var(--blue);
  text-shadow: 0 0 calc(10 * var(--c)) rgba(58, 122, 196, 0.9), 0 0 calc(28 * var(--c)) rgba(58, 122, 196, 0.6);
  rotate: 8deg;
}
/* неон зажигается, когда экран показался: моргнул — погас — горит */
.contacts.is-pending .contacts__title span:first-child { opacity: 0.08; }
.contacts.is-lit .contacts__title span:first-child { animation: neon-on 1.1s steps(1) both; }
.contacts.is-q-pending .contacts__q { opacity: 0; }
.contacts.is-q-in .contacts__q { animation: neon-hum 5s 1s infinite; }
@keyframes neon-on {
  0% { opacity: 0.08; } 8% { opacity: 1; } 14% { opacity: 0.15; } 22% { opacity: 0.9; } 30% { opacity: 0.2; } 46% { opacity: 1; } 100% { opacity: 1; }
}
@keyframes neon-hum { 0%, 92%, 100% { opacity: 1; } 93% { opacity: 0.55; } 95% { opacity: 1; } 96% { opacity: 0.7; } }

/* ===== КОНТАКТЫ-СЛОИ ===== */
/* контакты слева, комментарий справа — одной строкой */
.contacts__row { display: flex; align-items: flex-start; gap: calc(40 * var(--c)); margin-top: calc(70 * var(--c)); }
.contacts__list { flex: none; width: calc(600 * var(--c)); margin: 0; padding: 0; list-style: none; }
.contacts__list li + li { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.cline {
  position: relative;
  display: grid; align-items: center;
  grid-template-columns: calc(34 * var(--c)) calc(90 * var(--c)) 1fr auto;
  height: calc(var(--row-h) * var(--c));
  padding: 0 calc(10 * var(--c));
  color: #fff; text-decoration: none;
  transition: color 0.25s;
}
.cline__icon {
  width: calc(19 * var(--c)); height: calc(19 * var(--c));
  fill: none; stroke: #d9d3e0; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round;
  transition: stroke 0.25s, filter 0.25s;
}
.cline__kind { font-size: calc(9 * var(--c)); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.45); }
.cline__value { font-weight: 500; font-size: calc(var(--value-size) * var(--c)); white-space: nowrap; transition: transform 0.35s cubic-bezier(.2,.9,.1,1); }
.cline__act {
  padding: calc(4 * var(--c)) calc(10 * var(--c)); border-radius: calc(30 * var(--c));
  font-size: calc(10 * var(--c)); font-weight: 400;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
  opacity: 0.55; transition: opacity 0.25s, background 0.25s, border-color 0.25s;
}
.cline--tg .cline__act { opacity: 1; border-color: var(--pink); background: var(--pink); }

/* наведение: слой «выделен», как в Figma — синяя рамка с ручками; иконка загорается неоном */
.cline i {
  position: absolute; width: calc(6 * var(--c)); height: calc(6 * var(--c));
  background: #fff; border: 1px solid var(--figma-blue);
  opacity: 0; transition: opacity 0.15s;
}
.cline i:nth-of-type(1) { left: 0; top: 0; translate: -50% -50%; }
.cline i:nth-of-type(2) { right: 0; top: 0; translate: 50% -50%; }
.cline i:nth-of-type(3) { left: 0; bottom: 0; translate: -50% 50%; }
.cline i:nth-of-type(4) { right: 0; bottom: 0; translate: 50% 50%; }
.cline::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid var(--figma-blue); opacity: 0; transition: opacity 0.15s;
}
.cline:hover::before, .cline:hover i, .cline:focus-visible::before, .cline:focus-visible i { opacity: 1; }
.cline:hover .cline__icon { stroke: #ffc4e6; filter: drop-shadow(0 0 calc(3 * var(--c)) var(--pink)) drop-shadow(0 0 calc(8 * var(--c)) var(--pink)); }
.cline:hover .cline__value { transform: translateX(calc(6 * var(--c))); }
.cline:hover .cline__act { opacity: 1; border-color: #fff; }
.cline.is-copied .cline__act { background: var(--figma-blue); border-color: var(--figma-blue); opacity: 1; }
.cline:focus-visible { outline: none; }

/* ===== КОММЕНТАРИЙ A.CHUCHUKIN ===== */
.comment {
  position: relative; z-index: 3;
  display: flex; align-items: flex-start; gap: calc(10 * var(--c));
}
.comment__pin {
  flex: none; display: grid; place-items: center;
  width: calc(40 * var(--c)); height: calc(40 * var(--c));
  border-radius: 50% 50% 50% 0;               /* булавка комментария, как в Figma */
  background: var(--pink); border: calc(2 * var(--c)) solid #fff;
  font-size: calc(12 * var(--c)); font-weight: 700;
  box-shadow: 0 calc(6 * var(--c)) calc(16 * var(--c)) rgba(0, 0, 0, 0.4);
}
.comment__card {
  width: calc(340 * var(--c));
  padding: calc(16 * var(--c)) calc(18 * var(--c)) calc(14 * var(--c));
  border-radius: calc(12 * var(--c));
  background: #fff; color: #1e1e1e;
  box-shadow: 0 calc(18 * var(--c)) calc(50 * var(--c)) rgba(0, 0, 0, 0.5);
  transform-origin: 0 0;
}
.comment__head { display: flex; align-items: baseline; gap: calc(8 * var(--c)); margin: 0 0 calc(8 * var(--c)); font-size: calc(12 * var(--c)); }
.comment__head b { font-weight: 600; }
.comment__head span { color: #8a8a8a; font-size: calc(11 * var(--c)); }
.comment__text { margin: 0; min-height: 3.9em; font-size: calc(14 * var(--c)); line-height: 1.45; font-weight: 400; }
.comment__text.is-typing::after { content: ""; display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; vertical-align: -0.15em; background: #1e1e1e; animation: comment-caret 0.9s steps(1) infinite; }
@keyframes comment-caret { 50% { opacity: 0; } }

.comment__reply {
  display: flex; align-items: center; gap: calc(8 * var(--c));
  margin-top: calc(12 * var(--c)); padding-top: calc(12 * var(--c));
  border-top: 1px solid #ececec;
}
.comment__reply input {
  flex: 1; min-width: 0;
  padding: calc(9 * var(--c)) calc(12 * var(--c));
  border: 1px solid #e3e3e3; border-radius: calc(8 * var(--c));
  font: inherit; font-size: calc(13 * var(--c)); color: #1e1e1e; background: #fafafa;
}
.comment__reply input:focus { outline: none; border-color: var(--figma-blue); background: #fff; }
.comment__reply button {
  flex: none; display: grid; place-items: center;
  width: calc(34 * var(--c)); height: calc(34 * var(--c));
  border: 0; border-radius: 50%; padding: 0;
  background: #d9d9d9; cursor: pointer; transition: background 0.2s;
}
.comment__reply button svg { width: 55%; height: 55%; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.comment__reply.has-text button { background: var(--figma-blue); }

/* пока курсор не оставил комментарий — его нет */
.contacts.is-comment-pending .comment { visibility: hidden; }
.contacts.is-card-pending .comment__card { visibility: hidden; }

/* ===== НИЗ ===== */
.contacts__bottom {
  position: absolute !important; left: calc(var(--pad-x) * var(--c)); right: calc(var(--pad-x) * var(--c)); bottom: calc(46 * var(--c));
  display: flex; justify-content: space-between; gap: calc(20 * var(--c));
  padding-top: calc(20 * var(--c)); border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: calc(12 * var(--c)); color: rgba(255, 255, 255, 0.4);
}
.contacts__bottom a { text-decoration: none; color: rgba(255, 255, 255, 0.7); }
.contacts__bottom a:hover { color: var(--pink); }

/* всплывашка «Скопировано», как в Figma */
.contacts__toast {
  position: fixed !important; left: 50%; bottom: 32px; z-index: 60;
  padding: 10px 18px; border-radius: 8px;
  background: #2c2c2c; color: #fff; font-size: 13px; font-weight: 400;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  translate: -50% 20px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, translate 0.25s;
}
.contacts__toast.is-on { opacity: 1; translate: -50% 0; }

/* курсор экрана */
.contacts__stage > .intro-select,
.contacts__stage > .intro-cursor { position: absolute; left: 0; top: 0; z-index: 5; }

/* ===== ВЕРТИКАЛЬНЫЙ ЭКРАН (телефон): крупнее, комментарий — под заголовком ===== */
@media (max-aspect-ratio: 4 / 5) {
  .contacts { --pad-x: 36; --title-size: 64; --row-h: 70; --value-size: 18; }
  .contacts__stage { --c: calc(100cqw / 640); padding-bottom: calc(170 * var(--c)); }
  .contacts__row { flex-direction: column; margin-top: calc(50 * var(--c)); }
  .comment { margin-top: calc(10 * var(--c)); }
  .comment__card { width: calc(470 * var(--c)); }
  .comment__text { font-size: calc(18 * var(--c)); }
  .comment__reply input { font-size: calc(16 * var(--c)); padding: calc(12 * var(--c)); }
  .comment__reply button { width: calc(44 * var(--c)); height: calc(44 * var(--c)); }
  .contacts__list { width: 100%; }
  .cline__icon { width: calc(26 * var(--c)); height: calc(26 * var(--c)); }
  .cline__act { font-size: calc(12 * var(--c)); padding: calc(7 * var(--c)) calc(14 * var(--c)); }
  .cline { grid-template-columns: calc(46 * var(--c)) 1fr auto; grid-template-rows: auto auto; row-gap: calc(3 * var(--c)); padding: calc(16 * var(--c)) 0; height: auto; }
  .cline__icon { grid-row: span 2; }
  .cline__kind { grid-column: 2; font-size: calc(11 * var(--c)); }
  .cline__value { grid-column: 2; font-size: calc(var(--value-size) * var(--c)); white-space: normal; word-break: break-all; }
  .cline__act { grid-column: 3; grid-row: 1 / span 2; }
  .contacts__bottom { flex-direction: column; gap: calc(6 * var(--c)); font-size: calc(13 * var(--c)); }
  .contacts__bottom span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .contacts.is-lit .contacts__title span, .contacts.is-q-in .contacts__q { animation: none !important; }
}
