/* =========================================================
   «три» — брендбук. Компоненты.
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "ss01", "cv11";
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-variation-settings: "opsz" 14;
}

::selection { background: var(--brand); color: #fff; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* Тонкое зерно поверх — премиум-текстура */
.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* ---------- Типографика ---------- */

.t-eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-3);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.t-eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
}
.t-eyebrow--plain::before { display: none; }

.t-display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.94;
  color: var(--paper);
  font-variation-settings: "wdth" 92, "opsz" 32;
  margin: 0;
}
/* Контрольные точки для переноса в макеты (375 / 768 / 1440):
   xl 52 / 69 / 130 · lg 38 / 41 / 78 · md 27 / 27 / 48 · sm 21 / 21 / 30 */
.t-display-xl { font-size: clamp(52px, 9vw, 148px); letter-spacing: -0.05em; }
.t-display-lg { font-size: clamp(38px, 5.4vw, 82px); letter-spacing: -0.045em; }
.t-display-md { font-size: clamp(27px, 3.4vw, 48px); letter-spacing: -0.035em; }
.t-display-sm { font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -0.03em; }

.t-numeric {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.045em;
  font-feature-settings: "tnum" 1, "lnum" 1, "ss01" 1;
  font-variation-settings: "wdth" 90;
}
.t-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.t-lede {
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.5;
  color: var(--paper-2);
  font-weight: 400;
  letter-spacing: -0.012em;
}
.t-body { font-size: 16px; line-height: 1.7; color: var(--paper-2); letter-spacing: -0.005em; }
.t-body strong { color: var(--paper); font-weight: 600; }
.muted { color: var(--paper-3); }

/* ---------- Раскладка ---------- */

.edge { width: var(--edge); margin-inline: auto; }
.narrow { width: var(--narrow); margin-inline: auto; }

.section { padding-block: clamp(64px, 10vw, 140px); position: relative; }

.section-head { margin-bottom: clamp(40px, 6vw, 72px); max-width: 760px; }
.section-head .t-eyebrow { margin-bottom: 22px; }
.section-head .t-lede { margin-top: 22px; }

.sec-index {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--paper-3);
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 50%, transparent);
  border: 0;
  margin: 0;
}

/* ---------- Верхняя панель ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--ink-0) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.topbar .edge { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar__brand { display: flex; align-items: center; gap: 12px; }
.topbar__brand svg { height: 22px; width: auto; }
.topbar__brand .tag {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-3);
  padding-left: 14px;
  margin-left: 2px;
  border-left: 1px solid var(--line-strong);
}
.topbar__nav { display: flex; gap: 4px; }
.topbar__nav a {
  font-size: 13px;
  color: var(--paper-3);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.topbar__nav a:hover { color: var(--paper); background: rgba(255,255,255,0.04); }
@media (max-width: 1080px) { .topbar__nav { display: none; } }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease-out-expo), color 0.25s, box-shadow 0.25s, border-color 0.25s;
  white-space: nowrap;
}
.btn-primary { background: var(--paper); color: var(--ink-0); }
.btn-primary:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--paper); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; }

/* ---------- Обложка ---------- */

.cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding-top: 64px;
  overflow: hidden;
}
.cover__rays {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255,255,255,0.05), transparent 60%);
}
.cover__grid {
  position: absolute; inset: 0; z-index: 0; opacity: 0.5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 100% at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000 30%, transparent 78%);
}
.cover__inner { position: relative; z-index: 2; text-align: center; }
.cover__mark { width: clamp(92px, 13vw, 156px); margin: clamp(48px, 7vw, 88px) auto clamp(28px, 4vw, 44px); }
.cover__mark svg, .cover__mark img { width: 100%; height: auto; }
.cover__meta {
  margin-top: clamp(40px, 7vw, 72px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 36px;
  align-items: baseline;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--paper-3);
}
.cover__meta b { color: var(--paper); font-weight: 500; }
.scroll-hint {
  position: absolute; left: 0; right: 0; bottom: 28px;
  z-index: 2; font-family: var(--font-sans); font-weight: 600; font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--paper-3);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-hint span { text-indent: 0.18em; } /* компенсируем трейлинг letter-spacing, чтобы текст был по центру над линией */
