/* T3b / V2 design tokens — Living Geometry + Numeric Art.
   Типографика — ДОПУЩЕНИЕ: финальный шрифт владельцем не выбран,
   используется системный стек без загрузки шрифтовых файлов. */

:root {
  /* Палитра V2 */
  --bg: #eae9df;
  --bg-tint: #dce4f3;
  --bg-panel: #f4f3ea;
  --bg-field: #f7f6ef;
  --ink: #202326;
  --ink-muted: #555b53;
  --ink-soft: #535951;
  --blue: #354cc9;
  --blue-deep: #263aa9;
  --blue-ink: #2638a8;
  --orange: #e36a4a;
  --yellow: #e4b93b;
  --green: #809b87;
  --line: #acb3bc;
  --line-soft: rgba(134, 152, 182, 0.24);
  --line-faint: rgba(200, 201, 188, 0.4);
  --white: #ffffff;
  --focus: #e36a4a;

  /* Служебные поверхности */
  --header-bg: rgba(238, 238, 231, 0.92);
  --footer-bg: rgba(234, 233, 223, 0.85);
  --field-bg: rgba(247, 246, 239, 0.87);
  --field-line: #78859c;
  --watermark: rgba(53, 76, 201, 0.055);

  /* Типографика (системный стек, без сетевых шрифтов) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: clamp(24px, 3vw, 30px);
  --text-h2: clamp(28px, 3vw, 48px);
  --text-h1: clamp(48px, 5.6vw, 81px);

  /* Ритм и размеры */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 42px;
  --container: 1440px;
  --gutter: 5%;
  --header-pad-y: 21px;
  --radius: 0;
  --node-size: 36px;

  /* Движение: только transform/opacity, без layout-анимаций */
  --ease-reveal: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ui: cubic-bezier(0.4, 0, 0.2, 1);
  --t-feedback: 140ms;
  --t-ui: 220ms;
  --t-scene: 600ms;
  --t-watermark: 320ms;

  /* Слои */
  --z-bg: -1;
  --z-header: 10;
  --z-overlay: 9999;

  /* Фоновый слой */
  --bg-number-color: rgba(53, 76, 201, 0.055);
  --bg-scale: 1.055;
  --ambient-cycle: 17s;
}

/* T3b / V2 base layer.
   Сброс, типографика, каркас страницы, фоновый слой, reduced-motion.
   Шапка — сплошной полупрозрачный фон без backdrop-эффектов.
   Фон создаёт свой контейнер (div.bg-world), разметка от него не зависит. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: 0.96;
  letter-spacing: -0.073em;
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h3 {
  font-size: var(--text-lg);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  max-width: 42ch;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Каркас --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  position: relative;
  z-index: var(--z-header);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 14px;
  padding-inline: var(--gutter);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.site-header .brand svg {
  width: 32px;
  height: 32px;
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: 600;
}

.site-nav a,
.site-nav button {
  padding: 6px 0;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.site-nav a[aria-current="page"],
.site-nav button[aria-current="page"],
.site-nav .is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.site-footer {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  justify-content: space-between;
  padding-block: 13px;
  padding-inline: var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.site-footer__links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--ink);
  border-bottom-color: currentColor;
}

main#app {
  display: block;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: clamp(16px, 3vw, 32px) clamp(28px, 4vw, 52px);
  flex: 1 0 auto;
}

/* Мелкие общие элементы ------------------------------------------------ */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--orange);
  transform: rotate(45deg);
}

