/* ==========================================================================
   /contact/ — «Transmission»
   Spatial glass поверх WebGL-тумана, световая лента как несущая сигнала.
   Палитра только брендовая: champagne #e8d9b8, engineering teal, dark void.
   ========================================================================== */

/* Страница — комната, а не документ: локальный void глубже общесайтового,
   чтобы шапка и подвал не высветляли сцену.
   Значения совпадают с токенами design-system.css; файл
   подключается позже, поэтому выигрывает при равной специфичности. */
html[data-page='contact'] {
  --nx-bg-void: #04080c;
  --nx-bg-deep: #0e1116;
  --nx-bg-surface: rgba(22, 28, 38, 0.72);
  --nx-bg-elevated: rgba(28, 34, 46, 0.88);
  --nx-bg-glass: rgba(18, 24, 34, 0.55);
  --nx-bg-glass-strong: rgba(14, 18, 26, 0.82);

  --nx-accent: #e8ecf0;
  --nx-accent-soft: #f4f6f8;
  --nx-accent-dim: #c8d0d8;
  --nx-accent-glow: rgba(232, 236, 240, 0.12);
  --nx-accent-glow-strong: rgba(232, 236, 240, 0.2);
  --nx-on-accent: #12161c;

  --nx-border: rgba(255, 255, 255, 0.1);
  --nx-border-strong: rgba(255, 255, 255, 0.18);
  --nx-border-glass: rgba(255, 255, 255, 0.14);
  --nx-grid: rgba(255, 255, 255, 0.05);

  --bg-card: var(--nx-bg-surface);
  --text-primary: #f2f4f7;
  --text-secondary: #b8bfc9;
  --text-muted: #8b94a1;

  --campus-glass: rgba(16, 22, 32, 0.45);
  --campus-glass-strong: rgba(16, 22, 32, 0.72);
  --campus-ink: #f2f4f7;
  --campus-ink-dim: rgba(242, 244, 247, 0.82);
  --campus-line: rgba(255, 255, 255, 0.35);
  --campus-line-dim: rgba(255, 255, 255, 0.18);
  --campus-mark: #a4adb8;

  /* Transmission-палитра */
  --tx-ink: #f7f8f8;
  --tx-muted: rgba(226, 232, 235, 0.8);
  --tx-dim: rgba(226, 232, 235, 0.56);
  --tx-warm: #e8d9b8;
  --tx-warm-bright: #f4ead2;
  --tx-teal: rgba(146, 177, 187, 0.22);
  --tx-void: #04080c;
  --tx-success: #cae7da;
  --tx-success-soft: #dceee5;
  --tx-line: rgba(232, 239, 242, 0.16);
  --tx-line-strong: rgba(232, 239, 242, 0.3);
  --tx-head: clamp(78px, 9vh, 104px);

  /* Ходовые параметры ленты — их и переключает JS между состояниями канала */
  --tx-pulse-dur: 2400ms;
  --tx-pulse-opacity: 0.9;

  /* Курсор в долях панели, для parallax листов и specular-блика */
  --tx-px: 0;
  --tx-py: 0;
  --tx-mx: 50%;
  --tx-my: 30%;

  background: var(--tx-void);
}

html[data-page='contact'] body {
  background:
    radial-gradient(ellipse 90% 60% at 18% 6%, rgba(232, 217, 184, 0.07), transparent 62%),
    radial-gradient(ellipse 70% 70% at 86% 74%, var(--tx-teal), transparent 66%),
    linear-gradient(180deg, #060b11 0%, var(--tx-void) 46%, #02050a 100%);
  color: var(--tx-ink);
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   Слой 1 — WebGL-амбиент
   -------------------------------------------------------------------------- */

.tx-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.tx-stage__gl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms var(--nx-ease-out);
}

.tx-stage.is-live .tx-stage__gl {
  opacity: 1;
}

.tx-stage__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 52% at 50% 108%, rgba(4, 8, 12, 0.72), transparent 70%),
    linear-gradient(180deg, rgba(4, 8, 12, 0.55) 0%, transparent 26%, rgba(4, 8, 12, 0.4) 100%);
}

