/* SuperApp6 — временный лендинг. Бумага и комета: тёплый фон, чернила, один синий акцент. */

:root {
  --bg: #eae6de;
  --bg-lift: rgba(255, 255, 255, 0.28);
  --bg-lift-2: rgba(255, 255, 255, 0.5);
  --ink: #171612;
  --ink-2: #57534b;
  --ink-3: #8a857b;
  --line: rgba(23, 22, 18, 0.14);
  --line-2: rgba(23, 22, 18, 0.08);
  --brand: #4a7cd6;
  --brand-deep: #2f5fb8;

  --f-sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Cormorant", "Iowan Old Style", "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 72px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html.js body { opacity: 0; }
html.js.ready body { opacity: 1; transition: opacity 0.5s var(--ease); }

/* Бумажное зерно поверх всего — едва заметное */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1.1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip:focus { transform: none; }

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

/* ——— Свет под курсором: яркое ядро и отстающий синий хвост ——— */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.glow span {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
}
.glow-head {
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.22) 32%, rgba(255, 255, 255, 0) 62%);
}
.glow-tail {
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  background: radial-gradient(circle, rgba(74, 124, 214, 0.13) 0%, rgba(74, 124, 214, 0.05) 34%, rgba(74, 124, 214, 0) 64%);
}

main, .site-footer { position: relative; z-index: 1; }

/* ——— Шапка ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(234, 230, 222, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line-2);
}
.header-inner {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 4px;
  margin-left: -4px;
  border-radius: 12px;
}
.mark {
  height: 30px;
  width: auto;
  aspect-ratio: 228 / 306;
  fill: var(--brand);
  overflow: visible;
  transition: transform 0.8s var(--spring);
}
.mark-star {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.8s var(--spring);
}
.brand:hover .mark { transform: rotate(-8deg); }
.brand:hover .mark-star { transform: rotate(90deg) scale(1.35); }
.brand-name {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 6px;
}

/* Текст-«барабан»: при наведении строка уезжает вверх, снизу приходит такая же */
.roll {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  line-height: 1.25;
  height: 1.25em;
}
.roll-in {
  position: relative;
  display: inline-block;
  transition: transform 0.55s var(--ease);
}
.roll-in::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
  white-space: nowrap;
}
a:hover .roll-in, button:hover .roll-in { transform: translateY(-100%); }

/* Переключатель языка со скользящей плашкой */
.lang {
  position: relative;
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-lift);
}
.lang-pill {
  position: absolute;
  top: 4px;
  left: 0;
  height: 32px;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0;
}
.lang-btn {
  position: relative;
  z-index: 1;
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.35s var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--bg); }
.no-js .lang-btn[aria-pressed="true"] { background: var(--ink); }

/* ——— Кнопки ——— */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.mag-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { border: 1px solid var(--line); background: var(--bg-lift); color: var(--ink); }
.btn-ghost.is-hover { color: var(--bg); border-color: var(--ink); }

/* Заливка из точки входа курсора (создаётся скриптом) */
.fill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
}
.btn-primary .fill { background: var(--brand); }
.btn-ghost .fill { background: var(--ink); }

.btn-arrow {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2;
  width: 1ch;
}
.btn-arrow span {
  display: block;
  transition: transform 0.55s var(--ease);
}
.btn-arrow span + span { position: absolute; left: 0; top: -100%; }
.btn:hover .btn-arrow span { transform: translateY(100%); }

/* ——— Первый экран ——— */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(32px, 7vh, 88px)) var(--gutter) clamp(48px, 8vh, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(24px, 4vh, 36px);
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-lift);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.status-star {
  width: 13px;
  height: 15px;
  fill: var(--brand);
  animation: twinkle 3.2s var(--ease) infinite;
}
@keyframes twinkle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(90deg) scale(0.72); }
}

.hero-title {
  margin: 0;
  font-size: clamp(2.9rem, 6.6vw, 6.4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.hero-title em {
  font-size: 1.14em;
  line-height: 0.9;
  color: var(--brand);
  padding-right: 0.06em;
}

.hero-lead {
  margin: clamp(22px, 3.5vh, 32px) 0 0;
  max-width: 32em;
  font-size: clamp(1.05rem, 1.3vw, 1.22rem);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(28px, 5vh, 44px);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
}
/* Обёртка центрирует и поворачивает, сам знак двигает GSAP — так трансформации не конфликтуют */
.hero-comet-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.hero-comet-tilt {
  display: grid;
  place-items: center;
  width: min(74%, 360px);
  transform: rotate(-10deg);
}
.hero-comet {
  width: 100%;
  height: auto;
  aspect-ratio: 228 / 306;
  fill: var(--brand);
  opacity: 0.1;
}
.hero-comet-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 4.6s var(--ease) infinite;
}

/* ——— TextStream ——— */
.ts {
  --ts-fs-eff: var(--ts-fs, 2.25rem);
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: var(--ts-h, 400px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.ts-prefix {
  margin: 0;
  font-family: var(--f-mono);
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.45;
}
.ts-viewport {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  height: calc(var(--ts-fs-eff) * 2.2);
  overflow: hidden;
  text-align: center;
  cursor: grab;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 70%, transparent 100%);
}
.ts.is-dragging .ts-viewport { cursor: grabbing; }
.ts-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--ts-fs-eff);
  font-weight: var(--ts-fw, 700);
  line-height: 1.1;
  letter-spacing: -0.03em;
  will-change: transform;
}
.ts-copy { display: flex; flex-direction: column; }
.ts-item {
  padding: 6px 0;
  white-space: nowrap;
  color: rgba(23, 22, 18, 0.28);
  transition: color 0.5s var(--ease);
}
.ts-item.is-active { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .ts-viewport {
    display: flex;
    align-items: center;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    cursor: default;
  }
  .ts-track { position: relative !important; transform: none !important; }
  .ts-copy + .ts-copy { display: none !important; }
  .ts-item { color: var(--ink); }
}