.scroll-hint::after {
  content: ""; width: 1px; height: 34px;
  background: linear-gradient(var(--paper-4), transparent);
  animation: hintpulse 2.4s var(--ease-out-expo) infinite;
}
@keyframes hintpulse { 0%,100%{opacity:.2; transform:scaleY(.6);} 50%{opacity:1; transform:scaleY(1);} }

/* ---------- Общие карточки ---------- */

.panel {
  background: var(--ink-2);
  border-radius: var(--r-card);
  position: relative;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--paper-2); padding: 6px 13px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

/* ---------- Логотип ---------- */

.logo-stage {
  border-radius: var(--r-hero);
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(255,255,255,0.04), transparent 60%),
    var(--ink-2);
  display: grid;
  place-items: center;
  padding: clamp(48px, 9vw, 120px);
  position: relative;
  overflow: hidden;
}
.logo-stage__mark { width: clamp(160px, 26vw, 320px); }
.logo-stage__mark svg path { fill: var(--paper); }

.lockup-card { padding: 32px; display: flex; flex-direction: column; gap: 28px; min-height: 220px; }
.lockup-card .frame {
  flex: 1; display: grid; place-items: center;
  background: var(--ink-0);
  border-radius: var(--r-control);
  min-height: 130px;
  padding: 28px;
}
.lockup-card .frame svg { max-height: 68px; width: auto; }
.lockup-card .frame svg path { fill: var(--paper); }
.lockup-card--light .frame { background: var(--paper); }
.lockup-card--light .frame svg path { fill: var(--ink-0); }
.lockup-card__meta h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.lockup-card__meta p { margin: 0; font-size: 13px; color: var(--paper-3); line-height: 1.5; }
.lockup-card__meta .k { font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper-3); display: block; margin-bottom: 10px; }

/* ---------- Построение / охранное поле ---------- */

.construct { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; }
@media (max-width: 900px) { .construct { grid-template-columns: 1fr; } }
.construct__vis { padding: 40px; display: grid; place-items: center; min-height: 320px; }
.construct__vis svg { width: 100%; height: auto; max-width: 420px; }
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.spec-list li:last-child { border-bottom: 0; }
.spec-list .k { color: var(--paper-2); font-size: 14px; }
.spec-list .v { font-family: var(--font-sans); font-weight: 500; font-size: 13px; color: var(--paper); text-align: right; }

/* ---------- Ошибки использования ---------- */

.misuse-card { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.misuse-card .frame {
  aspect-ratio: 16/10; border-radius: var(--r-control); background: var(--ink-0);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.misuse-card .frame svg.demo { width: 96px; height: auto; }
.misuse-card .frame svg.demo path { fill: var(--paper); }
.misuse-card .badge {
  position: absolute; top: 12px; left: 12px;
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  font-size: 15px; font-weight: 600;
}
.misuse-card .badge.no { background: rgba(255,59,48,0.14); color: var(--heart); }
.misuse-card p { margin: 0; font-size: 13.5px; color: var(--paper-2); line-height: 1.5; }
.misuse-card p b { color: var(--paper); }

/* ---------- Цвет ---------- */

.swatch {
  border-radius: var(--r-card); overflow: hidden;
  background: var(--ink-2); cursor: pointer; transition: transform 0.25s var(--ease-out-expo);
}
.swatch:hover { transform: translateY(-3px); }
.swatch__chip { height: 132px; position: relative; }
.swatch__chip .copy {
  position: absolute; right: 12px; top: 12px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,0.35);
  color: #fff; opacity: 0; transition: opacity 0.2s;
}
.swatch:hover .copy { opacity: 1; }
.swatch__body { padding: 16px 18px 20px; }
.swatch__body h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.swatch__body .role { font-size: 12px; color: var(--paper-3); margin: 0 0 12px; line-height: 1.4; min-height: 2.8em; }
.swatch__body dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.swatch__body dt { font-family: var(--font-sans); font-weight: 600; font-size: 10px; letter-spacing: 0.06em; color: var(--paper-3); text-transform: uppercase; }
.swatch__body dd { margin: 0; font-family: var(--font-sans); font-size: 12px; color: var(--paper); text-align: right; }

.color-note { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; }
.color-note .dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 7px; flex: none; }

