/* ============================================================
   dan-ai — два пласта одной работы
   html[data-theme="systems"] — воронки, оплаты, данные. Акцент зелёный.
   html[data-theme="people"]  — партнёры, участники, команда. Акцент оранжевый.
   Структура страницы одна и та же, меняются содержание, акцент и фон.
   Новый пласт = ещё один блок html[data-theme="..."] с тем же набором переменных.
   ============================================================ */

:root,
html[data-theme='systems'] {
  --accent-orange: #5a7447;               /* акцент пласта (имя переменной — из основного сайта) */
  --accent-rgb: 90, 116, 71;
  --accent-deep: #3d5232;
  --orange-soft: rgba(90, 116, 71, 0.5);

  /* пятна первого экрана — шалфей и лён */
  --yellow: #e6e5cf;
  --peach: #dcdcc4;
  --mint: #c3d3bb;
  --cool-mint: #b2c7ad;

  --glow-mint: radial-gradient(circle at 50% 50%, rgba(176, 196, 168, 0.55) 0%, rgba(196, 210, 186, 0.26) 44%, rgba(196, 210, 186, 0) 72%);
  --glow-peach: radial-gradient(circle at 50% 50%, rgba(220, 220, 196, 0.5) 0%, rgba(228, 228, 208, 0.22) 46%, rgba(228, 228, 208, 0) 74%);
  --glow-orange: radial-gradient(circle at 50% 50%, rgba(90, 116, 71, 0.2) 0%, rgba(122, 146, 108, 0.1) 40%, rgba(196, 210, 186, 0) 72%);
  --glow-ember: radial-gradient(circle at 50% 50%, rgba(90, 116, 71, 0.24) 0%, rgba(176, 196, 168, 0.26) 38%, rgba(176, 196, 168, 0) 70%);

  --sys-layer: 1;
  --ppl-layer: 0;
}

html[data-theme='people'] {
  --accent-orange: #f28c28;
  --accent-rgb: 242, 140, 40;
  --accent-deep: #b8600f;
  --orange-soft: rgba(242, 140, 40, 0.5);

  --glow-orange: radial-gradient(circle at 50% 50%, rgba(242, 140, 40, 0.22) 0%, rgba(242, 140, 40, 0.1) 40%, rgba(243, 198, 165, 0) 72%);
  --glow-ember: radial-gradient(circle at 50% 50%, rgba(242, 140, 40, 0.28) 0%, rgba(243, 198, 165, 0.26) 38%, rgba(243, 198, 165, 0) 70%);

  --sys-layer: 0;
  --ppl-layer: 1;
}

/* ---------- тексты двух пластов ---------- */

html:not([data-theme='people']) .t-ppl,
html[data-theme='people'] .t-sys {
  display: none !important;
}

/* ---------- плавная смена пласта ---------- */

body,
.section__num::before,
.flow__dot,
.card::after,
.nav a::after,
.call__title,
.cut figcaption,
.wordmark {
  transition: color 0.8s ease, background-color 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
}

.bg,
.mode-layer,
.section::before,
.cut::before,
.hero__liquid {
  transition: opacity 0.32s ease;
}

.mode-switching .bg,
.mode-switching .mode-layer,
.mode-switching .section::before,
.mode-switching .cut::before,
.mode-switching .hero__liquid {
  opacity: 0 !important;
}

/* подсветки с зашитым оранжевым — через переменную пласта */
.section__num::before { box-shadow: 0 0 10px 2px rgba(var(--accent-rgb), 0.35); }

.note-card__ember {
  background: radial-gradient(circle at 50% 45%, rgba(255, 248, 220, 0.95) 0%, rgba(var(--accent-rgb), 0.7) 30%, rgba(var(--accent-rgb), 0.25) 55%, rgba(var(--accent-rgb), 0) 80%);
}