/* --------------------------------------------------------------------------
   Слой 2 — лента
   Живёт внутри <main>, а не в фиксированной сцене: так порт панели остаётся
   пристыкованным при скролле, без пересчёта пути на каждый кадр.
   -------------------------------------------------------------------------- */

.tx-ribbon-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* Сигнал проявляется из пустоты, а не начинается обрубком у кромки экрана */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%);
}

.tx-ribbon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tx-ribbon__echo,
.tx-ribbon__rail,
.tx-ribbon__halo,
.tx-ribbon__core {
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.tx-ribbon__echo {
  stroke: rgba(146, 177, 187, 0.3);
  stroke-width: 1;
  opacity: 0.4;
  animation: tx-draw 900ms var(--nx-ease-out) 460ms both;
}

.tx-ribbon__rail {
  stroke: rgba(232, 217, 184, 0.14);
  stroke-width: 1.25;
  animation: tx-draw 900ms var(--nx-ease-out) 400ms both;
}

/* Свечение сделано вторым, широким и прозрачным штрихом вместо filter:
   drop-shadow — фильтр пересчитывался бы каждый кадр анимации пунктира. */
.tx-ribbon__halo,
.tx-ribbon__core {
  stroke-dasharray: 0.16 0.84;
  stroke-dashoffset: 0;
  opacity: 0;
  animation:
    tx-pulse var(--tx-pulse-dur) linear infinite,
    tx-pulse-in 700ms var(--nx-ease-out) 900ms both;
}

/* Ореол — не filter: blur, а широкий полупрозрачный штрих: фильтр
   пересчитывался бы на каждом кадре бегущего пунктира. */
.tx-ribbon__halo {
  --tx-pulse-opacity: 0.22;
  stroke: var(--tx-warm);
  stroke-width: 8;
}

.tx-ribbon__core {
  stroke: url(#tx-ribbon-core);
  stroke-width: 1.6;
}

/* Наконечник ленты — статичная точка в конце path, совпадает с портом панели. */
.tx-ribbon__comet {
  opacity: 0;
  pointer-events: none;
  animation: tx-pulse-in 700ms var(--nx-ease-out) 900ms both;
}

.tx-ribbon__comet-halo {
  fill: rgba(232, 217, 184, 0.45);
}

.tx-ribbon__comet-core {
  fill: var(--tx-warm-bright);
}

.tx-ribbon-layer.is-static .tx-ribbon__comet {
  display: none;
}

@keyframes tx-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes tx-pulse {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1; }
}

@keyframes tx-pulse-in {
  from { opacity: 0; }
  to { opacity: var(--tx-pulse-opacity); }
}

/* Фокус в поле — канал слушает: пульс ярче и чуть быстрее */
.tx-page.is-focused {
  --tx-pulse-dur: 1700ms;
  --tx-pulse-opacity: 1;
}

/* Отправка — surge */
.tx-page.is-sending {
  --tx-pulse-dur: 950ms;
  --tx-pulse-opacity: 1;
}

.tx-page.is-sending .tx-ribbon__halo {
  --tx-pulse-opacity: 0.38;
  stroke-width: 11;
}

/* Успех — лента кристаллизуется в зелёный и замирает */
.tx-page.is-sent {
  --tx-pulse-dur: 4200ms;
}

.tx-page.is-sent .tx-ribbon__core {
  stroke: var(--tx-success);
}

.tx-page.is-sent .tx-ribbon__halo {
  --tx-pulse-opacity: 0.26;
  stroke: var(--tx-success);
  stroke-width: 9;
}

.tx-page.is-sent .tx-ribbon__rail {
  stroke: rgba(202, 231, 218, 0.22);
}

.tx-page.is-sent .tx-ribbon__comet-core {
  fill: var(--tx-success-soft);
}

.tx-page.is-sent .tx-ribbon__comet-halo {
  fill: rgba(202, 231, 218, 0.5);
}

/* --------------------------------------------------------------------------
   Слой 3 — spatial UI
   -------------------------------------------------------------------------- */

.tx-page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: clip;
  /* Leave room so focused fields + CTA stay above the soft keyboard */
  scroll-padding-bottom: max(4.5rem, env(safe-area-inset-bottom, 0px));
  padding:
    calc(var(--tx-head) + env(safe-area-inset-top, 0px))
    max(var(--nx-gutter), env(safe-area-inset-right, 0px))
    max(clamp(20px, 4vh, 40px), env(safe-area-inset-bottom, 0px))
    max(var(--nx-gutter), env(safe-area-inset-left, 0px));
}