/* Цвет данных — санкционированное исключение (зоны, фазы сна, графики) */
.data-ladder { display: flex; border-radius: var(--r-chip); overflow: hidden; height: 46px; margin-bottom: 12px; }
.data-ladder span { flex: 1; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: rgba(0,0,0,0.55); }
.data-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.data-legend .it { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--paper-2); }
.data-legend .d { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.data-cols { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--paper-3); }

/* ---------- Типографика ---------- */

.type-specimen { padding: 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 26px; }
.type-specimen .glyphs {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 7vw, 108px);
  line-height: 1; letter-spacing: -0.04em; color: var(--paper); font-variation-settings: "wdth" 92;
  white-space: nowrap;
}
.type-specimen .meta-row {
  display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--paper-3);
}
.type-specimen .meta-row b { color: var(--paper); font-weight: 500; }
.type-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.type-row:last-child { border-bottom: 0; }
.type-row .sample { line-height: 1.15; }
.type-row .label { font-family: var(--font-sans); font-weight: 500; font-size: 12px; color: var(--paper-3); text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .type-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .type-row .label { text-align: left; white-space: normal; }
}

/* ---------- Иконки / знак устройства ---------- */

.device-icon-stage { padding: 48px; display: grid; place-items: center; }
.device-icon-stage svg { width: min(260px, 60%); }
.device-icon-stage svg path { fill: var(--paper); }

/* ---------- Продукт ---------- */

.product-hero { border-radius: var(--r-hero); overflow: hidden; position: relative; background: var(--ink-2); }
.product-hero img { width: 100%; height: 100%; object-fit: cover; }
.product-hero__cap {
  position: absolute; left: 22px; bottom: 20px; font-family: var(--font-sans);
  font-size: 12px; letter-spacing: 0.01em; color: var(--paper);
  background: rgba(0,0,0,0.5); padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(8px);
}
.product-tile { border-radius: var(--r-card); overflow: hidden; background: #fff; }
.product-tile.dark { background: var(--ink-2); }
.product-tile img { width: 100%; height: auto; }
.product-tile__cap { padding: 15px 18px; font-size: 13px; color: var(--paper-3); background: var(--ink-2); }

/* ---------- do / dont ---------- */

.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .dodont { grid-template-columns: 1fr; } }
.dd-col { padding: 26px 28px; border-radius: var(--r-card); background: var(--ink-2); }
.dd-col.do { background: linear-gradient(180deg, rgba(52,199,89,0.08), transparent 60%), var(--ink-2); }
.dd-col.dont { background: linear-gradient(180deg, rgba(255,59,48,0.07), transparent 60%), var(--ink-2); }
.dd-col h4 { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: 0.02em; }
.dd-col h4 .mk { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.dd-col.do .mk { background: rgba(52,199,89,0.16); color: var(--body); }
.dd-col.dont .mk { background: rgba(255,59,48,0.16); color: var(--heart); }
.dd-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.dd-col li { font-size: 14px; color: var(--paper-2); line-height: 1.5; padding-left: 18px; position: relative; }
.dd-col li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 999px; background: var(--paper-4); }
.dd-col.do li::before { background: var(--body); }
.dd-col.dont li::before { background: var(--heart); }

/* ---------- ИИ-иллюстрации ---------- */

