/* mikhtech — tokens из дизайн-системы v1.0 */
:root {
  --paper: #F6F7F9;
  --white: #FFFFFF;
  --night: #0B1A3A;
  --night-raised: #12244D;
  --ink: #0E1116;
  --ink-muted: #5B6475;
  --line: #DDE2EA;
  --brand: #2F5BFF;
  --brand-strong: #1E3A8A;
  --brand-soft: #E1E8FF;
  --sky: #7C97FF;

  /* темы секций */
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-muted: var(--ink-muted);
  --accent: var(--brand);
  --card: var(--white);
  --rule: var(--line);

  /* цвета знака (светлый фон) */
  --m1: #1E3A8A; --m2: #2546C8; --m3: #2F5BFF; --m4: #5677FF; --m5: #7C97FF; --me: #E1E8FF;

  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;
  --shadow-card: 0 1px 2px rgba(14,17,22,.08), 0 4px 16px rgba(14,17,22,.06);

  /* кривая движения в духе Apple: быстрый старт, мягкое торможение */
  --ease: cubic-bezier(.28, .11, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --nav-h: 56px;
  --gutter: clamp(20px, 5vw, 64px);
}

.on-dark {
  --bg: var(--night);
  --fg: #F2F5FF;
  --fg-muted: #A5B8FF;
  --accent: var(--sky);
  --card: var(--night-raised);
  --rule: #24376A;
  --m1: #FFFFFF; --m2: #E1E8FF; --m3: #BFD0FF; --m4: #A5B8FF; --m5: #7C97FF; --me: #1A2B55;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 16px/26px var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
section[id], #contacts { scroll-margin-top: calc(var(--nav-h) + 24px); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--r-md);
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.wrap { width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto; }

/* ---------- типографика ---------- */
.eyebrow {
  font: 500 13px/20px var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-title {
  font-weight: 700;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.07;
  letter-spacing: -.025em;
  max-width: 16em;
  margin-top: 16px;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px;
  border-radius: var(--r-md);
  font: 500 16px/1 var(--font-sans);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn--sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: #2546C8; }
.btn--primary:active { transform: scale(.97); }
.btn--secondary { color: var(--fg); border-color: var(--accent); }
.btn--secondary:hover { background: rgba(124,151,255,.14); }
.btn--secondary:active { transform: scale(.97); }
.btn--ghost { color: var(--fg-muted); padding-inline: 0; margin-left: 8px; }
.btn--ghost:hover { color: #fff; }

/* ---------- логотип ---------- */
.logo { display: inline-flex; align-items: center; gap: 14px; }
.logo__mark { width: 28px; height: 28px; flex: none; }
.logo__word { font-weight: 700; font-size: 22px; letter-spacing: -.03em; line-height: 1; padding-bottom: 2px; }
.logo__word span { color: var(--accent); }

/* ---------- навигация (полупрозрачная, как у Apple) ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(11, 26, 58, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background-color .4s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--rule); background: rgba(11, 26, 58, .82); }
.nav__in {
  height: 100%; width: min(1200px, 100% - var(--gutter) * 2); margin-inline: auto;
  display: flex; align-items: center; gap: 32px;
}
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 14px; }
.nav__links a { color: var(--fg-muted); transition: color .3s var(--ease); }
.nav__links a:hover { color: #fff; }
.nav .btn { flex: none; }

/* ---------- HERO ---------- */
.hero { position: relative; background: var(--bg); color: var(--fg); overflow: hidden; }
.hero__stage {
  min-height: 100vh; min-height: 100svh;
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 48px;
  padding: calc(var(--nav-h) + 48px) var(--gutter) 96px;
  max-width: 1328px; margin-inline: auto;
}
.hero__copy { grid-area: 1 / 1; }
.hero__title {
  margin: 20px 0 20px;
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 76px);
  line-height: 1.04;
  letter-spacing: -.03em;
  max-width: 11.5em;
}
.hero__lead { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: var(--fg-muted); max-width: 30em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__mark {
  grid-area: 1 / 2;
  width: min(100%, 440px); justify-self: end;
}
.hero__mark svg { display: block; width: 100%; height: auto; overflow: visible; }
.hero__mark rect {
  transform-box: fill-box; transform-origin: center;
  opacity: 0; transform: scale(.3);
  animation: pop .6s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}
.hero__mark .p1 { fill: var(--m1); } .hero__mark .p2 { fill: var(--m2); }
.hero__mark .p3 { fill: var(--m3); } .hero__mark .p4 { fill: var(--m4); }
.hero__mark .p5 { fill: var(--m5); } .hero__mark .pe { fill: var(--me); }
@keyframes pop { to { opacity: 1; transform: none; } }

.hero__hint {
  position: absolute; left: 50%; bottom: 28px; width: 22px; height: 36px; margin-left: -11px;
  border: 1.5px solid var(--rule); border-radius: 12px;
  transition: opacity .4s var(--ease);
}
.hero__hint.is-hidden { opacity: 0; }
.hero__hint span {
  position: absolute; left: 50%; top: 7px; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--accent); border-radius: 2px;
  animation: hint 2s var(--ease) infinite;
}
@keyframes hint { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(12px); opacity: 0; } }

/* intro-анимация текста hero */
[data-intro] { opacity: 0; transform: translateY(16px); animation: rise .6s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- STATEMENT (слова проявляются по очереди) ---------- */
.statement { background: var(--paper); color: var(--ink); padding: clamp(96px, 14vw, 180px) 0; }
.statement__title {
  margin-top: 20px;
  font-weight: 700;
  font-size: clamp(38px, 6.6vw, 92px);
  line-height: 1.04;
  letter-spacing: -.035em;
  max-width: 11.5em;
}
.statement__title[data-reveal] { opacity: 1; transform: none; transition: none; }
.statement__title .w { display: inline-block; opacity: .16; transition: opacity .5s var(--ease) var(--d, 0s); }
.statement__title.is-in .w { opacity: 1; }
.statement__text {
  margin-top: 32px; max-width: 38em;
  font-size: clamp(17px, 1.7vw, 22px); line-height: 1.5; color: var(--ink-muted);
}

/* ---------- SERVICES (три этапа списком) ---------- */
.services { background: var(--bg); color: var(--fg); padding: clamp(96px, 14vw, 180px) 0; }
.svc-list { margin-top: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--rule); }
.svc {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start;
  padding: 40px 0; border-top: 1px solid var(--rule);
}
.svc__icon {
  width: 96px; height: 96px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg);
}
.svc__icon svg { width: 40px; height: 40px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.step__num { font: 500 13px/20px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); }
.svc__title { margin-top: 8px; font-weight: 700; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.03em; }
.svc__text { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--fg-muted); padding-top: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li {
  font: 500 13px/20px var(--font-mono);
  padding: 4px 12px; border-radius: var(--r-sm);
  background: #1A2B55; color: #BFD0FF;
}

/* ---------- APPROACH ---------- */
.approach { background: var(--paper); color: var(--ink); padding: clamp(96px, 14vw, 180px) 0; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(48px, 7vw, 96px); }
.card {
  background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 32px 32px 40px;
  min-height: 280px;
  display: flex; flex-direction: column;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.card h3 { font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.card p:last-child { margin-top: 12px; color: var(--ink-muted); }
.card__num { font: 500 13px/20px var(--font-mono); color: var(--brand); letter-spacing: .06em; margin-bottom: 40px; }
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 2px 4px rgba(14,17,22,.08), 0 16px 40px rgba(14,17,22,.1); }
}

/* ---------- CONTACT ---------- */
.contact { background: var(--bg); color: var(--fg); padding-bottom: clamp(96px, 14vw, 180px); overflow: hidden; }
.band { width: 100%; padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 9vw, 120px); }
.band canvas { display: block; width: 112%; margin-left: -6%; aspect-ratio: 37.25 / 7.25; }
.contact__title { margin-top: 16px; font-weight: 700; font-size: clamp(44px, 8vw, 120px); line-height: 1; letter-spacing: -.04em; }
.contact__text { margin-top: 28px; max-width: 28em; font-size: clamp(18px, 1.9vw, 26px); line-height: 1.4; color: var(--fg-muted); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 40px; }
.contact__links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.clink {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 4px 12px;
  min-height: 176px; padding: 24px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg);
  transition: transform .5s var(--ease), background-color .4s var(--ease), border-color .4s var(--ease);
}
.clink__icon { grid-column: 1 / -1; width: 28px; height: 28px; margin-bottom: auto; padding-bottom: 0; fill: none; stroke: var(--sky); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.clink__label { grid-column: 1; margin-top: 28px; font: 500 13px/20px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-muted); }
.clink__value { grid-column: 1; font-weight: 700; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.clink__arrow { grid-column: 2; grid-row: 2 / 4; align-self: end; font-size: 22px; transition: transform .4s var(--ease); }
.clink:hover { border-color: var(--sky); transform: translateY(-4px); }
.clink:hover .clink__arrow { transform: translateX(6px); }
.clink:active { transform: scale(.98); }
.clink--primary { background: var(--brand); border-color: var(--brand); }
.clink--primary:hover { background: #2546C8; border-color: #2546C8; }
.clink--primary .clink__icon { stroke: #fff; }
.clink--primary .clink__label { color: #DCE4FF; }
@media (max-width: 900px) { .contact__links { grid-template-columns: 1fr; } .clink { min-height: 0; } .clink__label { margin-top: 20px; } }
.mono-link { font: 500 16px/1 var(--font-mono); color: var(--sky); border-bottom: 1px solid transparent; padding-bottom: 4px; transition: border-color .3s var(--ease); }
.mono-link:hover { border-bottom-color: var(--sky); }

/* ---------- FOOTER ---------- */
.footer { background: var(--bg); color: var(--fg); border-top: 1px solid var(--rule); padding: 28px 0; }
.footer__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.footer__links a { color: var(--fg-muted); transition: color .3s var(--ease); }
.footer__links a:hover { color: #fff; }
.footer__copy { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.footer__meta { font: 500 13px/20px var(--font-mono); color: var(--fg-muted); }

/* ---------- scroll-reveal ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s var(--ease) var(--d, 0s), transform .6s var(--ease-out) var(--d, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- адаптив ---------- */
@media (max-width: 900px) {
  .hero__stage { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; gap: 28px; }
  .hero__mark { grid-area: 1 / 1; width: min(46vw, 200px); justify-self: start; transform-origin: left center; }
  .hero__copy { grid-area: 2 / 1; }
  .svc { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 20px; padding: 32px 0; }
  .svc__icon { width: 64px; height: 64px; border-radius: var(--r-md); }
  .svc__icon svg { width: 28px; height: 28px; }
  .svc__body { grid-column: 2; }
  .svc__text { padding-top: 4px; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card__num { margin-bottom: 28px; }
}
@media (max-width: 640px) {
  .band canvas { width: 220%; margin-left: -60%; }
  .btn--ghost { margin-left: 0; width: 100%; justify-content: flex-start; }
  .nav__links { display: none; }
  .nav__in { justify-content: space-between; }
  .svc { grid-template-columns: 1fr; }
  .svc__body { grid-column: 1; }
}

/* ---------- reduce motion: всё статично и читаемо ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__hint { display: none; }
  .hero__mark rect, [data-intro] { animation: none; opacity: 1; transform: none; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .statement__title .w { opacity: 1; transition: none; }
}