.tx-page__crumbs {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  margin: 0 auto clamp(14px, 3vh, 34px);
  opacity: 0;
  animation: tx-rise 700ms var(--nx-ease-out) 420ms both;
}

.tx-page__crumbs .container {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.tx-page__crumbs .svc-crumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--nx-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--tx-dim);
}

.tx-page__crumbs .svc-crumbs__list li + li::before {
  content: '/';
  margin-right: 8px;
  opacity: 0.5;
}

.tx-page__crumbs .svc-crumbs__list a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease;
}

.tx-page__crumbs .svc-crumbs__list a:hover {
  color: var(--tx-ink);
}

.tx-page__crumbs .svc-crumbs__list [aria-current='page'] {
  color: rgba(232, 217, 184, 0.9);
}

.tx-layout {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  align-items: center;
  gap: clamp(32px, 5vw, 92px);
  width: min(100%, 1180px);
  max-width: 100%;
  margin: 0 auto;
  min-width: 0;
}

/* --- Манифест ------------------------------------------------------------ */

.tx-manifest {
  max-width: 33rem;
  animation: tx-rise 900ms var(--nx-ease-out) 520ms both;
}

.tx-manifest__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(16px, 2.4vh, 24px);
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(232, 217, 184, 0.2);
  border-radius: 999px;
  background: rgba(8, 14, 20, 0.42);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  font-family: var(--nx-font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(236, 240, 244, 0.84);
}

.tx-manifest__beacon {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--tx-warm);
  animation: tx-beacon 2400ms var(--nx-ease-out) infinite;
}

@keyframes tx-beacon {
  0% { box-shadow: 0 0 0 0 rgba(232, 217, 184, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(232, 217, 184, 0); }
}

.tx-manifest__title {
  margin: 0 0 14px;
  font-family: var(--nx-font-display);
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--tx-ink);
}

.tx-manifest__lead {
  max-width: 27em;
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.62;
  color: var(--tx-muted);
}

.tx-manifest__facts {
  display: grid;
  gap: 12px;
  margin: clamp(26px, 4vh, 42px) 0 0;
  padding: clamp(18px, 2.4vh, 24px) 0 0;
  border-top: 1px solid var(--tx-line);
}

.tx-fact {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 14px;
  align-items: baseline;
}

.tx-fact__key {
  margin: 0;
  font-family: var(--nx-font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 217, 184, 0.62);
}

.tx-fact__value {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--tx-muted);
}

.tx-manifest__mark {
  margin: clamp(24px, 4vh, 40px) 0 0;
  font-family: var(--nx-font-signal);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: rgba(245, 247, 248, 0.42);
  white-space: nowrap;
}

/* --- Стеклянная панель --------------------------------------------------- */

.tx-panel {
  position: relative;
  justify-self: end;
  width: min(100%, 560px);
  animation: tx-sheet 1000ms var(--nx-ease-out) 700ms both;
}

/* Cross-document handoff from lobby kiosk — holographic materialize @ 0.5s */
.tx-page.tx-page--campus-enter .tx-panel {
  animation: tx-hologram-in 500ms var(--nx-ease-out) both;
}
.tx-page.tx-page--campus-enter .tx-manifest {
  animation: tx-rise 500ms var(--nx-ease-out) 80ms both;
}

@keyframes tx-hologram-in {
  from {
    opacity: 0;
    transform: perspective(1200px) rotateY(-3deg) scale(0.94) translateY(14px);
    filter: brightness(1.35) saturate(0.75);
  }
  55% {
    filter: brightness(1.12) saturate(0.95);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Порт — точка стыковки ленты. Кольцо на левой кромке панели. */
.tx-panel__port {
  position: absolute;
  top: 34%;
  left: 0;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 1px solid rgba(232, 217, 184, 0.6);
  border-radius: 50%;
  background: rgba(4, 9, 14, 0.8);
  box-shadow: 0 0 18px rgba(232, 217, 184, 0.35);
  transition: box-shadow 320ms var(--nx-ease-out), border-color 320ms ease;
}

.tx-panel__port::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--tx-warm);
  box-shadow: 0 0 12px rgba(232, 217, 184, 0.7);
}