.ill-card { border-radius: var(--r-card); overflow: hidden; background: var(--ink-2); position: relative; }
.ill-card .badge-x { position: absolute; top: 12px; left: 12px; z-index: 3; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 15px; font-weight: 600; background: var(--heart); color: #fff; }
.ill-card.reject .img { filter: grayscale(0.12); }
.ill-card .img { aspect-ratio: 16/10; background: var(--ink-0); overflow: hidden; position: relative; }
.ill-card .img img { width: 100%; height: 100%; object-fit: cover; }
.ill-card .img.placeholder { display: grid; place-items: center; color: var(--paper-4); font-size: 12px; letter-spacing: 0.06em; }
.ill-card__body { padding: 18px 20px; }
.ill-card__body h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.ill-card__body p { margin: 0; font-size: 13px; color: var(--paper-3); line-height: 1.5; }

.recipe { padding: 22px 24px; border-radius: var(--r-card); background: var(--ink-2); }
.recipe h4 { margin: 0 0 14px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.recipe h4 .n { font-size: 12px; font-weight: 600; color: var(--brand); }
.recipe pre {
  margin: 0; font-family: var(--font-sans); font-size: 13px; line-height: 1.6; color: var(--paper-2);
  white-space: pre-wrap; word-break: break-word;
}
.recipe .neg { color: var(--paper-3); }

/* ---------- Паттерны ---------- */

.pattern-tile { border-radius: var(--r-card); overflow: hidden; background: var(--ink-1); aspect-ratio: 1; position: relative; }
.pattern-tile svg { width: 100%; height: 100%; }
.pattern-tile__cap {
  position: absolute; left: 16px; bottom: 14px; font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-3);
}

/* ---------- Тон и голос ---------- */

.voice-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: var(--r-card); overflow: hidden; background: var(--ink-2); }
.voice-pair + .voice-pair { margin-top: 14px; }
.voice-pair > div { padding: 22px 24px; }
.voice-pair .good { background: rgba(52,199,89,0.07); }
.voice-pair .bad { background: rgba(255,59,48,0.05); }
.voice-pair .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; display: block; }
.voice-pair .good .k { color: var(--body); }
.voice-pair .bad .k { color: var(--heart); }
.voice-pair p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--paper); }
.voice-pair .bad p { color: var(--paper-2); text-decoration: line-through; text-decoration-color: rgba(255,59,48,0.7); }
@media (max-width: 640px) { .voice-pair { grid-template-columns: 1fr; } .voice-pair .bad { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Применение ---------- */

.app-card { padding: 26px; display: flex; flex-direction: column; gap: 20px; min-height: 240px; }
.app-card .vis { flex: 1; border-radius: var(--r-control); background: var(--ink-0); display: grid; place-items: center; overflow: hidden; padding: 24px; position: relative; }
.app-card h4 { margin: 0; font-size: 15px; font-weight: 600; }
.app-card p { margin: 6px 0 0; font-size: 13px; color: var(--paper-3); line-height: 1.5; }

.app-icon-tile { width: 108px; height: 108px; border-radius: var(--r-card); background: var(--ink-1); display: grid; place-items: center; color: var(--paper); }
.app-icon-tile svg { width: 54px; }
.app-icon-tile.inv { background: var(--paper); color: var(--ink-0); }

.social-avatar { width: 96px; height: 96px; border-radius: 999px; background: var(--ink-1); display: grid; place-items: center; color: var(--paper); }
.social-avatar svg { width: 46px; }
.social-avatar svg path { fill: var(--paper); }

/* ---------- Ресурсы ---------- */

.dl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 24px; border-radius: var(--r-control);
  background: var(--ink-2); transition: background 0.2s, transform 0.2s var(--ease-out-expo);
}
.dl-row:hover { background: var(--ink-3); transform: translateY(-2px); }
.dl-row .meta h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.dl-row .meta p { margin: 0; font-size: 13px; color: var(--paper-3); }
.dl-row .mono { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--paper-3); letter-spacing: 0.02em; }

/* ---------- Футер ---------- */

.foot { padding-block: 56px; }
.foot .edge { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.foot__mark svg { height: 26px; }
.foot__mark svg path { fill: var(--paper); }
.foot small { color: var(--paper-3); font-family: var(--font-sans); font-size: 12px; letter-spacing: 0.01em; }

/* ---------- Анимации появления ---------- */

.fx { opacity: 0; transform: translateY(26px); }
.fx.in { opacity: 1; transform: none; transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo); }
.fx-d1.in { transition-delay: 0.08s; }
.fx-d2.in { transition-delay: 0.16s; }
.fx-d3.in { transition-delay: 0.24s; }
.fx-d4.in { transition-delay: 0.32s; }

.draw path, .draw circle, .draw rect, .draw line, .draw polyline {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
}
.draw.in path, .draw.in circle, .draw.in rect, .draw.in line, .draw.in polyline {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s var(--ease-out-expo);
}

/* ---------- Индекс разделов (правый рельс) ---------- */