.note {
  max-width: 52ch;
  color: var(--ink-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Фоновый слой (div.bg-world создаёт site/src/js/background.js) --------- */

.bg-world {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 75% 38%,
    var(--bg-tint) 0%,
    #e4e6e5 38%,
    var(--bg) 76%
  );
}

.bg-scene {
  position: absolute;
  inset: 0;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

.bg-scene.is-tracking {
  will-change: transform;
}

.bg-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(var(--bg-scale));
  transform-origin: 50% 50%;
}

.bg-grid.is-ambient {
  animation: bg-drift var(--ambient-cycle) ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes bg-drift {
  from {
    transform: translate3d(0, 0, 0) scale(var(--bg-scale));
  }
  to {
    transform: translate3d(-12px, 10px, 0) scale(1.075);
  }
}

.bg-number {
  position: absolute;
  left: -0.04em;
  bottom: -0.2em;
  margin: 0;
  color: var(--bg-number-color);
  font-family: var(--font-sans);
  font-size: clamp(190px, 27vw, 390px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.12em;
  line-height: 0.8;
  opacity: 1;
  transition: opacity 160ms linear;
  user-select: none;
}

/* Пока идёт отслеживание курсора, слой не пересобирается */
html[data-lite="1"] .bg-scene,
html[data-lite="1"] .bg-scene.is-tracking {
  transform: none !important;
  will-change: auto;
}

html[data-lite="1"] .bg-grid.is-ambient {
  animation: none;
  will-change: auto;
}

/* Адаптив 360 / 390 / 768 / 1440 -------------------------------------- */

@media (min-width: 390px) {
  .site-header .brand {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .site-header {
    flex-wrap: nowrap;
    padding-block: var(--header-pad-y);
  }

  .site-nav {
    width: auto;
    gap: 24px;
    justify-content: flex-end;
  }

  .site-footer {
    flex-direction: row;
    align-items: center;
    gap: 15px;
  }
}

@media (min-width: 1440px) {
  body {
    font-size: 16px;
  }
}

@media (max-width: 389px) {
  .site-header .brand {
    font-size: 21px;
  }

  .site-nav {
    gap: 8px;
    font-size: 12px;
  }

  .site-nav a,
  .site-nav button {
    font-size: 12px;
  }
}

/* Reduced motion: полностью статичный интерфейс ----------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .bg-grid,
  .bg-grid.is-ambient {
    animation: none !important;
    transform: scale(var(--bg-scale)) !important;
    will-change: auto !important;
  }

  .bg-scene,
  .bg-scene.is-tracking {
    transform: none !important;
    will-change: auto !important;
  }

  .bg-number {
    transition: none;
  }
}

/* T3b / V2 components.
   Только transform/opacity в переходах; без тяжёлых эффектов на
   анимируемых элементах. */

/* Кнопки --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--t-feedback) var(--ease-ui),
    border-color var(--t-feedback) var(--ease-ui),
    color var(--t-feedback) var(--ease-ui);
}

.btn:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.btn:active {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
}

.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  background: rgba(244, 243, 234, 0.7);
  border-color: var(--ink);
  color: var(--ink);
}

.btn--minor {
  min-height: 0;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  justify-content: flex-start;
}

.btn--minor:hover {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
}

/* Поле ввода даты ------------------------------------------------------ */

.field {
  display: grid;
  gap: 10px;
  max-width: 355px;
  min-width: 0;
}

.field > label,
.field > .field-label {
  font-size: 12px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  color-scheme: light;
}

.field input::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.field input:hover {
  border-color: var(--ink-muted);
}

.field input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field .hint,
.field .error {
  font-size: var(--text-xs);
  line-height: 1.4;
}

.field .hint {
  color: var(--ink-muted);
}

.field .error {
  color: var(--orange);
}

/* Панель --------------------------------------------------------------- */

.panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(244, 243, 234, 0.9);
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel[data-watermark]::before {
  content: attr(data-watermark);
  position: absolute;
  right: -0.04em;
  bottom: -0.16em;
  z-index: 0;
  color: var(--watermark);
  font-size: clamp(140px, 18vw, 260px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.12em;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

/* Плоская карточка-строка: без «карточного» шаблона -------------------- */

.card-plain {
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.card-plain:last-child {
  border-bottom: 1px solid var(--line);
}

.card-plain__title {
  font-weight: 700;
}

/* Легенда -------------------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.legend > span,
.legend > li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i,
.legend .swatch {
  display: block;
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--blue);
}

.legend > :nth-child(2) i,
.legend > :nth-child(2) .swatch {
  background: var(--orange);
}

.legend > :nth-child(3) i,
.legend > :nth-child(3) .swatch {
  background: var(--green);
}

.legend > :nth-child(4) i,
.legend > :nth-child(4) .swatch {
  background: var(--yellow);
}

/* Узел SVG-схемы ------------------------------------------------------- */

.node {
  cursor: pointer;
  outline: none;
}

.node circle {
  fill: var(--bg-panel);
  stroke: var(--ink);
  stroke-width: 1.4;
  transition:
    fill var(--t-ui) var(--ease-ui),
    stroke var(--t-ui) var(--ease-ui);
}

.node text {
  fill: var(--ink);
  font-weight: 700;
  font-size: 23px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill var(--t-ui) var(--ease-ui);
}

.node:hover circle,
.node.is-active circle,
.node.selected circle,
.node[aria-pressed="true"] circle,
.node:focus-visible circle {
  fill: var(--blue);
  stroke: var(--blue);
}

.node:hover text,
.node.is-active text,
.node.selected text,
.node[aria-pressed="true"] text,
.node:focus-visible text {
  fill: var(--white);
}

.node:focus-visible circle {
  stroke-width: 2.4;
}

.node--sm text {
  font-size: 17px;
}

/* Метка / тег ---------------------------------------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--accent {
  border-color: var(--blue);
  color: var(--blue);
}

.tag--solid {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}

/* Диагностический оверлей ?perf=1 — site/src/styles/page-perf.css. */

@media (prefers-reduced-motion: reduce) {
  .node circle,
  .node text {
    transition: none;
  }
}

/* T14 — страницы арканов: каталог /arcana/ и /arcana/{n}/.
   Плоская типографика; анимации и тяжёлые визуальные эффекты не используются.
   Раскладка проверена на 360 / 390 / 768 / 1440 без переполнения. */

.arcana-page,
.arcana-index {
  width: 100%;
  min-width: 0;
  max-width: 1080px;
  margin-inline: auto;
}

/* Каталог -------------------------------------------------------------- */

.arcana-index__head {
  display: grid;
  gap: 14px;
  padding: 10px 0 clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.arcana-index__title {
  max-width: 20ch;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.arcana-index__intro {
  max-width: 68ch;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.5;
}

.arcana-index__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: clamp(20px, 3vw, 32px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.arcana-index__item {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.arcana-index__link {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  grid-template-areas:
    "number name"
    "number summary";
  gap: 4px 14px;
  align-items: start;
  min-width: 0;
  padding: 18px 0;
}

.arcana-index__link:hover {
  text-decoration: none;
}

.arcana-index__link:hover .arcana-index__name,
.arcana-index__link:hover .arcana-index__number {
  color: var(--blue);
}

.arcana-index__number {
  grid-area: number;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.arcana-index__name {
  grid-area: name;
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.arcana-index__summary {
  grid-area: summary;
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.arcana-index__cta {
  margin-top: clamp(24px, 4vw, 40px);
}

/* Страница аркана ------------------------------------------------------ */

.arcana-page__inner {
  display: block;
  min-width: 0;
}

.arcana-page__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding-bottom: 18px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.arcana-page__crumbs a {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.arcana-page__crumbs a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.arcana-page__head {
  display: grid;
  gap: 14px;
  padding-bottom: clamp(22px, 3.4vw, 34px);
  border-bottom: 1px solid var(--line);
}

.arcana-page__title {
  max-width: 18ch;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.arcana-page__summary {
  max-width: 56ch;
  color: var(--blue-ink);
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 600;
  line-height: 1.3;
}

.arcana-page__body {
  display: grid;
  gap: clamp(26px, 4vw, 44px);
  max-width: 74ch;
  padding-top: clamp(26px, 4vw, 44px);
}

.arcana-page__section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.arcana-page__section h2 {
  font-size: clamp(21px, 2.6vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.arcana-page__section p {
  max-width: 70ch;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.58;
}

.arcana-page__section--reflection {
  padding: 18px 0 18px 18px;
  border-left: 4px solid var(--blue);
  background: var(--bg-panel);
}

.arcana-page__section--reflection p {
  color: var(--ink);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 700;
  line-height: 1.35;
}

.arcana-page__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arcana-page__keywords li {
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: var(--bg-field);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
}

/* Призыв -------------------------------------------------------------- */

.arcana-page__cta {
  display: grid;
  gap: 16px;
  justify-items: start;
  max-width: 74ch;
  margin-top: clamp(30px, 4.5vw, 48px);
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

.arcana-page__cta p {
  max-width: 58ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.arcana-page__cta-link {
  max-width: 100%;
}

/* Навигация по кругу --------------------------------------------------- */

.arcana-page__pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: 74ch;
  margin-top: clamp(26px, 4vw, 40px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.arcana-page__pager-link {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 15px 0;
}

.arcana-page__pager-link + .arcana-page__pager-link {
  border-top: 1px solid var(--line-soft);
}

.arcana-page__pager-link:hover {
  text-decoration: none;
}

.arcana-page__pager-link:hover .arcana-page__pager-title {
  color: var(--blue);
}

.arcana-page__pager-label {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.arcana-page__pager-title {
  color: var(--ink);
  font-size: var(--text-base);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.arcana-page__pager-link--next {
  justify-items: end;
  text-align: right;
}

.arcana-page__all {
  margin-top: 18px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.arcana-page__all a {
  color: var(--blue);
  border-bottom: 1px solid var(--blue);
}

/* Ссылка из панели выбранного узла ------------------------------------ */

.matrix__arcana-link,
.compat__arcana-link {
  align-self: start;
  justify-self: start;
  max-width: 100%;
  color: var(--blue);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.matrix__arcana-link:hover,
.compat__arcana-link:hover {
  color: var(--blue-deep);
}

/* Адаптив 360 / 390 / 768 / 1440 -------------------------------------- */

@media (min-width: 640px) {
  .arcana-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .arcana-page__pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }

  .arcana-page__pager-link + .arcana-page__pager-link {
    border-top: 0;
  }
}

@media (min-width: 1024px) {
  .arcana-index__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .arcana-index__link {
    padding: 20px 0;
  }
}

@media (max-width: 389px) {
  .arcana-index__link {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 3px 8px;
  }

  .arcana-page__section--reflection {
    padding-left: 12px;
  }
}

/* T11b / T12 — стили фонового варианта «Числовой ландшафт».
   Перенесены из bg-numbers.js: CSP запрещает динамические <style>. */

.bg-variant {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-numbers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.bg-numbers__num {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scale(1);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-numbers__label {
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-numbers.is-static .bg-numbers__num,
.bg-numbers.is-static .bg-numbers__label {
  transition: none;
}

/* T6 — экран «Совместимость»: форма двух дат, парная схема, личные схемы.
   Только transform/opacity в анимациях; без тяжёлых эффектов.
   Геометрия — плоский SVG 600x600 из matrix-model.mjs. */

.compat {
  width: 100%;
  min-width: 0;
}

/* Заголовок ------------------------------------------------------------ */

.compat__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 0 18px;
}

.compat__head-main {
  min-width: 0;
}

.compat__head .eyebrow {
  margin-bottom: 10px;
}

.compat__note {
  max-width: 36ch;
  text-align: right;
}

.compat__title {
  max-width: 20ch;
  overflow-wrap: anywhere;
}

/* Форма двух дат ------------------------------------------------------- */

.compat__intro {
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
  min-width: 0;
}

.compat__lead {
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.45;
}

.compat__form {
  display: grid;
  gap: var(--space-5);
  width: 100%;
  max-width: 780px;
  min-width: 0;
}

.compat__fields {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.compat__fields .field {
  max-width: none;
}

.compat__fields .hint {
  margin-top: -2px;
}

.compat__error {
  min-height: 0;
  margin: 0;
  color: var(--orange);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}

.compat__error:empty {
  display: none;
}

.compat__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.compat__submit .btn {
  min-width: min(100%, 320px);
}

.compat__submit .note {
  max-width: 34ch;
}

.compat__noscript {
  margin-top: var(--space-2);
}

.compat__noscript a {
  border-bottom: 1px solid var(--ink);
  font-weight: 700;
}

/* SEO-текст ------------------------------------------------------------ */

.compat-content {
  display: grid;
  gap: clamp(26px, 4vw, 44px);
  max-width: 76ch;
  margin-top: clamp(30px, 5vw, 56px);
  padding-block: clamp(26px, 4vw, 46px) 0;
  border-top: 1px solid var(--line);
}

.compat-content__block {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.compat-content h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.compat-content p {
  max-width: 70ch;
  color: var(--ink-muted);
}

.compat-list,
.compat-links {
  display: grid;
  gap: 10px;
  padding-left: 1.2em;
  color: var(--ink-muted);
}

.compat-list {
  list-style: square;
}

.compat-links {
  list-style: none;
  padding-left: 0;
}

.compat-links li {
  padding-block: 9px;
  border-top: 1px solid var(--line-soft);
}

.compat-links li:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.compat-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.compat-links a:hover {
  color: var(--blue);
}

.compat-faq {
  display: grid;
}

.compat-faq details {
  padding-block: 12px;
  border-top: 1px solid var(--line-soft);
}

.compat-faq details:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.compat-faq summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}

.compat-faq summary::marker {
  color: var(--blue);
}

.compat-faq p {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

/* Результат: парная схема + панель ------------------------------------- */

.compat__layout {
  display: grid;
  gap: 0;
  min-width: 0;
}

.compat__pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

/* Легенда схемы -------------------------------------------------------- */

.compat__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.compat__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compat__swatch {
  display: block;
  width: 9px;
  height: 9px;
  flex: none;
}

.compat__swatch--diamond {
  background: var(--ink);
}

.compat__swatch--square {
  background: var(--bg);
  border: 1px solid var(--ink);
}

.compat__swatch--a {
  background: var(--blue);
}

.compat__swatch--b {
  background: var(--orange);
}

.compat__swatch--diag {
  background: var(--green);
}

.compat__chart {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 25px;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 35px 35px;
  background-position: center;
}

.compat__caption {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.compat-svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  overflow: visible;
  touch-action: manipulation;
}

.compat-mini-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Линии схемы ---------------------------------------------------------- */

.compat-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--t-ui) var(--ease-ui);
}

/* E3: рёбра выбранной точки ярче, остальные приглушены. */
.compat-line.is-dim {
  opacity: 0.35;
}

.compat-line.is-linked {
  opacity: 1;
}

.compat-line--diamond.is-linked,
.compat-line--square.is-linked {
  stroke-width: 2.6;
}

.compat-line--axis-a.is-linked,
.compat-line--axis-b.is-linked {
  stroke-width: 4;
}

.compat-line--spokes.is-linked {
  stroke-width: 3;
}

.compat-line--diamond,
.compat-line--square {
  stroke: var(--ink);
  stroke-width: 1.6;
}

.compat-line--axis-a {
  stroke: var(--blue);
  stroke-width: 3;
}

.compat-line--axis-b {
  stroke: var(--orange);
  stroke-width: 3;
}

.compat-line--spokes {
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

/* До готовности GSAP схема скрыта, чтобы не мигал готовый кадр. */
.compat-svg.is-preparing .compat-lines,
.compat-svg.is-preparing .compat-nodes,
.compat-mini-svg.is-preparing .compat-lines,
.compat-mini-svg.is-preparing .compat-nodes {
  opacity: 0;
}

/* Узлы ---------------------------------------------------------------- */

.compat-node {
  cursor: pointer;
  outline: none;
}

.compat-mini-svg .compat-node {
  cursor: default;
}

.compat-node__hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.compat-mini-svg .compat-node__hit {
  pointer-events: none;
}

.compat-node__base {
  fill: var(--bg-panel);
  stroke: var(--ink);
  stroke-width: 1.4;
}

.compat-node__halo {
  fill: var(--blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-ui) var(--ease-ui);
}

.compat-node__text {
  fill: var(--ink);
  font-weight: 700;
  font-size: 23px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.compat-node--center .compat-node__text {
  font-size: 28px;
}

.compat-node:hover .compat-node__base {
  stroke: var(--blue);
}

.compat-node.is-active .compat-node__halo,
.compat-node[aria-pressed="true"] .compat-node__halo,
.compat-node:focus-visible .compat-node__halo {
  opacity: 1;
}

.compat-node.is-active .compat-node__text,
.compat-node[aria-pressed="true"] .compat-node__text,
.compat-node:focus-visible .compat-node__text {
  fill: var(--white);
}

.compat-node:focus-visible .compat-node__base {
  stroke: var(--focus);
  stroke-width: 2.4;
}

/* Панель выбранной точки ---------------------------------------------- */

.compat__inspector {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}

.compat__inspector > * {
  position: relative;
  z-index: 1;
}

.compat__inspector::before {
  content: attr(data-watermark);
  position: absolute;
  right: -0.04em;
  bottom: -0.16em;
  z-index: 0;
  color: var(--watermark);
  font-size: clamp(140px, 18vw, 260px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.12em;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

.compat__number {
  color: var(--blue);
  font-size: clamp(90px, 12vw, 165px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.09em;
  line-height: 0.82;
}

.compat__arcana {
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.compat__point {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.compat__derivation {
  max-width: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--green);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.compat__stub {
  max-width: 40ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.compat__people {
  max-width: none;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.4;
}

.compat__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.compat__replay {
  min-height: 48px;
}

.compat__again {
  width: auto;
  min-height: 48px;
}

.compat__version {
  margin-top: 2px;
}

/* Личные схемы -------------------------------------------------------- */

.compat__personal {
  display: grid;
  gap: 18px;
  margin-bottom: 30px;
  min-width: 0;
}

.compat__mini {
  min-width: 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.compat__mini-label {
  margin-bottom: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Совпадения ---------------------------------------------------------- */

.compat__matches {
  display: grid;
  gap: 10px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.compat__matches-title {
  font-size: var(--text-xl);
}

.compat__match {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  max-width: none;
  color: var(--ink-muted);
  font-size: var(--text-base);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.compat__match-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Ошибка -------------------------------------------------------------- */

.compat__error-box {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-bottom: 34px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.compat__error-title {
  font-size: var(--text-xl);
  font-weight: 800;
}

.compat__error-text {
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: var(--text-base);
}

.compat__error-link {
  min-width: 220px;
}

/* Desktop: пара + панель, личные схемы в две колонки ------------------- */

@media (min-width: 900px) {
  .compat__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 28px);
  }

  .compat__pair {
    grid-template-columns: minmax(480px, 2fr) minmax(300px, 1fr);
    min-height: 560px;
  }

  .compat__inspector {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .compat__personal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: всё колонкой ------------------------------------------------- */

/* На самых узких экранах чуть уплотняем общую навигацию, чтобы не было
   горизонтального переполнения из-за длинных пунктов меню. */
@media (max-width: 430px) {
  body:has(.compat) .site-nav {
    gap: 8px;
  }

  body:has(.compat) .site-nav a {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  body:has(.compat) .site-nav {
    gap: 0;
  }
}

@media (max-width: 899px) {
  .compat__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 24px;
  }

  .compat__title {
    font-size: clamp(34px, 10vw, 46px);
    max-width: 14ch;
  }

  .compat__note {
    text-align: left;
  }

  .compat__chart {
    padding: 20px 3px 8px;
    min-height: 340px;
  }

  .compat__inspector {
    padding: 23px 0;
    gap: 12px;
  }

  .compat__number {
    font-size: 95px;
  }

  .compat__arcana {
    font-size: 27px;
  }

  .compat__inspector::before {
    font-size: 150px;
  }

  .compat__mini {
    padding: 12px 0;
  }
}

@media (max-width: 389px) {
  .compat__title {
    font-size: clamp(32px, 9.6vw, 38px);
  }

  .compat__submit {
    gap: 10px;
  }

  .compat__submit .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Без движения: подсветка меняется мгновенно -------------------------- */

@media (prefers-reduced-motion: reduce) {
  .compat-node__halo {
    transition: none;
  }

  .compat-line {
    transition: none;
  }
}

html[data-lite="1"] .compat-node__halo {
  transition: none;
}

html[data-lite="1"] .compat-line {
  transition: none;
}

/* T12 — плашка cookie-уведомления и панель настроек Метрики.
   Без размытия, фильтров и теней. Адаптив 360–1440.
   Контраст текста и кнопок — не ниже 4.5:1. */

.cookie-notice {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: var(--z-overlay);
  width: min(560px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink);
}

.cookie-notice__text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-notice__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.cookie-btn--solid {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  color: var(--white);
}

.cookie-btn--link {
  padding-inline: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--blue-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-btn:hover {
  border-color: var(--blue-deep);
}

.cookie-btn--solid:hover {
  background: var(--blue-ink);
}

.cookie-btn--link:hover {
  background: transparent;
  border-color: transparent;
  color: var(--blue-deep);
}

.cookie-btn:focus-visible,
.cookie-switch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Панель настроек ------------------------------------------------------ */

.site-footer__link {
  padding: 4px 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.site-footer__link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.cookie-settings {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(32, 35, 38, 0.72);
}

.cookie-settings[hidden] {
  display: none;
}

.cookie-settings__box {
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ink);
}

.cookie-settings__title {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.cookie-settings__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.cookie-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg-field);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.cookie-switch::after {
  content: "выкл";
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cookie-switch.is-on {
  border-color: var(--blue-deep);
}

.cookie-switch.is-on::after {
  content: "вкл";
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  color: var(--white);
}

.cookie-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
}

@media (max-width: 720px) {
  /* На мобильном плашка стоит в потоке после подвала и не перекрывает форму. */
  .cookie-notice {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0;
  }

  .cookie-notice__text {
    font-size: 13px;
  }

  .cookie-settings {
    align-items: flex-end;
    padding: 8px;
  }

  .cookie-settings__box {
    max-height: calc(100vh - 16px);
    padding: 16px;
  }
}

@media (min-width: 1440px) {
  .cookie-notice {
    left: 24px;
    bottom: 24px;
  }
}

/* T4 / главная «Расчёт».
   Сетка hero, форма даты, декоративная SVG-композиция и SEO-блоки.
   Движения нет: только статичная графика и системные focus-visible рамки. */

.home-hero {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  align-items: center;
  padding-block: clamp(8px, 2vw, 24px) clamp(28px, 5vw, 64px);
}

.home-hero__intro {
  display: grid;
  gap: clamp(14px, 2.4vw, 22px);
  min-width: 0;
}

.home-title {
  max-width: 14ch;
  font-size: clamp(44px, 6vw, 81px);
  line-height: 0.96;
}

.home-lead {
  max-width: 34ch;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.45;
}

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

.home-form {
  display: grid;
  gap: var(--space-4);
  width: 100%;
  max-width: 420px;
  min-width: 0;
}

.home-form .field {
  max-width: none;
}

.home-form .hint {
  margin-top: -2px;
}

.home-form__error {
  margin-top: calc(-1 * var(--space-2));
  color: var(--orange);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}

.home-form__error:empty {
  display: none;
}

.home-form .btn {
  width: 100%;
}

/* Декоративная композиция --------------------------------------------- */

.home-hero__art {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: clamp(18px, 3vw, 36px);
}

.home-hero__art svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* SEO-текст ------------------------------------------------------------ */

.home-content {
  display: grid;
  gap: clamp(26px, 4vw, 44px);
  max-width: 76ch;
  padding-block: clamp(26px, 4vw, 46px) 0;
  border-top: 1px solid var(--line);
}

.home-content__block {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.home-content h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.home-content p {
  max-width: 70ch;
  color: var(--ink-muted);
}

.home-list,
.home-links {
  display: grid;
  gap: 10px;
  padding-left: 1.2em;
  color: var(--ink-muted);
}

.home-list {
  list-style: square;
}

.home-links {
  list-style: none;
  padding-left: 0;
}

.home-links li {
  padding-block: 9px;
  border-top: 1px solid var(--line-soft);
}

.home-links li:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.home-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.home-links a:hover {
  color: var(--blue);
}

/* FAQ ----------------------------------------------------------------- */

.home-faq {
  display: grid;
}

.home-faq details {
  padding-block: 12px;
  border-top: 1px solid var(--line-soft);
}

.home-faq details:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.home-faq summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}

.home-faq summary::marker {
  color: var(--blue);
}

.home-faq p {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

/* Фокус --------------------------------------------------------------- */

.home-form input:focus-visible,
.home-form .btn:focus-visible,
.home-faq summary:focus-visible,
.home-content a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Desktop: форма слева, графика справа -------------------------------- */

@media (min-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: clamp(32px, 4vw, 64px);
  }

  .home-hero__art {
    align-self: center;
  }
}

/* Mobile: графика под формой ------------------------------------------- */

@media (max-width: 899px) {
  .home-hero__art {
    margin-top: var(--space-2);
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: clamp(14px, 3vw, 22px);
    padding-left: 0;
  }
}

@media (max-width: 389px) {
  .home-title {
    font-size: clamp(40px, 11.5vw, 46px);
  }

  .home-hero {
    gap: var(--space-4);
  }

  .home-form {
    gap: var(--space-3);
  }
}

@media (min-width: 1440px) {
  .home-hero__intro {
    padding-right: var(--space-4);
  }
}

/* T5a — экран «Результат»: схема матрицы и панель выбранной точки.
   Только transform/opacity в анимациях; без тяжёлых эффектов.
   Геометрия — плоский SVG 600x600. */

.matrix {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-bottom: 34px;
}

/* Заголовок ------------------------------------------------------------ */

.matrix__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 34px var(--gutter) 18px;
}

.matrix__head-main {
  min-width: 0;
}

.matrix__head .eyebrow {
  margin-bottom: 10px;
}

.matrix__note {
  max-width: 36ch;
  text-align: right;
}

/* Сетка «схема + панель» ----------------------------------------------- */

.matrix__layout {
  display: grid;
  grid-template-columns: minmax(480px, 2fr) minmax(300px, 1fr);
  margin: 0 var(--gutter) 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 560px;
}

.matrix__chart {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 25px;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 35px 35px;
  background-position: center;
}

.matrix__caption {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
}

.matrix-svg {
  width: 100%;
  max-width: 640px;
  height: auto;
  overflow: visible;
  touch-action: manipulation;
}

/* Линии схемы ---------------------------------------------------------- */

.matrix-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity var(--t-ui) var(--ease-ui);
}

/* E3: рёбра выбранного узла ярче, остальные приглушены. */
.matrix-line.is-dim {
  opacity: 0.35;
}

.matrix-line.is-linked {
  opacity: 1;
}

.matrix-line--diamond.is-linked,
.matrix-line--square.is-linked {
  stroke-width: 2.6;
}

.matrix-line--axis-a.is-linked,
.matrix-line--axis-b.is-linked {
  stroke-width: 4;
}

.matrix-line--spokes.is-linked {
  stroke-width: 3;
}

.matrix-line--diamond,
.matrix-line--square {
  stroke: var(--ink);
  stroke-width: 1.6;
}

.matrix-line--axis-a {
  stroke: var(--blue);
  stroke-width: 3;
}

.matrix-line--axis-b {
  stroke: var(--orange);
  stroke-width: 3;
}

.matrix-line--spokes {
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

/* До готовности GSAP схема скрыта, чтобы не мигал готовый кадр. */
.matrix-svg.is-preparing .matrix-lines,
.matrix-svg.is-preparing .matrix-nodes {
  opacity: 0;
}

/* Узлы ---------------------------------------------------------------- */

.matrix-node {
  cursor: pointer;
  outline: none;
}

.matrix-node__hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.matrix-node__base {
  fill: var(--bg-panel);
  stroke: var(--ink);
  stroke-width: 1.4;
}

.matrix-node__halo {
  fill: var(--blue);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-ui) var(--ease-ui);
}

.matrix-node__text {
  fill: var(--ink);
  font-weight: 700;
  font-size: 23px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.matrix-node--center .matrix-node__text {
  font-size: 28px;
}

.matrix-node:hover .matrix-node__base {
  stroke: var(--blue);
}

.matrix-node.is-active .matrix-node__halo,
.matrix-node[aria-pressed="true"] .matrix-node__halo,
.matrix-node:focus-visible .matrix-node__halo {
  opacity: 1;
}

.matrix-node.is-active .matrix-node__text,
.matrix-node[aria-pressed="true"] .matrix-node__text,
.matrix-node:focus-visible .matrix-node__text {
  fill: var(--white);
}

.matrix-node:focus-visible .matrix-node__base {
  stroke: var(--focus);
  stroke-width: 2.4;
}

/* Панель выбранной точки ---------------------------------------------- */

.matrix__inspector {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: clamp(20px, 3vw, 30px);
  border-left: 1px solid var(--line);
  background: var(--bg-panel);
}

.matrix__inspector > * {
  position: relative;
  z-index: 1;
}

.matrix__inspector::before {
  content: attr(data-watermark);
  position: absolute;
  right: -0.04em;
  bottom: -0.16em;
  z-index: 0;
  color: var(--watermark);
  font-size: clamp(140px, 18vw, 260px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.12em;
  line-height: 0.8;
  pointer-events: none;
  user-select: none;
}

.matrix__number {
  color: var(--blue);
  font-size: clamp(90px, 12vw, 165px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.09em;
  line-height: 0.82;
}

.matrix__arcana {
  font-size: 30px;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.matrix__point {
  color: var(--ink-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.matrix__derivation {
  max-width: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--green);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.matrix__stub {
  max-width: 40ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.matrix__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.matrix__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.matrix__swatch {
  display: block;
  width: 9px;
  height: 9px;
  flex: none;
}

.matrix__swatch--diamond {
  background: var(--ink);
}

.matrix__swatch--square {
  background: var(--bg);
  border: 1px solid var(--ink);
}

.matrix__swatch--a {
  background: var(--blue);
}

.matrix__swatch--b {
  background: var(--orange);
}

.matrix__swatch--diag {
  background: var(--green);
}

.matrix__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.matrix__replay {
  min-height: 48px;
}

.matrix__again {
  width: auto;
}

.matrix__version {
  margin-top: 2px;
}

/* Ошибка --------------------------------------------------------------- */

.matrix__error {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin: 0 var(--gutter) 34px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.matrix__error-title {
  font-size: var(--text-xl);
  font-weight: 800;
}

.matrix__error-text {
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: var(--text-base);
}

.matrix__error-link {
  min-width: 220px;
}

.matrix__noscript {
  margin: 0 var(--gutter) 24px;
}

.matrix__noscript a {
  border-bottom: 1px solid var(--ink);
  font-weight: 700;
}

/* Общая шапка на самых узких экранах: только на этой странице чуть
   уменьшаем навигацию, чтобы не было горизонтального переполнения. */
@media (max-width: 430px) {
  body:has(.matrix) .site-nav {
    gap: 8px;
  }

  body:has(.matrix) .site-nav a {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  body:has(.matrix) .site-nav {
    gap: 0;
  }
}

/* Мобильная раскладка: схема сверху на всю ширину --------------------- */

@media (max-width: 899px) {
  .matrix__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 24px;
  }

  .matrix__title {
    font-size: clamp(40px, 12vw, 48px);
  }

  .matrix__note {
    text-align: left;
  }

  .matrix__layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .matrix__chart {
    padding: 20px 3px 8px;
    min-height: 340px;
  }

  .matrix__inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 23px 0;
    gap: 10px;
  }

  .matrix__number {
    font-size: 95px;
  }

  .matrix__arcana {
    font-size: 27px;
  }

  .matrix__inspector::before {
    font-size: 150px;
  }

  .matrix__actions {
    gap: 10px;
  }

  .matrix__again {
    min-height: 48px;
  }
}

/* Без движения: подсветка меняется мгновенно -------------------------- */

@media (prefers-reduced-motion: reduce) {
  .matrix-node__halo {
    transition: none;
  }

  .matrix-line {
    transition: none;
  }
}

html[data-lite="1"] .matrix-node__halo {
  transition: none;
}

html[data-lite="1"] .matrix-line {
  transition: none;
}

/* T7a — экраны «Квадрат Пифагора» и «Нумерология по дате».
   Лендинги с формой одной даты и страницы результатов.
   Без анимаций и тяжёлых визуальных эффектов.
   Раскладка проверена на 360 / 390 / 768 / 1440 без переполнения. */

/* Общая рамка страницы ------------------------------------------------ */

.numbers {
  width: 100%;
  min-width: 0;
}

.numbers__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px 0 18px;
}

.numbers__head-main {
  min-width: 0;
}

.numbers__head .eyebrow {
  margin-bottom: 10px;
}

.numbers__title {
  max-width: 18ch;
  overflow-wrap: anywhere;
}

.numbers__note {
  max-width: 38ch;
  text-align: left;
}

/* Лендинг: форма ------------------------------------------------------- */

.numbers__intro {
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
  min-width: 0;
}

.numbers__lead {
  max-width: 62ch;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.45;
}

.numbers__form {
  display: grid;
  gap: var(--space-5);
  width: 100%;
  max-width: 640px;
  min-width: 0;
}

.numbers__form .field {
  max-width: none;
}

.numbers__error {
  min-height: 0;
  margin: 0;
  color: var(--orange);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}

.numbers__error:empty {
  display: none;
}

.numbers__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.numbers__submit .btn {
  min-width: min(100%, 300px);
}

.numbers__submit .note {
  max-width: 34ch;
}

.numbers__noscript {
  margin-top: var(--space-2);
}

.numbers__noscript a {
  border-bottom: 1px solid var(--ink);
  font-weight: 700;
}

/* SEO-текст ------------------------------------------------------------ */

.numbers-content {
  display: grid;
  gap: clamp(26px, 4vw, 44px);
  max-width: 76ch;
  margin-top: clamp(30px, 5vw, 56px);
  padding-block: clamp(26px, 4vw, 46px) 0;
  border-top: 1px solid var(--line);
}

.numbers-content__block {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.numbers-content h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.numbers-content p {
  max-width: 70ch;
  color: var(--ink-muted);
}

.numbers-list,
.numbers-links {
  display: grid;
  gap: 10px;
  padding-left: 1.2em;
  color: var(--ink-muted);
}

.numbers-list {
  list-style: square;
}

.numbers-links {
  list-style: none;
  padding-left: 0;
}

.numbers-links li {
  padding-block: 9px;
  border-top: 1px solid var(--line-soft);
}

.numbers-links li:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.numbers-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.numbers-links a:hover {
  color: var(--blue);
}

.numbers-faq {
  display: grid;
}

.numbers-faq details {
  padding-block: 12px;
  border-top: 1px solid var(--line-soft);
}

.numbers-faq details:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.numbers-faq summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}

.numbers-faq summary::marker {
  color: var(--blue);
}

.numbers-faq p {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

/* Ошибка результата --------------------------------------------------- */

.numbers__error-box {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-bottom: 34px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.numbers__error-title {
  font-size: var(--text-xl);
  font-weight: 800;
}

.numbers__error-text {
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.numbers__error-link {
  min-width: 220px;
}

/* Квадрат Пифагора: результат ----------------------------------------- */

.pyth {
  display: grid;
  gap: clamp(22px, 3.4vw, 34px);
  min-width: 0;
}

.pyth__board {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pyth__date {
  max-width: none;
}

.pyth__grid {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
}

.pyth__rowgroup {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pyth__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.pyth-cell {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: clamp(84px, 11vw, 128px);
  padding: 10px 4px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
}

.pyth-cell__digit {
  color: var(--ink);
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 1;
}

.pyth-cell__repeats {
  max-width: 100%;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.5vw, 15px);
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.pyth-cell--empty {
  background: var(--bg-field);
}

.pyth-cell--empty .pyth-cell__digit {
  color: var(--line);
}

.pyth-cell--empty .pyth-cell__repeats {
  color: var(--ink-muted);
}

.pyth__side {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pyth__subtitle {
  font-size: var(--text-xl);
}

.pyth__derivations {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.pyth__derivation {
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--green);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pyth__stub {
  max-width: 42ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.pyth__version {
  max-width: none;
}

.pyth__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.pyth__actions .btn {
  width: auto;
  min-height: 48px;
}

/* Нумерология: результат ---------------------------------------------- */

.num-result {
  display: grid;
  gap: clamp(20px, 3vw, 30px);
  min-width: 0;
}

.num-result__date {
  max-width: none;
}

.num-result__main,
.num-result__birthday {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: clamp(20px, 3vw, 30px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.num-result__main {
  background: var(--bg-panel);
  padding-inline: clamp(16px, 2.4vw, 26px);
}

.num-result__number {
  color: var(--blue);
  font-size: clamp(88px, 16vw, 190px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.09em;
  line-height: 0.82;
  overflow-wrap: anywhere;
}

.num-result__birthday-number {
  color: var(--ink);
  font-size: clamp(54px, 9vw, 96px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.num-result__chain {
  max-width: none;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--green);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.num-result__stub {
  max-width: 46ch;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.num-result__version {
  max-width: none;
}

.num-result__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.num-result__actions .btn {
  width: auto;
  min-height: 48px;
}

/* Планшет и десктоп ---------------------------------------------------- */

@media (min-width: 768px) {
  .numbers__head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-top: 34px;
  }

  .numbers__note {
    max-width: 36ch;
    text-align: right;
  }
}

@media (min-width: 900px) {
  .pyth {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    align-items: start;
    gap: clamp(28px, 3vw, 40px);
  }

  .pyth__side {
    padding-top: 0;
    padding-left: clamp(20px, 2.4vw, 30px);
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .num-result {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 34px);
  }

  .num-result__date,
  .num-result__stub,
  .num-result__version,
  .num-result__actions {
    grid-column: 1 / -1;
  }
}

/* Узкие экраны --------------------------------------------------------- */

@media (max-width: 899px) {
  .numbers__title {
    font-size: clamp(34px, 9.4vw, 46px);
    max-width: 16ch;
  }
}

@media (max-width: 389px) {
  .numbers__submit {
    gap: 10px;
  }

  .numbers__submit .btn {
    width: 100%;
    min-width: 0;
  }

  .pyth__grid {
    padding: 6px;
    gap: 6px;
  }

  .pyth__rowgroup,
  .pyth__row {
    gap: 6px;
  }

  .num-result__number {
    font-size: clamp(84px, 24vw, 96px);
  }
}

/* T12 — диагностический оверлей ?perf=1 (создаёт perf-guard.js).
   Стили перенесены из components.css, чтобы служебные слои жили рядом. */

.perf-overlay {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: var(--z-overlay);
  max-width: min(280px, 70vw);
  margin: 0;
  padding: 8px 10px;
  border-radius: 2px;
  background: rgba(32, 35, 38, 0.86);
  color: #eae9df;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre;
  pointer-events: none;
}