.tx-page.is-sending .tx-panel__port {
  box-shadow: 0 0 34px rgba(232, 217, 184, 0.6);
}

.tx-page.is-sent .tx-panel__port {
  border-color: rgba(202, 231, 218, 0.7);
  box-shadow: 0 0 30px rgba(202, 231, 218, 0.5);
}

.tx-page.is-sent .tx-panel__port::after {
  background: var(--tx-success-soft);
  box-shadow: 0 0 14px rgba(202, 231, 218, 0.8);
}

/* Кольцевой всплеск при успехе */
.tx-panel__port::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(202, 231, 218, 0.7);
  border-radius: 50%;
  opacity: 0;
}

.tx-page.is-sent .tx-panel__port::before {
  animation: tx-ripple 1100ms var(--nx-ease-out) 120ms both;
}

@keyframes tx-ripple {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(7); opacity: 0; }
}

/* Стопка листов позади основного стекла — глубина по visionOS */
.tx-panel__sheet {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px solid rgba(232, 239, 242, 0.07);
  border-radius: clamp(20px, 2.2vw, 26px);
  background: rgba(12, 18, 26, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  will-change: transform;
  transition: transform 600ms var(--nx-ease-out);
}

.tx-panel__sheet--near {
  transform: translate3d(calc(var(--tx-px) * 10px + 12px), calc(var(--tx-py) * 8px + 14px), 0) scale(0.985);
  opacity: 0.6;
}

.tx-panel__sheet--far {
  transform: translate3d(calc(var(--tx-px) * 18px + 24px), calc(var(--tx-py) * 14px + 26px), 0) scale(0.968);
  opacity: 0.34;
}

.tx-panel__glass {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
  padding: clamp(24px, 2.6vw, 34px);
  border-radius: clamp(20px, 2.2vw, 26px);
  background:
    linear-gradient(158deg, rgba(30, 40, 50, 0.62) 0%, rgba(9, 15, 21, 0.62) 62%, rgba(6, 11, 16, 0.7) 100%);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.5),
    0 2px 0 rgba(255, 255, 255, 0.07) inset,
    0 -30px 60px rgba(146, 177, 187, 0.05) inset;
  backdrop-filter: blur(26px) saturate(1.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.18);
  overflow: hidden;
  transition: box-shadow 500ms var(--nx-ease-out);
}

/* Градиентная кромка: один пиксель, светлеющий сверху — фаска стекла */
.tx-panel__glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(232, 217, 184, 0.18) 26%,
    rgba(255, 255, 255, 0.05) 52%,
    rgba(146, 177, 187, 0.14) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* Каустика: мягкое пятно, следующее за курсором */
.tx-panel__sheen {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    240px 200px at var(--tx-mx) var(--tx-my),
    rgba(232, 217, 184, 0.14),
    transparent 70%
  );
  opacity: 0.9;
  pointer-events: none;
  transition: background 220ms linear;
}

.tx-page.is-sent .tx-panel__glass {
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.44),
    0 0 70px rgba(178, 224, 202, 0.14),
    0 2px 0 rgba(255, 255, 255, 0.08) inset;
}

.tx-panel__head {
  position: relative;
  z-index: 1;
  margin: 0 0 clamp(20px, 2.4vh, 26px);
}

.tx-panel__title {
  margin: 0 0 6px;
  font-family: var(--nx-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232, 217, 184, 0.72);
}

.tx-panel__note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--tx-dim);
}

/* Приглашение к вводу после отправки уже неправда — карточка успеха говорит сама */
.tx-page.is-sent .tx-panel__head {
  display: none;
}

/* --- Форма --------------------------------------------------------------- */