.railnav {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: 10px;
}
.railnav a { display: flex; align-items: center; gap: 10px; justify-content: flex-end; color: var(--paper-4); transition: color 0.2s; }
.railnav a .lbl {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; transform: translateX(6px); transition: opacity 0.2s, transform 0.2s; max-width: 0; overflow: hidden; white-space: nowrap;
}
.railnav a .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; transition: transform 0.2s; }
.railnav a:hover, .railnav a.active { color: var(--paper); }
.railnav a:hover .lbl, .railnav a.active .lbl { opacity: 1; transform: none; max-width: 160px; }
.railnav a.active .dot { transform: scale(1.6); background: var(--brand); }
@media (max-width: 1280px) { .railnav { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .fx { opacity: 1 !important; transform: none !important; }
  .draw path, .draw circle, .draw rect, .draw line, .draw polyline { stroke-dashoffset: 0 !important; }
  .scroll-hint::after { animation: none; }
  html { scroll-behavior: auto; }
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }

/* ---------- UI-примеры (цвет в интерфейсе) ---------- */

.ui-summary { padding: 28px; }
.ui-rings { display: flex; gap: 22px; justify-content: space-around; margin-bottom: 22px; }
.ui-ring { text-align: center; }
.ui-ring svg { width: 92px; height: 92px; display: block; margin: 0 auto 10px; }
.ui-ring .val { font-family: var(--font-display); font-weight: 500; font-size: 22px; }
.ui-ring .lbl { font-size: 12px; color: var(--paper-3); margin-top: 4px; }
.ui-ring .st { font-size: 11px; margin-top: 3px; font-weight: 500; }

/* Главная кнопка в приложении — белая (.label), не синяя.
   Радиус 18px = TRIRadius.button приложения (задокументированное значение UI-примеров). */
.ui-btn {
  display: flex; align-items: center; justify-content: center;
  height: 48px; border-radius: 18px; background: var(--paper); color: var(--ink-0);
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
/* Метрик-карточка — как MetricCardView: иконка на нейтральной плашке + число + дельта */
.ui-metric { padding: 16px 18px; border-radius: 18px; background: var(--ink-3); }
.ui-metric__head { display: flex; align-items: center; gap: 10px; }
.ui-ico { width: 32px; height: 32px; border-radius: var(--r-chip); background: rgba(255,255,255,0.08); display: grid; place-items: center; color: var(--paper); flex: none; }
.ui-ico svg { width: 17px; height: 17px; }
.ui-metric__title { font-size: 14px; font-weight: 600; }
.ui-metric__chev { margin-left: auto; color: var(--paper-3); display: flex; }
.ui-metric__chev svg { width: 14px; height: 14px; }
.ui-metric__val { font-family: var(--font-display); font-weight: 500; font-size: 28px; margin-top: 10px; display: flex; align-items: baseline; gap: 9px; letter-spacing: -0.03em; }
.ui-metric__val small { font-size: 13px; color: var(--paper-3); font-family: var(--font-sans); font-weight: 400; }
.ui-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; align-self: center; }
.ui-delta.up { background: rgba(255,255,255,0.12); color: var(--paper); }   /* лучше = монохром, «это норма» */
.ui-delta.down { background: rgba(255,59,48,0.16); color: var(--heart); }   /* хуже / риск = единственный цветной сигнал */
.ui-status { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--paper-2); }
.ui-status .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--paper); flex: none; } /* подключение — нейтральное, не цветное */
.ui-days { display: flex; gap: 6px; }
.ui-day { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--paper-3); background: var(--ink-3); }
.ui-day.on { background: var(--brand); color: #fff; font-weight: 600; } /* синий = выбранный/активный */
.ui-note { font-size: 12px; color: var(--paper-3); margin: 14px 2px 0; line-height: 1.5; }

/* ---------- Движение — демо ---------- */

.motion-card { padding: 26px; overflow: hidden; }
.motion-stage { height: 128px; display: grid; place-items: center; border-radius: var(--r-control); background: var(--ink-0); margin-bottom: 16px; position: relative; overflow: hidden; }
.motion-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.motion-card p { margin: 0; font-size: 13px; color: var(--paper-3); line-height: 1.5; }
.replay {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 600; color: var(--paper-2); background: rgba(255,255,255,0.08);
  border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: background 0.2s;
}
.replay:hover { background: rgba(255,255,255,0.16); }

.demo-reveal { font-family: var(--font-display); font-weight: 500; font-size: 34px; color: var(--paper); }
.demo-reveal.run { animation: demoReveal 0.7s var(--ease-out-expo); }
@keyframes demoReveal { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.demo-count { font-family: var(--font-display); font-weight: 500; font-size: 44px; color: var(--paper); font-variant-numeric: tabular-nums; }

.demo-draw svg { width: 80%; }
.demo-draw path { stroke-dasharray: 400; stroke-dashoffset: 400; }
.demo-draw.run path { animation: demoDraw 1.6s var(--ease-out-expo) forwards; }
@keyframes demoDraw { to { stroke-dashoffset: 0; } }

.demo-tap {
  width: 92px; height: 44px; border-radius: 999px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
}
.demo-tap:hover { transform: scale(1.06); }
.demo-tap:active { transform: scale(0.96); }

/* Заставка приложения: знак прорисовывается сверху вниз со светящейся кромкой,
   держит паузу, затем увеличивается и улетает. Повторяет логику TRISplashTransitionView. */
.demo-splash { position: relative; width: 96px; height: 96px; color: var(--paper); }
.demo-splash .mk { width: 100%; height: 100%; display: block; }
.demo-splash .edge { position: absolute; left: 6%; right: 6%; top: 0; height: 3px; border-radius: 3px; background: var(--paper); filter: blur(3px); opacity: 0; }
.demo-splash.run .mk { animation: splashSeq 3.2s var(--ease-out-expo) infinite; }
.demo-splash.run .edge { animation: splashEdge 3.2s var(--ease-out-expo) infinite; }
@keyframes splashSeq {
  0%   { clip-path: inset(0 0 100% 0); transform: scale(1); opacity: 1; }
  16%  { clip-path: inset(0 0 0 0);    transform: scale(1); opacity: 1; }
  58%  { clip-path: inset(0 0 0 0);    transform: scale(1); opacity: 1; }
  74%  { clip-path: inset(0 0 0 0);    transform: scale(1.32); opacity: 0; }
  75%  { clip-path: inset(0 0 100% 0); transform: scale(1); opacity: 0; }
  100% { clip-path: inset(0 0 100% 0); transform: scale(1); opacity: 0; }
}
@keyframes splashEdge {
  0%   { transform: translateY(0); opacity: 0; }
  1%   { opacity: 0.75; }
  16%  { transform: translateY(96px); opacity: 0.75; }
  19%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-splash.run .mk, .demo-splash.run .edge { animation: none; }
  .demo-splash .mk { clip-path: none; opacity: 1; }
}

/* ---------- Со-брендинг ---------- */

.cobrand-frame { display: grid; place-items: center; padding: 40px; border-radius: var(--r-control); background: var(--ink-0); min-height: 150px; }
/* Поле между брендами = высоте знака (40px) — как требует правило раздела */
.cobrand-lockup { display: flex; align-items: center; gap: 40px; }
.cobrand-lockup .x { width: 1px; height: 40px; background: var(--line-strong); }
.cobrand-lockup .mk svg { height: 40px; color: var(--paper); }
.cobrand-lockup .partner { font-size: 15px; color: var(--paper-3); font-weight: 500; letter-spacing: 0.02em; }
.attr-badge {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px;
  background: var(--ink-3); font-size: 13px; color: var(--paper-2);
}
.attr-badge svg { height: 15px; color: var(--paper); }

/* ---------- Соцсети ---------- */

.social-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
@media (max-width: 700px) { .social-grid { grid-template-columns: 1fr; } }
.story-frame {
  width: min(168px, 45vw); aspect-ratio: 9/16; border-radius: 20px; /* 20px — макет телефона, вне шкалы намеренно */
  background: var(--ink-0);
  position: relative; overflow: hidden; flex: none;
}
.story-frame .safe { position: absolute; inset: 11% 8%; border: 1px dashed var(--line-strong); border-radius: 10px; }
.story-frame .mk { position: absolute; top: calc(11% + 14px); left: 50%; transform: translateX(-50%); }
.story-frame .mk svg { height: 22px; color: var(--paper); }
.story-frame .cap { position: absolute; bottom: calc(11% + 12px); left: 0; right: 0; text-align: center; font-size: 10px; color: var(--paper-3); }
.avatar-demo { width: 72px; height: 72px; border-radius: 999px; background: var(--ink-0); display: grid; place-items: center; }
.avatar-demo svg { height: 32px; color: var(--paper); }