html[data-theme='systems'] .wordmark { color: #273024; }

/* ============================================================
   ШАПКА: dan ai × AI Mindset, навигация, переключатель
   ============================================================ */

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand__x {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
}

/* AI Mindset: оригинальный знак (как есть, тёмный квадрат) и название */
.brand__aim {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aim-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  transition: box-shadow 0.4s ease;
}

.aim-name {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.brand__aim:hover .aim-logo { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.6), 0 0 14px -2px rgba(var(--accent-rgb), 0.55); }
.brand__aim:hover .aim-name { color: var(--accent-deep); }

.header .nav { margin-left: auto; }

.mode {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-left: clamp(1rem, 2vw, 1.75rem);
  padding: 3px;
  border: 1px solid rgba(41, 41, 41, 0.18);
  border-radius: 999px;
  background: rgba(242, 237, 206, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  isolation: isolate;
}

/* активная половина: лёгкий оттенок цвета пласта и тонкая рамка, без заливки */
.mode__thumb {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: 0 0 18px -6px rgba(var(--accent-rgb), 0.55);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.8s ease, border-color 0.8s ease, box-shadow 0.8s ease;
}

html[data-theme='people'] .mode__thumb { transform: translateX(100%); }

.mode__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.42rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text);
  opacity: 0.5;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.6s ease, opacity 0.6s ease;
}

.mode__btn::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode__btn[aria-pressed='true'] { color: var(--accent-deep); opacity: 1; }

.mode__btn[aria-pressed='true']::before {
  transform: scale(1);
  background: var(--accent-orange);
  box-shadow: 0 0 8px 1px rgba(var(--accent-rgb), 0.6);
}

.mode__btn[aria-pressed='false']:hover { opacity: 0.85; }

.mode__btn:focus-visible {
  outline: 1px solid var(--accent-orange);
  outline-offset: 2px;
}

/* ============================================================
   HERO
   ============================================================ */

.hero { position: relative; }
.hero__group { position: relative; z-index: 1; }

.hero__role {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 2.3s backwards;
}

.hero__role a {
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.55);
  transition: color 0.3s ease;
}

.hero__role a:hover { color: var(--accent-deep); }

.hero__status {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent-orange);
  animation: rise 900ms cubic-bezier(0.22, 1, 0.36, 1) 2.6s backwards;
}

.hero__status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-orange);
  box-shadow: 0 0 10px 2px rgba(var(--accent-rgb), 0.45);
  animation: tag-blink 3.2s ease-in-out infinite;
}

/* «люди»: за знаком — тёплое полупрозрачное стекло, тянется за край экрана */
.hero__liquid {
  position: absolute;
  z-index: 0;
  left: 58%;
  top: 50%;
  width: 118vw;
  height: min(46vh, 30rem);
  rotate: -9deg;
  translate: -50% -50%;
  pointer-events: none;
  opacity: var(--ppl-layer);
}

.hero__liquid-glow {
  position: absolute;
  inset: 0 18%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 34% 50%, rgba(242, 140, 40, 0.18), rgba(242, 140, 40, 0) 62%),
    radial-gradient(ellipse at 68% 55%, rgba(243, 198, 165, 0.55), rgba(243, 198, 165, 0) 60%);
  filter: blur(50px);
}

.liquid--hero {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(255, 252, 240, 0.3), rgba(250, 232, 210, 0.12) 50%, rgba(243, 198, 165, 0.18));
  -webkit-backdrop-filter: blur(22px) saturate(1.1);
  backdrop-filter: blur(22px) saturate(1.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), inset 0 0 22px 2px rgba(243, 198, 165, 0.25);
  border-radius: 62% 38% 70% 30% / 58% 70% 30% 42%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 70%, transparent 100%);
  animation: fabric 40s ease-in-out infinite alternate;
}

@keyframes fabric {
  0%   { border-radius: 62% 38% 70% 30% / 58% 70% 30% 42%; }
  50%  { border-radius: 54% 46% 62% 38% / 66% 58% 42% 34%; }
  100% { border-radius: 68% 32% 60% 40% / 52% 64% 36% 48%; }
}

/* ============================================================
   ДЕКОРАТИВНЫЕ СЛОИ
   ============================================================ */

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

.mode-layer--sys { opacity: var(--sys-layer); }
.mode-layer--ppl { opacity: var(--ppl-layer); }

/* системы: тонкая сетка, к краям растворяется */
.mode-layer--sys::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(41, 41, 41, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 41, 41, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 80%);
}

.routes {
  position: absolute;
  top: 8vh;
  right: -6vw;
  width: min(46vw, 40rem);
  height: auto;
  opacity: 0.55;
}