.tx-form {
  position: relative;
  z-index: 1;
  display: grid;
  /* Right column sized for the 18-char mask (+7 (***) *** ** **) in
     tabular mono at 16px — a 50/50 split clips the last digit on desktop. */
  grid-template-columns: minmax(0, 1fr) minmax(14.75rem, 1.2fr);
  gap: 16px clamp(14px, 1.6vw, 20px);
}

.tx-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tx-field {
  position: relative;
  min-width: 0;
}

.tx-field--wide,
.tx-consent,
.tx-error,
.tx-actions {
  grid-column: 1 / -1;
}

.tx-field__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 7px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: rgba(236, 241, 244, 0.84);
}

.tx-field__hint {
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--tx-dim);
}

.tx-input {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  padding: 13px 15px;
  border: 1px solid var(--tx-line);
  border-radius: 14px;
  outline: none;
  background: rgba(4, 9, 14, 0.42);
  color: var(--tx-ink);
  font-family: var(--nx-font-body);
  /* ≥16px always — iOS zooms inputs smaller than 16px */
  font-size: 16px;
  font-weight: 450;
  line-height: 1.5;
  caret-color: var(--tx-warm);
  scroll-margin-bottom: max(5.5rem, env(safe-area-inset-bottom, 0px));
  transition:
    border-color 240ms ease,
    background 240ms ease,
    box-shadow 240ms var(--nx-ease-out);
}

.tx-input--area {
  min-height: 104px;
  resize: vertical;
}

.tx-input::placeholder {
  color: rgba(215, 224, 229, 0.42);
}

.tx-input[data-phone-mask] {
  font-family: var(--nx-font-signal-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  /* letter-spacing on <input> clips the last glyph in Chromium/Safari —
     the mask is already tabular, extra tracking is not worth the overflow. */
  letter-spacing: 0;
  padding-left: 12px;
  padding-right: 14px;
}

.tx-input:hover {
  border-color: var(--tx-line-strong);
}

.tx-input:focus {
  border-color: rgba(232, 217, 184, 0.5);
  background: rgba(8, 15, 21, 0.6);
  box-shadow:
    0 0 0 3px rgba(232, 217, 184, 0.09),
    0 14px 30px rgba(0, 0, 0, 0.22);
}

/* Тёплая подсветка нижней кромки активного поля — тот же свет, что и лента */
.tx-field__rim {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--tx-warm), transparent);
  box-shadow: 0 0 14px rgba(232, 217, 184, 0.4);
  transform: scaleX(0);
  transition: transform 320ms var(--nx-ease-out);
  pointer-events: none;
}

.tx-field:focus-within .tx-field__rim {
  transform: scaleX(1);
}

.tx-input:user-invalid {
  border-color: rgba(216, 164, 164, 0.5);
}

.tx-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 2px 0 0;
  min-height: var(--nx-tap-min, 44px);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--tx-dim);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.tx-consent input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: none;
  accent-color: #d7c7a5;
}

.tx-consent a {
  color: rgba(238, 242, 244, 0.86);
  text-underline-offset: 3px;
}

.tx-error {
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(216, 164, 164, 0.28);
  border-left-width: 2px;
  border-radius: 10px;
  background: rgba(89, 30, 30, 0.2);
  color: #f1c2c2;
  font-size: 0.79rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  max-width: 100%;
  animation: tx-rise 320ms var(--nx-ease-out) both;
}

/* display: grid/flex на этих блоках перебивает [hidden] из UA-стилей */
.tx-form[hidden],
.tx-error[hidden],
.tx-success[hidden] {
  display: none !important;
}

.tx-actions {
  margin-top: 2px;
}

.tx-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: max(56px, var(--nx-tap-min, 44px));
  padding: 14px 20px 14px 24px;
  scroll-margin-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(150deg, #f7f0e0 0%, var(--tx-warm) 58%, #dccdaa 100%);
  color: #0d1218;
  font-family: var(--nx-font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    0 0 40px rgba(232, 217, 184, 0.16);
  transition:
    transform 320ms var(--nx-ease-spring),
    box-shadow 320ms var(--nx-ease-out),
    filter 220ms ease;
}

.tx-submit i {
  font-size: 1.1rem;
  transition: transform 260ms var(--nx-ease-spring);
}

.tx-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.38),
    0 0 58px rgba(232, 217, 184, 0.26);
}

