/* reactortech.ru — главная v7. Макет Figma «Frame 1948756444» (1280), анимации по мотивам america.gov.
   Шрифты: Source Serif 4 (заголовки, авто-opsz как в Figma) + Geist (текст). Всё в px макета, на узких экранах масштабируется. */

@font-face { font-family: 'Source Serif 4'; src: url('/assets/fonts/source-serif-4-cyrillic-opsz.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Source Serif 4'; src: url('/assets/fonts/source-serif-4-latin-opsz.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-cyrillic-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist-latin-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #000;
  --muted: #838383;
  --panel: #ebebeb;
  --tile: #f7f7f7;
  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: #fff; color: var(--ink); font: 400 16px/24px var(--sans); letter-spacing: -0.04em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { display: block; }
ul { list-style: none; }

.page { max-width: 1280px; margin: 0 auto; }
.top-note { height: 72px; padding-top: 28px; text-align: center; font-size: 12px; line-height: 16px; letter-spacing: -0.02em; color: var(--muted); }

/* ------------------------------------------------------------ hero */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; width: min(1184px, calc(100% - 96px)); margin: 0 auto; padding: 40px 0 64px; background: var(--panel); border-radius: 48px; text-align: center; animation: hero-in 0.85s ease-out both; }
@keyframes hero-in { from { opacity: 0; } to { opacity: 1; } }
.hero-logo img { width: 96px; height: 24px; }
.hero h1 { margin-top: 82px; font: 500 clamp(40px, 6.4vw, 82px) / 0.78 var(--serif); letter-spacing: -0.06em; }
.hero-sub { margin-top: 21px; max-width: 90%; color: var(--muted); }
.hero-video { position: relative; width: min(825px, calc(100% - 48px)); aspect-ratio: 16 / 9; margin-top: 97px; border-radius: clamp(24px, 3.75vw, 48px); }
.hero-video .hv { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; isolation: isolate; transform: translateZ(0); background: #f5f5f5 url('/assets/media/showreel-poster.jpg') center / cover no-repeat; }
.hero-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: transparent; }
/* ambient light: размытое пятно цвета текущей сцены под рамкой; цвет приходит из home.js */
.hero-video .glow { position: absolute; z-index: 0; left: -3%; top: 8%; width: 106%; height: 100%; border-radius: 45%; background: var(--glow, #b4cdf3); filter: blur(52px) saturate(1.4); opacity: 0.6; transition: background-color 0.9s ease; pointer-events: none; }
.clients-note { margin-top: 44px; font-size: 13px; line-height: 16px; color: var(--muted); }
.clients { width: min(825px, calc(100% - 48px)); margin-top: 20px; height: 32px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.clients-track { display: flex; align-items: center; gap: 48px; width: max-content; height: 100%; padding-right: 48px; animation: marquee 34s linear infinite; }
.clients:hover .clients-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cl { display: flex; flex: none; align-items: center; gap: 8px; font: 600 17px/1 var(--sans); letter-spacing: -0.03em; transition: opacity 0.5s var(--ease) 60ms, transform 0.5s var(--ease) 60ms; }
.cl img { width: auto; max-width: none; }
.clients-track:hover .cl { opacity: 0.35; }
.clients-track .cl:hover { opacity: 1; transform: translateY(-2px) scale(1.08); }

/* ------------------------------------------------------------ manifesto */
.manifesto-wrap { margin-top: 120px; padding: 0 24px; }
.manifesto { display: flex; flex-direction: column; align-items: center; gap: 36px; font: 500 clamp(26px, 5vw, 64px) / 1 var(--serif); letter-spacing: -0.06em; text-align: center; }
.mp { display: flex; flex-direction: column; align-items: center; }
.ln { display: block; height: 1em; white-space: nowrap; }
.st { display: inline-block; vertical-align: middle; position: relative; top: 0.03em; width: calc(var(--w) / 64 * 1em); height: calc(var(--h) / 64 * 1em); margin: -0.25em -0.01em -0.25em 0.1em; }
.st img { width: 100%; height: 100%; transform: rotate(var(--r)); user-select: none; }
.st-claude { margin-left: -0.02em; margin-right: -0.04em; }
.avs { display: inline-flex; vertical-align: middle; position: relative; top: 0.03em; margin: -0.25em 0.05em -0.25em 0; }
.avs img { width: calc(58 / 64 * 1em); height: calc(58 / 64 * 1em); border-radius: 50%; object-fit: cover; border: 0.04em solid #fff; background: #d9d9d9; }
.avs img + img { margin-left: -0.15em; }

/* ------------------------------------------------------------ features */
.features { display: flex; flex-direction: column; align-items: center; gap: 120px; margin-top: 108px; }
.feature { display: flex; align-items: center; justify-content: center; gap: 112px; width: 100%; padding: 0 24px; }
.tile { position: relative; flex: none; width: 360px; height: 360px; border-radius: 48px; overflow: hidden; isolation: isolate; background: var(--tile); }
.ftext { width: 320px; flex: none; }
.ftext h2 { font: 500 32px / 36px var(--sans); letter-spacing: -0.05em; margin-bottom: 20px; text-wrap: balance; }
.ftext p { color: var(--muted); text-wrap: pretty; }
.tile-orbit { background: #000; }
.tile-crab { background: #ffe8d8; }
.tile-gh::after, .tile-ball::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.045); pointer-events: none; z-index: 5; }

/* 1 · сфера из картинок (по мотивам federal-orbit на america.gov) */
.orbit { position: absolute; inset: 0; }
.orbit img { position: absolute; left: 0; top: 0; width: 23%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; transform-origin: 50% 50%; will-change: transform, opacity; user-select: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }

/* 2 · GitHub-плитка */
.gh { position: absolute; left: 59px; top: 71px; width: 479px; height: 218px; }
.gh-card { position: relative; width: 100%; height: 100%; background: #fff; border-radius: 28px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.035), 0 1px 2px rgba(0, 0, 0, 0.05), 0 18px 40px -12px rgba(0, 0, 0, 0.16); font: 400 15px / 18px var(--sans); letter-spacing: -0.02em; }
.gh-m { position: absolute; top: 24px; left: calc(100px + var(--c) * 20px); font-weight: 500; color: #3b4048; }
.gh-d { position: absolute; left: 30px; top: calc(57px + var(--r) * 20px); color: #8b95a1; }
.gh-c { position: absolute; left: calc(100px + var(--c) * 20px); top: calc(58px + var(--r) * 20px); width: 16px; height: 16px; border-radius: 4.5px; background: #f0f0f0; transition: background-color 0.45s ease; animation: gh-wave 6.5s ease-in-out infinite; animation-delay: calc(var(--c) * 0.11s + var(--r) * 0.025s); }
.gh-c[data-l='1'] { background: #c6e48b; }
.gh-c[data-l='2'] { background: #7bc96f; }
.gh-c[data-l='3'] { background: #239a3b; }
.gh-c[data-l='4'] { background: #196127; }
@keyframes gh-wave { 0%, 14%, 100% { transform: scale(1); } 7% { transform: scale(1.22); } }

/* 3 · пиксельный краб */
.crab-wrap { position: absolute; left: 97px; top: 118px; }
.crab { width: 165px; height: auto; overflow: visible; }
.crab-hand-l { animation: tap-l 0.7s steps(1, end) infinite; }
.crab-hand-r { animation: tap-r 0.9s steps(1, end) infinite -0.2s; }
@keyframes tap-l { 0% { transform: translateY(0); } 34% { transform: translateY(1px); } 68% { transform: translateY(0); } }
@keyframes tap-r { 0% { transform: translateY(0); } 25% { transform: translateY(-1px); } 55% { transform: translateY(0); } 80% { transform: translateY(-1px); } }
.crab-eye { transform-box: fill-box; transform-origin: center; animation: look 7.5s steps(1, end) infinite, blink 5.2s steps(1, end) infinite; }
@keyframes look { 0% { translate: 0 0; } 20% { translate: 1px 0; } 42% { translate: 0 0; } 60% { translate: -1px 0; } 80% { translate: 0 1px; } }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(0.12); } }
.crab-screen .d { opacity: 0; animation: typing 3.4s steps(1, end) infinite; animation-delay: calc(var(--i) * 0.22s); }
@keyframes typing { 0% { opacity: 0; } 1% { opacity: 1; } 88% { opacity: 1; } 92%, 100% { opacity: 0; } }

/* 4 · чёрный значок: статичный, при наведении чуть крупнее */
.ball-wrap { position: absolute; left: 116px; top: 116px; width: 128px; height: 128px; }
.ball { width: 128px; height: 128px; border-radius: 50%; background: #000; box-shadow: 0 12.8px 29.4px rgba(0, 0, 0, 0.13), 0 53.8px 53.8px rgba(0, 0, 0, 0.11), 0 120px 73px rgba(0, 0, 0, 0.07), 0 215px 85.8px rgba(0, 0, 0, 0.02); transition: transform 0.6s var(--ease); }
@media (hover: hover) { .tile-ball:hover .ball { transform: scale(1.1); } }

/* ------------------------------------------------------------ footer */
.footer { margin-top: 120px; padding: 40px 48px 40px; }
.wordmark { --wm: 4.463; font: 500 min(266px, calc((100vw - 96px) / var(--wm))) / 1 var(--serif); letter-spacing: -0.06em; white-space: nowrap; }
.frow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 24px; margin-top: 56px; font-size: 12px; line-height: 16px; letter-spacing: -0.02em; }
.fleft { display: flex; align-items: flex-start; gap: 12px; }
.fleft .mark { margin-top: 4px; flex: none; }
.fmid { text-align: center; font-weight: 500; }
.fright { text-align: right; }
.footer a:hover { text-decoration: underline; }
.flegal { margin-top: 48px; display: flex; justify-content: center; align-items: center; gap: 32px; font-size: 12px; line-height: 16px; letter-spacing: -0.02em; }
.langs { display: flex; gap: 12px; }
.langs a { opacity: .4; transition: opacity .2s; }
.langs a:hover, .langs a[aria-current] { opacity: 1; }
.langs a[aria-current] { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ плавающая кнопка */
.fab { position: fixed; z-index: 50; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px 0 18px; border-radius: 26px; background: #000; color: #fff; font: 500 15px / 1 var(--sans); letter-spacing: -0.02em; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.12); animation: fab-in 0.8s var(--ease) 1.2s both, fab-float 4.4s ease-in-out 2s infinite; transition: scale 0.3s var(--ease), background-color 0.3s; }
.fab:hover { scale: 1.06; background: #1b1b1b; animation-play-state: running, paused; }
@keyframes fab-in { from { opacity: 0; transform: translateY(24px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes fab-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ------------------------------------------------------------ reveal (слова: opacity + blur + y + scale, стаггер) */
.js .rw { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(8px) scale(0.95); transition: opacity 0.7s var(--ease), filter 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.js .is-in .rw { opacity: 1; filter: none; transform: none; }
.js .st.rw { display: inline-block; filter: none; transform: scale(0.9); }
.js .avs.rw { display: inline-flex; filter: none; transform: scale(0.9); }
.js .is-in .st.rw, .js .is-in .avs.rw { transform: none; }
.js .tile { opacity: 0; filter: blur(8px); transform: translateY(28px) scale(0.97); transition: opacity 0.9s var(--ease), filter 0.9s var(--ease), transform 0.9s var(--ease); }
.js .tile.is-in { opacity: 1; filter: none; transform: none; }
/* плитка вне экрана — анимации на паузе */
.is-off, .is-off * { animation-play-state: paused !important; }

@media (max-width: 1100px) {
  .feature { gap: 64px; }
  .hero { width: calc(100% - 48px); }
}
@media (max-width: 899px) {
  .manifesto { font-size: clamp(30px, 7.6vw, 52px); line-height: 1.08; gap: 28px; }
  .mp { display: block; text-align: center; text-wrap: balance; }
  .ln { display: inline; height: auto; white-space: normal; }
  .st, .avs { margin-block: -0.2em; }
  .features { gap: 72px; margin-top: 88px; }
  .feature { flex-direction: column; gap: 28px; }
  .ftext { width: min(360px, 100%); text-align: left; }
  .manifesto-wrap { margin-top: 80px; }
}
@media (max-width: 639px) {
  .top-note { height: 56px; padding: 20px 16px 0; font-size: 11px; }
  .hero { width: calc(100% - 24px); padding: 28px 0 44px; border-radius: 32px; }
  .hero h1 { margin-top: 44px; font-size: clamp(34px, 10.4vw, 48px); line-height: 0.95; }
  .hero-sub { margin-top: 18px; font-size: 15px; line-height: 22px; max-width: 86%; }
  .hero-video { margin-top: 40px; width: calc(100% - 28px); }
  .hero-video .glow { filter: blur(30px) saturate(1.5); }
  .clients-note { margin-top: 32px; padding: 0 16px; }
  .clients { width: calc(100% - 20px); }
  .tile { width: min(360px, calc(100vw - 48px)); height: min(360px, calc(100vw - 48px)); border-radius: 36px; }
  .tile-gh .gh, .tile-crab .crab-wrap, .tile-ball .ball-wrap { transform-origin: 0 0; scale: calc(min(360px, 100vw - 48px) / 360px); }
  .footer { padding: 24px 20px 28px; margin-top: 80px; }
  .wordmark { font-size: calc((100vw - 40px) / var(--wm)); }
  .frow { grid-template-columns: 1fr; gap: 20px; margin-top: 32px; }
  .fmid, .fright { text-align: left; }
  .flegal { margin-top: 28px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .fab { height: 48px; padding: 0 18px 0 14px; right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rw, .js .tile, .js .st.rw, .js .avs.rw { opacity: 1 !important; filter: none !important; transform: none !important; }
  .crab-screen .d { opacity: 1; }
}