.routes path {
  stroke: rgba(41, 41, 41, 0.22);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  animation: route 18s linear infinite;
}

.routes circle {
  fill: var(--cream);
  stroke: rgba(41, 41, 41, 0.35);
  stroke-width: 1;
}

.routes circle.on {
  fill: var(--accent-orange);
  stroke: var(--accent-orange);
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.6));
}

@keyframes route { to { stroke-dashoffset: -200; } }

/* люди: тёплые мягкие пятна света */
.warm {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: warm-drift 24s ease-in-out infinite alternate;
}

.warm--1 { width: 40vmax; height: 30vmax; top: -6vh; right: -8vw; background: rgba(243, 198, 165, 0.45); }
.warm--2 { width: 30vmax; height: 24vmax; top: 48vh; left: -10vw; background: rgba(242, 140, 40, 0.12); animation-duration: 30s; }
.warm--3 { width: 26vmax; height: 20vmax; top: 70vh; right: 12vw; background: rgba(243, 231, 180, 0.5); animation-duration: 27s; }

@keyframes warm-drift { to { transform: translate3d(3vw, 2vh, 0) scale(1.08); } }

/* ============================================================
   01 / ЧТО ДЕЛАЮ
   ============================================================ */

#what .flow {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  max-width: 46rem;
}

#what .cards { margin-top: clamp(2.5rem, 6vh, 3.5rem); }

.stability {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  max-width: 40rem;
  padding-left: 1.2rem;
  border-left: 1px solid rgba(var(--accent-rgb), 0.5);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--gray);
}

.stability__label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* ============================================================
   02 / ПРОДУКТЫ — обе стороны, впереди та, что у пласта
   ============================================================ */

.products {
  margin: clamp(2.5rem, 6vh, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.5rem clamp(1.5rem, 3vw, 2.5rem);
  align-items: baseline;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(41, 41, 41, 0.12);
}

.product__name {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

.product__url {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--gray);
}

.product__side {
  font-weight: 300;
  line-height: 1.5;
  transition: color 0.6s ease, font-size 0.6s ease, opacity 0.6s ease;
}

.product__tag {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* впереди — сторона текущего пласта: крупнее, в акценте; вторая — тише и справа */
html[data-theme='systems'] .product__side--sys,
html[data-theme='people'] .product__side--ppl {
  grid-column: 2;
  grid-row: 1;
  font-size: 1.05rem;
  color: var(--text);
}

html[data-theme='systems'] .product__side--ppl,
html[data-theme='people'] .product__side--sys {
  grid-column: 3;
  grid-row: 1;
  font-size: 0.88rem;
  color: var(--gray);
  opacity: 0.8;
}

html[data-theme='systems'] .product__side--sys .product__tag,
html[data-theme='people'] .product__side--ppl .product__tag {
  color: var(--accent-deep);
}

.product__side .product__tag { color: var(--gray); }

/* ============================================================
   03 / ЦИФРЫ
   ============================================================ */

.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
  margin: clamp(2.5rem, 6vh, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.number {
  padding-top: 1rem;
  border-top: 1px solid rgba(41, 41, 41, 0.14);
}

.number--big { grid-column: 1 / -1; border-top-color: rgba(var(--accent-rgb), 0.6); }
.number--wide { grid-column: span 1; }

.number__value {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.number--big .number__value {
  font-size: clamp(3.2rem, 9vw, 8rem);
  color: var(--accent-deep);
}

.number__text {
  margin-top: 0.7rem;
  max-width: 28ch;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.5;
  color: var(--gray);
}

/* ============================================================
   04 / КЕЙС
   ============================================================ */

.story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: end;
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
}

.story__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
}

.story__tag--now { color: var(--accent-deep); }

.story__text {
  margin-top: 0.7rem;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.story__text--was { color: var(--gray); }

.story__arrow {
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  color: var(--accent-orange);
}

#case .flow {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  max-width: 40rem;
}

/* ============================================================
   05 / AI MINDSET
   ============================================================ */

.aim__line { max-width: 24ch; }

.aim__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-top: clamp(2rem, 5vh, 3rem);
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 300;
  color: var(--text);
}

.aim__word {
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.55);
  transition: border-color 0.4s ease;
}

.aim__cta:hover .aim__word { border-bottom-color: var(--accent-orange); }