.tx-submit:hover i {
  transform: translate(3px, -3px);
}

.tx-submit:active {
  transform: translateY(0) scale(0.995);
}

.tx-submit:disabled {
  cursor: wait;
  filter: saturate(0.85);
  transform: none;
}

.tx-submit__shimmer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  opacity: 0;
  pointer-events: none;
}

.tx-submit.is-sending .tx-submit__shimmer {
  opacity: 1;
  animation: tx-shimmer 1150ms linear infinite;
}

@keyframes tx-shimmer {
  from { transform: translateX(0); }
  to { transform: translateX(420%); }
}

/* --- Успех --------------------------------------------------------------- */

.tx-success {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 300px;
  justify-content: center;
  animation: tx-sheet 760ms var(--nx-ease-out) both;
}

.tx-success__ring {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 1px solid rgba(232, 217, 184, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(202, 231, 218, 0.2);
}

.tx-success__ring::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 2px solid transparent;
  border-top-color: var(--tx-success-soft);
  border-right-color: rgba(202, 231, 218, 0.5);
  border-radius: 50%;
  animation: tx-ring 900ms var(--nx-ease-out) both;
}

@keyframes tx-ring {
  from { transform: rotate(-140deg) scale(0.75); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.tx-success__title {
  margin: 0 0 10px;
  font-family: var(--nx-font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--tx-ink);
}

.tx-success__text {
  max-width: 28em;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--tx-muted);
}

.tx-success__back {
  display: inline-flex;
  align-items: center;
  min-height: var(--nx-tap-min, 44px);
  margin-top: 22px;
  padding: 11px 20px;
  border: 1px solid var(--tx-line-strong);
  border-radius: 999px;
  background: rgba(8, 14, 19, 0.5);
  color: rgba(240, 244, 246, 0.92);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 220ms ease, background 220ms ease;
}

.tx-success__back:hover {
  border-color: rgba(232, 217, 184, 0.5);
  background: rgba(14, 22, 29, 0.7);
}

/* --- Мета-строка --------------------------------------------------------- */

.tx-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(18px, 3vw, 38px);
  width: min(100%, 1180px);
  margin: clamp(26px, 4vh, 44px) auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(224, 232, 237, 0.1);
  font-family: var(--nx-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--tx-dim);
  animation: tx-rise 800ms var(--nx-ease-out) 900ms both;
}

.tx-meta__item {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease;
}

a.tx-meta__item:hover {
  color: rgba(246, 248, 249, 0.92);
}