/* ——— Секции ——— */
.inside, .contact {
  padding: clamp(96px, 13vw, 180px) 0 0;
  scroll-margin-top: 24px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(20px, 3vw, 32px);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.idx { color: var(--brand); }
.eyebrow-line {
  width: 44px;
  height: 1px;
  background: var(--line);
}

.h2 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2rem, 4.4vw, 3.9rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2 em { font-size: 1.1em; line-height: 0.9; }

/* ——— Чипы ——— */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: clamp(40px, 6vw, 72px);
  max-width: 1080px;
}
.chip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(46px, 4.6vw, 58px);
  padding: 0 clamp(18px, 1.8vw, 24px);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-lift);
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.chip .fill { background: var(--ink); }
.chip-label { position: relative; z-index: 1; white-space: nowrap; }
.chip-star {
  position: relative;
  z-index: 1;
  width: 0;
  height: 14px;
  fill: currentColor;
  overflow: visible;
  opacity: 0;
  transform: scale(0) rotate(-90deg);
  transition: width 0.5s var(--spring), opacity 0.3s var(--ease), transform 0.6s var(--spring);
}
.chip.is-hover { color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.chip[aria-pressed="true"] .fill { background: var(--brand-deep); }
.chip[aria-pressed="true"] .chip-star { width: 12px; opacity: 1; transform: none; }
.chip--more {
  border-style: dashed;
  background: transparent;
  color: var(--ink-2);
}
.no-fine .chip:active { transform: scale(0.96); }

.note {
  margin: clamp(28px, 4vw, 40px) 0 0;
  max-width: 44ch;
  font-size: 15px;
  color: var(--ink-2);
}

/* ——— Контакты ——— */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(48px, 7vw, 88px);
  align-items: start;
}
.label {
  margin: 0 0 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.mail {
  display: inline-block;
  font-size: clamp(1.9rem, 4.4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.mail-text {
  padding-bottom: 4px;
  background:
    linear-gradient(var(--ink), var(--ink)) right 100% / 0% 2px no-repeat,
    linear-gradient(var(--line), var(--line)) left 100% / 100% 2px no-repeat;
  transition: background-size 0.6s var(--ease), background-position 0s 0.6s;
}
.mail:hover .mail-text {
  background-position: left 100%, left 100%;
  background-size: 100% 2px, 100% 2px;
  transition: background-size 0.6s var(--ease);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  margin-top: 28px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-lift);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.copy-btn:hover { background: var(--bg-lift-2); border-color: rgba(23, 22, 18, 0.22); }
.copy-ico { position: relative; width: 18px; height: 18px; }
.copy-ico svg {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 0.3s var(--ease), transform 0.5s var(--spring);
}
.ico-check { opacity: 0; transform: scale(0.4) rotate(-30deg); stroke: var(--brand); }
.copy-btn.is-done .ico-copy { opacity: 0; transform: scale(0.4) rotate(30deg); }
.copy-btn.is-done .ico-check { opacity: 1; transform: none; }

.req-card {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.2);
}
.req-row {
  display: grid;
  grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 14px;
  border-radius: 16px;
  transition: background-color 0.35s var(--ease);
}
.req-row + .req-row { box-shadow: inset 0 1px 0 var(--line-2); }
.req-row:hover { background: var(--bg-lift-2); box-shadow: none; }
.req-row:hover + .req-row { box-shadow: none; }
.req-row dt {
  padding-top: 3px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.req-row dd { margin: 0; min-width: 0; }
.copyable {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
  cursor: copy;
  transition: color 0.3s var(--ease);
}
.copyable.mono {
  font-family: var(--f-mono);
  font-size: 15px;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}
.copyable:hover { color: var(--brand-deep); }
.req-hint {
  margin: 14px 0 0 4px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ——— Подвал ——— */
.site-footer {
  margin-top: clamp(110px, 14vw, 200px);
  overflow: hidden;
}
.wordmark {
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter);
  font-size: clamp(4.2rem, 19vw, 17.5rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(23, 22, 18, 0.2);
  user-select: none;
}
.wm-l {
  --f: 0;
  display: inline-block;
  color: rgb(23 22 18 / var(--f, 0));
  will-change: transform;
}
.footer-bar {
  max-width: var(--max);
  margin: clamp(24px, 3vw, 40px) auto 0;
  padding: 22px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 28px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.footer-bar p { margin: 0; }
.muted { color: var(--ink-2); }

/* ——— Всплывающее «Скопировано» ——— */
.toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 70;
  width: max-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14.5px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.toast svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #9fbcf0;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ——— Адаптив ——— */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    gap: 8px;
  }
  .hero-visual { min-height: 300px; }
  .ts { height: min(var(--ts-h, 400px), 300px); --ts-fs-eff: min(var(--ts-fs, 2.25rem), 7.4vw); }
  .hero-comet-tilt { width: min(56%, 240px); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }
  .site-header .nav-link { display: none; }
  .lang-btn { min-width: 40px; padding: 0 10px; font-size: 13px; }
  .btn { height: 50px; padding: 0 22px; font-size: 15px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .req-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
}

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