.aim__cta .call__arrow {
  width: 0.7em;
  color: var(--accent-orange);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.aim__cta:hover .call__arrow { transform: translateX(6px); }

/* ============================================================
   07 / CONTACT — три входа в один созвон
   ============================================================ */

#contact {
  grid-template-areas:
    'num cut'
    'lead cut'
    'body cut'
    'entries cut'
    'links cut';
}

.entries {
  grid-area: entries;
  display: grid;
  gap: 0.6rem;
  margin-top: clamp(2rem, 5vh, 3rem);
}

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1.5rem;
  align-items: center;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(41, 41, 41, 0.14);
  border-radius: 14px;
  background: rgba(250, 246, 226, 0.4);
  transition: border-color 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.entry:hover {
  transform: translateX(4px);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 30px -12px rgba(var(--accent-rgb), 0.5);
}

.entry__title { font-size: clamp(1.1rem, 1.6vw, 1.35rem); }

.entry__hint {
  grid-column: 1;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--gray);
}

.entry__arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 18px;
  color: var(--accent-orange);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.entry:hover .entry__arrow { transform: translateX(5px); }

/* в пласте «люди» вход для партнёров — выделен */
html[data-theme='people'] .entry:nth-child(3) {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.06);
}

html[data-theme='systems'] .entry:nth-child(2) {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.05);
}

/* ============================================================
   ТЕЛЕФОН
   ============================================================ */

@media (max-width: 900px) {
  .brand { gap: 0.45rem; }
  .brand__x { font-size: 0.7rem; }
  .aim-logo { width: 22px; height: 22px; border-radius: 5px; }
  .aim-name { display: none; }   /* на узком экране — только знак */

  .mode { margin-left: auto; margin-right: 0.9rem; }

  .product { grid-template-columns: 1fr; }

  html[data-theme] .product__side--sys,
  html[data-theme] .product__side--ppl {
    grid-column: 1;
    grid-row: auto;
  }

  html[data-theme='people'] .product__side--ppl,
  html[data-theme='systems'] .product__side--sys { order: -1; }

  .product__name { order: -2; }

  .numbers { grid-template-columns: 1fr 1fr; }
  .number--wide { grid-column: 1 / -1; }

  .story { grid-template-columns: 1fr; }
  .story__arrow { transform: rotate(90deg); justify-self: start; }

  #contact {
    grid-template-areas: 'num' 'lead' 'body' 'entries' 'links' 'cut';
  }

  .routes { width: 80vw; right: -30vw; opacity: 0.35; }

  /* цепочки на телефоне переносятся, а не уезжают за край */
  #what .flow,
  #case .flow {
    flex-wrap: wrap;
    row-gap: 0.7rem;
  }

  #what .flow__link,
  #case .flow__link {
    flex: 0 0 1.4rem;
  }

  .hero__liquid { width: 150vw; height: 34vh; left: 50%; top: 36%; }
  .liquid--hero { animation: none; }
  .warm { animation: none; filter: blur(44px); }
}

@media (max-width: 640px) {
  .mode { padding: 2px; margin-right: 0.7rem; }
  .mode__thumb { top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); }

  .mode__btn {
    gap: 0.35em;
    padding: 0.36rem 0.55rem;
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }

  .numbers { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .routes path,
  .liquid--hero,
  .warm,
  .hero__status::before {
    animation: none;
  }

  .mode__thumb { transition: none; }
}

/* ссылки внутри композиции наследуют цвет текста, без синего подчёркивания браузера */
.entry,
.hero__role a,
.brand__aim,
.aim__cta {
  color: inherit;
  text-decoration: none;
}

/* штрих карточки растёт в линию: общая плавность цвета выше не должна сбивать рост ширины */
.card::after {
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.8s ease;
}

/* В Neue Machina у заглавной «Й» кратка съезжает на соседнюю букву, и в шапке
   читается «КЕИС». Только эти две буквы берём из Onest (он уже есть для кириллицы). */
@font-face {
  font-family: 'Neue Machina';
  src: url('fonts/Onest-cyr-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0419, U+0439;
  /* метрики как у Neue Machina, чтобы пункт с «й» не проседал ниже соседних */
  ascent-override: 75%;
  descent-override: 22%;
  line-gap-override: 0%;
}