.tx-meta__item--place {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Фокус и чорография
   -------------------------------------------------------------------------- */

html[data-page='contact'] :focus-visible {
  outline: 2px solid rgba(232, 217, 184, 0.85);
  outline-offset: 3px;
  border-radius: 4px;
}

@keyframes tx-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes tx-sheet {
  from { opacity: 0; transform: translateY(30px) scale(0.975); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* --------------------------------------------------------------------------
   Адаптив — канон P0: bp-xl 1080, bp-md 720, bp-sm 560
   (без 767 / 700 / 620 в @media)
   -------------------------------------------------------------------------- */

/* bp-xl: dual → single */
@media (max-width: 1080px) {
  .tx-layout {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: clamp(28px, 5vh, 44px);
  }

  .tx-manifest {
    max-width: 40rem;
  }

  .tx-panel {
    justify-self: stretch;
    width: 100%;
    max-width: min(100%, 560px);
  }

  /* В стопке лента приходит сверху — порт переезжает на верхнюю кромку. Не к
     самому краю: ленте нужен разбег слева, чтобы войти в порт по вертикали. */
  .tx-panel__port {
    top: 0;
    left: 62%;
  }
}

/* bp-md: phone primary densify */
@media (max-width: 720px) {
  html[data-page='contact'] {
    --tx-head: clamp(70px, 8vh, 86px);
  }

  .tx-page {
    min-height: auto;
    scroll-padding-bottom: max(6rem, env(safe-area-inset-bottom, 0px));
  }

  .tx-layout {
    align-content: start;
  }

  .tx-manifest__title {
    font-size: clamp(2.1rem, 9vw, 3.2rem);
  }

  .tx-manifest__facts {
    margin-top: clamp(20px, 3vh, 30px);
  }

  .tx-fact {
    grid-template-columns: 7rem 1fr;
    gap: 10px;
  }

  .tx-manifest__mark {
    display: none;
  }

  .tx-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .tx-panel__sheet {
    display: none;
  }

  .tx-panel__glass {
    padding: 20px 18px 22px;
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
  }

  .tx-input {
    min-height: max(50px, var(--nx-tap-min, 44px));
  }

  .tx-input--area {
    min-height: 88px;
  }

  .tx-meta {
    gap: 8px 20px;
  }

  .tx-meta__item {
    min-height: var(--nx-tap-min, 44px);
    display: inline-flex;
    align-items: center;
  }

  .tx-meta__item--place {
    margin-left: 0;
  }
}

/* bp-sm: compact chrome */
@media (max-width: 560px) {
  .tx-page {
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
  }

  .tx-page__crumbs {
    margin-bottom: 12px;
  }

  .tx-manifest__eyebrow {
    max-width: 100%;
    white-space: normal;
  }

  .tx-manifest__lead {
    font-size: 0.98rem;
  }

  .tx-fact {
    grid-template-columns: 5.75rem 1fr;
    gap: 8px;
  }

  .tx-panel__glass {
    padding: 18px 14px 20px;
  }

  .tx-panel__head {
    margin-bottom: 14px;
  }

  .tx-consent {
    font-size: 0.72rem;
  }
}

/* Short landscape desktops — keep dual column usable */
@media (min-width: 1081px) and (max-height: 720px) {
  .tx-manifest__facts {
    margin-top: 20px;
    padding-top: 16px;
  }

  .tx-manifest__mark {
    margin-top: 20px;
  }

  .tx-panel__glass {
    padding: 22px 24px 24px;
  }

  .tx-input {
    min-height: 48px;
  }

  .tx-input--area {
    min-height: 82px;
  }
}

/* Landscape phone: stack already on; tighten vertical chrome */
@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .tx-page {
    min-height: auto;
    padding-top: calc(var(--tx-head) + 4px);
  }

  .tx-manifest__facts {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   prefers-reduced-motion — статичная композиция, без сцены и хореографии
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .tx-stage__gl {
    display: none;
  }

  .tx-stage__veil {
    background:
      radial-gradient(ellipse 80% 60% at 22% 4%, rgba(232, 217, 184, 0.08), transparent 62%),
      radial-gradient(ellipse 70% 66% at 84% 78%, var(--tx-teal), transparent 68%),
      linear-gradient(180deg, rgba(4, 8, 12, 0.4), rgba(2, 5, 10, 0.8));
  }

  .tx-ribbon__echo,
  .tx-ribbon__rail,
  .tx-ribbon__halo,
  .tx-ribbon__core,
  .tx-ribbon__comet,
  .tx-page__crumbs,
  .tx-manifest,
  .tx-manifest__beacon,
  .tx-panel,
  .tx-page.tx-page--campus-enter .tx-panel,
  .tx-page.tx-page--campus-enter .tx-manifest,
  .tx-meta,
  .tx-success,
  .tx-success__ring::after,
  .tx-panel__port::before,
  .tx-submit.is-sending .tx-submit__shimmer,
  .tx-error {
    animation: none !important;
  }

  .tx-ribbon__echo,
  .tx-ribbon__rail {
    stroke-dashoffset: 0;
  }

  .tx-ribbon__halo,
  .tx-ribbon__core {
    stroke-dasharray: 0.2 0.8;
    stroke-dashoffset: -0.8;
    opacity: 0.9;
  }

  .tx-ribbon__comet {
    display: none;
  }

  .tx-page__crumbs,
  .tx-manifest,
  .tx-panel,
  .tx-meta,
  .tx-success {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .tx-panel__sheet,
  .tx-panel__sheen,
  .tx-field__rim,
  .tx-submit,
  .tx-submit i,
  .tx-input {
    transition: none !important;
  }
}
