/* Astraway — home page styles (carried over from the prototype). */
html { scrollbar-gutter: stable; overflow-y: scroll; }
html, body { margin: 0; padding: 0; background: #050506; }
/* inset ring: the rail sits in a clipped column, an offset ring would be cut off */
[data-rail-item]:focus-visible { outline: 2px solid rgba(255,255,255,0.9); outline-offset: -2px; border-radius: 8px; }
@media (max-width: 1024px) {
  [data-pad="180-0"] { padding-top: 128px !important; }
  [data-pad="160-160"] { padding-top: 120px !important; padding-bottom: 120px !important; }
  [data-pad="0-160"] { padding-bottom: 120px !important; }
  [data-pad="96-160"] { padding-top: 72px !important; padding-bottom: 120px !important; }
}
@media (max-width: 640px) {
  [data-pad="180-0"] { padding-top: 108px !important; }
  [data-pad="160-160"] { padding-top: 96px !important; padding-bottom: 96px !important; }
  [data-pad="0-160"] { padding-bottom: 96px !important; }
  [data-pad="96-160"] { padding-top: 56px !important; padding-bottom: 96px !important; }
}
@media (max-width: 1200px) {
  [data-orbit-stage] { flex-direction: column; gap: 48px; min-height: 0 !important; padding: 24px 0 0; overflow: visible !important; }
  #orb-stage { position: static !important; transform: none !important; width: min(560px, 100%) !important; margin: 0 auto !important; }
  [data-orbit-labels] { position: static !important; inset: auto !important; display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 620px; margin: 0 auto; }
  [data-orbit-label] { position: static !important; transform: none !important; text-align: left !important; justify-content: flex-start; }
  [data-orbit-label] > [data-dot] { order: -1; }
  [data-orbit-label] > div { align-items: flex-start !important; }
  [data-orbit-label] span { white-space: normal !important; }
}
@media (max-width: 1024px) {
  [data-kpi-grid] { grid-template-columns: repeat(2, 1fr) !important; }
  [data-hero-grid] { grid-template-columns: 1fr 1fr !important; }
  [data-tile-hero] { grid-column: 1 / -1 !important; order: -1 !important; min-height: 420px !important; }
}
@media (max-width: 900px) {
  [data-company-row] { grid-template-columns: 1fr !important; gap: 36px !important; }
  [data-dir-row] { grid-template-columns: 1fr !important; gap: 32px !important; }
  [data-dir-row] > div:last-child { height: 180px !important; }
}
@media (min-width: 1120px) {
  [data-cta-grid] { grid-template-columns: 1fr minmax(0, 540px) 1fr !important; }
  [data-cta-grid] > [data-cta-text] { order: 0 !important; grid-column: auto !important; }
}
@media (max-width: 1119px) {
  [data-cta-grid] > [data-parallax] { transform: none !important; }
}
@keyframes ctaAurora {
  0%   { transform: translate3d(-9%, -7%, 0) scale(1) rotate(0deg);      opacity: 0.34; }
  35%  { transform: translate3d(7%, 5%, 0) scale(1.22) rotate(5deg);     opacity: 0.52; }
  70%  { transform: translate3d(-5%, 10%, 0) scale(1.06) rotate(-4deg);  opacity: 0.38; }
  100% { transform: translate3d(6%, -4%, 0) scale(1.16) rotate(3deg);    opacity: 0.48; }
}
@keyframes ctaAuroraB {
  0%   { transform: translate3d(9%, 8%, 0) scale(1.08) rotate(0deg);     opacity: 0.24; }
  40%  { transform: translate3d(-11%, -7%, 0) scale(1.26) rotate(-6deg); opacity: 0.4; }
  75%  { transform: translate3d(5%, -10%, 0) scale(1.02) rotate(4deg);   opacity: 0.26; }
  100% { transform: translate3d(-6%, 6%, 0) scale(1.18) rotate(-2deg);   opacity: 0.36; }
}
@keyframes ctaAuroraC {
  0%   { transform: translate3d(-14%, 9%, 0) scale(0.92);  opacity: 0.16; }
  50%  { transform: translate3d(13%, -8%, 0) scale(1.3);   opacity: 0.32; }
  100% { transform: translate3d(-8%, -12%, 0) scale(1.02); opacity: 0.2; }
}
@keyframes ctaSheen {
  0%   { transform: translate3d(-38%, 0, 0) rotate(8deg); opacity: 0; }
  18%  { opacity: 0.5; }
  52%  { opacity: 0.24; }
  100% { transform: translate3d(38%, 0, 0) rotate(8deg);  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  [style*="ctaAurora"], [style*="ctaSheen"] { animation: none !important; }
}
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrimOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetTurn {
  0%   { opacity: 0; transform: perspective(1800px) rotateX(-22deg) rotateZ(-1.2deg) translateY(-4%) scale(.965); }
  38%  { opacity: 1; }
  62%  { transform: perspective(1800px) rotateX(2.2deg) rotateZ(.25deg) translateY(.4%) scale(1.004); }
  100% { opacity: 1; transform: perspective(1800px) rotateX(0deg) rotateZ(0deg) translateY(0) scale(1); }
}
@keyframes sheetClose {
  from { opacity: 1; transform: perspective(1800px) rotateX(0deg) translateY(0) scale(1); }
  to   { opacity: 0; transform: perspective(1800px) rotateX(-15deg) translateY(-2.6%) scale(.978); }
}
@keyframes sheetSheen {
  0%   { transform: translateX(-130%) rotate(9deg); opacity: 0; }
  20%  { opacity: .8; }
  68%  { opacity: .3; }
  100% { transform: translateX(140%) rotate(9deg); opacity: 0; }
}
@keyframes sheetRise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
[data-modal-shell] [data-stagger] { animation: sheetRise 560ms cubic-bezier(.22,1,.36,1) both; }
[data-modal-shell] [data-stagger]:nth-child(1) { animation-delay: .20s; }
[data-modal-shell] [data-stagger]:nth-child(2) { animation-delay: .25s; }
[data-modal-shell] [data-stagger]:nth-child(3) { animation-delay: .30s; }
[data-modal-shell] [data-stagger]:nth-child(4) { animation-delay: .35s; }
[data-agent-list] > * { animation: sheetRise 560ms cubic-bezier(.22,1,.36,1) both; }
[data-agent-list] > *:nth-child(1) { animation-delay: .26s; }
[data-agent-list] > *:nth-child(2) { animation-delay: .30s; }
[data-agent-list] > *:nth-child(3) { animation-delay: .34s; }
[data-agent-list] > *:nth-child(4) { animation-delay: .38s; }
[data-agent-list] > *:nth-child(5) { animation-delay: .42s; }
[data-agent-list] > *:nth-child(6) { animation-delay: .46s; }
@media (hover: hover) and (pointer: fine) { [data-agent-row]:hover [data-row-sweep] { transform: translateX(340%); } }
[data-agent-row]:hover [data-row-code] { color: #ffffff; }
@media (hover: hover) and (pointer: fine) { [data-agent-row]:hover [data-row-arrow] { transform: translateX(5px); color: #ffffff; } }
[data-modal-shell][data-closing="1"] { animation: sheetClose 300ms cubic-bezier(.4,0,1,1) both; }
[data-modal-scrim][data-closing="1"] { animation: scrimOut 280ms cubic-bezier(.4,0,1,1) both; }
[data-closing="1"] [data-stagger], [data-closing="1"] [data-agent-list] > *, [data-closing="1"] [data-sheet-sheen] { animation: none !important; }
[data-works-card] { cursor: pointer; }
[data-card-photo] { pointer-events: none; }
[data-works-card][data-front="1"] [data-card-photo] { pointer-events: auto; }
[data-card-photo] img { transition: transform 1.1s cubic-bezier(.22,1,.36,1), filter .6s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-works-card][data-front="1"]:hover [data-card-photo] img, [data-works-card][data-held] [data-card-photo] img { transform: scale(1.055); filter: grayscale(0.32) brightness(0.56) contrast(1.06) saturate(0.9); } }
[data-card-wash] { transition: opacity .6s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-works-card][data-front="1"]:hover [data-card-wash], [data-works-card][data-held] [data-card-wash] { opacity: 0.5; } }
[data-card-rim] { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3), inset 0 1px 0 rgba(255,255,255,0.4), 0 30px 90px rgba(0,0,0,0.4); transition: opacity .6s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-works-card][data-front="1"]:hover [data-card-rim], [data-works-card][data-held] [data-card-rim] { opacity: 1; } }
[data-card-sweep] { position: absolute; top: -40%; bottom: -40%; left: 0; width: 46%; z-index: 3; pointer-events: none; background: linear-gradient(100deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.1) 46%,rgba(255,255,255,0.16) 52%,rgba(255,255,255,0.07) 58%,rgba(255,255,255,0) 100%); filter: blur(16px); transform: translateX(-140%) rotate(8deg); }
@media (hover: hover) and (pointer: fine) { [data-works-card][data-front="1"]:hover [data-card-sweep] { transform: translateX(150%) rotate(8deg); transition: transform 1.15s cubic-bezier(.22,1,.36,1); } }
[data-works-card][data-front="1"]:hover { cursor: none; }
[data-card-title] { display: inline-block; transition: transform .7s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-works-card][data-front="1"]:hover [data-card-title], [data-works-card][data-held] [data-card-title] { transform: translateY(-4px); } }
[data-works-cursor] { position: fixed; left: 0; top: 0; z-index: 45; display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 9999px; pointer-events: none; opacity: 0; transform: scale(.6); background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.28); backdrop-filter: blur(16px) saturate(170%); -webkit-backdrop-filter: blur(16px) saturate(170%); color: #fff; font-size: 12px; letter-spacing: 0.02em; transition: opacity .34s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1); will-change: transform; }
[data-works-cursor][data-on="1"] { opacity: 1; transform: scale(1); }
[data-works-cursor][data-press="1"] { transform: scale(.88); }
@media (hover: none), (prefers-reduced-motion: reduce) {
  [data-works-cursor] { display: none; }
  [data-works-card][data-front="1"]:hover { cursor: pointer; }
}
[data-works-card]:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.6), 0 40px 120px rgba(0,0,0,0.5); }
[data-rail-item] { color: #8b8b90; transition: color .42s cubic-bezier(.22,1,.36,1); }
[data-rail-item]:hover { color: rgba(255,255,255,0.82); }
[data-rail-item]:focus-visible { color: #ffffff; }
[data-rail-item][data-state="on"] { color: #ffffff; }
[data-rail-item][data-state="on"] [data-rail-label] { font-weight: 600; }
@media (max-width: 1240px) { [data-works-rail] { display: none; } }
@media (max-width: 900px) {
  [data-works] { height: auto !important; padding: 0 0 96px !important; }
  [data-works-rail] { display: none !important; }
  [data-works-stick] { position: static !important; height: auto !important; overflow: visible !important; }
  #works-stars { display: none !important; }
  [data-works-titlewrap] { position: static !important; top: auto !important; padding: 0 20px 26px !important; pointer-events: auto !important; }
  [data-works-titlepill] { transform: none !important; padding: 0 !important; }
  [data-works-titleglass] { display: none !important; }
  [data-works-title] { font-size: clamp(2rem, 8vw, 2.75rem) !important; text-align: left !important; }
  [data-works-stage] { position: static !important; perspective: none !important; transform-style: flat !important; display: flex !important; flex-direction: column !important; gap: 14px !important; padding: 0 20px !important; }
  [data-works-card] {
    position: relative !important; inset: auto !important; margin: 0 !important;
    width: 100% !important; max-width: none !important; aspect-ratio: 16 / 10 !important;
    transform: none !important; opacity: 1 !important; pointer-events: auto !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.16) !important;
    transition: transform .16s cubic-bezier(.22,1,.36,1) !important;
  }
  [data-works-card]:active, [data-works-card][data-pressed] { transform: scale(.985) !important; }
  [data-works-scrim], [data-card-sweep], [data-works-bd] { opacity: 0 !important; display: none !important; }
  [data-works-cursor] { display: none !important; }
}
@keyframes reelDrift { from { transform: scale(1.05) translate3d(-1%, -0.6%, 0); } to { transform: scale(1.12) translate3d(1%, 0.7%, 0); } }
[data-reel] [data-reel-layer] { transition: opacity 1s cubic-bezier(.22,1,.36,1), filter .8s cubic-bezier(.22,1,.36,1); animation: reelDrift 17s ease-in-out infinite alternate; will-change: opacity, transform; }
[data-reel]:nth-child(even) [data-reel-layer] { animation-duration: 21s; animation-direction: alternate-reverse; }
[data-reel] { transition: transform .8s cubic-bezier(.22,1,.36,1), box-shadow .8s cubic-bezier(.22,1,.36,1), border-color .8s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-reel]:hover { transform: translateY(-6px); box-shadow: 0 32px 80px rgba(0,0,0,0.55); border-color: rgba(255,255,255,0.16); } }
@media (hover: hover) and (pointer: fine) { [data-reel]:hover [data-reel-layer] { filter: saturate(1.06) brightness(1.06); } }
[data-reel] [data-reel-veil] { transition: opacity .8s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-reel]:hover [data-reel-veil] { opacity: 0.7; } }
[data-reel] [data-reel-rim] { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: 24px; opacity: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), inset 0 1px 0 rgba(255,255,255,0.28); transition: opacity .8s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-reel]:hover [data-reel-rim] { opacity: 1; } }
[data-reel] [data-reel-label] { display: inline-block; transition: opacity .38s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1), color .8s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) { [data-reel]:hover [data-reel-label] { transform: translateY(-2px); color: rgba(255,255,255,0.94); } }
@media (prefers-reduced-motion: reduce) {
  [data-reel] [data-reel-layer] { animation: none !important; }
  [data-reel]:hover { transform: none; }
}
[data-card-cta] svg { transition: transform .42s cubic-bezier(.22,1,.36,1); }
[data-modal-shell] [data-stagger]:nth-child(5) { animation-delay: .40s; }
[data-modal-shell] [data-stagger]:nth-child(6) { animation-delay: .45s; }
@media (max-width: 640px) {
  [data-hero-grid] { grid-template-columns: 1fr !important; }
  [data-hero-grid] > div, [data-tile-hero] { grid-column: 1 !important; order: 0 !important; }
  [data-kpi-grid] { grid-template-columns: 1fr !important; gap: 16px !important; }
  [data-kpi-grid] > div { min-height: 300px !important; padding: 32px 24px 28px !important; }
  [data-tile] { min-height: 0 !important; height: auto !important; aspect-ratio: 4 / 3 !important; }
  [data-tile-hero] { aspect-ratio: 3 / 4 !important; min-height: 0 !important; }
}
@media (hover: hover) and (pointer: fine) { [data-works-card]:hover [data-card-cta], [data-works-card][data-held] [data-card-cta] { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3); color: #ffffff; } }
@media (hover: hover) and (pointer: fine) { [data-works-card]:hover [data-card-cta] svg, [data-works-card][data-held] [data-card-cta] svg { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  [data-modal-shell], [data-modal-scrim], [data-modal-shell] [data-stagger], [data-agent-list] > *, [data-sheet-sheen] { animation: none !important; }
}
@keyframes ditherShift {
  0%   { -webkit-mask-position: 0 0; mask-position: 0 0; }
  25%  { -webkit-mask-position: 2px 1px; mask-position: 2px 1px; }
  50%  { -webkit-mask-position: 1px 2px; mask-position: 1px 2px; }
  75%  { -webkit-mask-position: 3px 2px; mask-position: 3px 2px; }
  100% { -webkit-mask-position: 0 0; mask-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* fix (prototype bug): the preserve-3d stage plane sits in front of the front card whenever the deck
   is between snap points (card z < 0), swallowing clicks and the custom cursor. Cards carry their own
   pointer-events (front card = auto, set in JS; flat mobile layout = auto !important). */
[data-works-stage] { pointer-events: none; }

/* ---------- audit fixes (home) ---------- */
/* rail hides at ≤1240px (inline display:flex needs the override) */
@media (max-width: 1240px) { [data-works-rail] { display: none !important; } }
/* pinned deck: size the card from the free height (header ≈100px + pinned title pill above, "Смотреть агентов" below)
   and keep it clear of the rail when the rail is shown */
@media (min-width: 901px) {
  [data-works-card] { width: min(90vw, 46rem, max(300px, calc((100vh - 380px) * 1.6))) !important; max-width: none !important; }
}
@media (min-width: 1241px) {
  [data-works-card] { width: min(90vw, 46rem, calc(100vw - 2 * (clamp(0.75rem, 2.6vw, 2.75rem) + 14rem + 24px)), max(300px, calc((100vh - 380px) * 1.6))) !important; }
}
@media (min-width: 901px) and (max-height: 820px) {
  [data-works-titlewrap] { top: 6.75rem !important; }
  [data-works-title] { font-size: clamp(1.8rem, 4.2vw, 3.2rem) !important; }
}
/* KPI: no orphan card between 641 and 1024px — the third card spans the row */
@media (min-width: 641px) and (max-width: 1024px) {
  [data-kpi-grid] > div:nth-child(3) { grid-column: 1 / -1; min-height: 300px !important; }
}
/* phones: compact orb scene so "Как работаем" flows into "Показатели" */
@media (max-width: 640px) {
  #orb-stage { width: min(100%, 70svh) !important; max-height: 70svh; }
  [data-orbit-stage] { gap: 28px !important; padding-top: 0 !important; }
  section#how { padding-bottom: 72px !important; }
}
@media (max-width: 640px) {
  section#how > [data-reveal]:first-child { margin-bottom: 40px !important; }
}
/* reels: captions fit one line from 1024px up */
@media (max-width: 1360px) {
  [data-reel] { padding: 18px !important; }
  [data-reel] [data-reel-label] { letter-spacing: -0.01em; }
}
@media (min-width: 1120px) and (max-width: 1360px) {
  [data-cta-grid] { grid-template-columns: 1fr minmax(0, 500px) 1fr !important; }
}
@media (max-width: 1119px) { [data-reel] { padding: 14px 14px 18px !important; } }

/* narrow phones: the CTA heading scales so «в своей отрасли» stays on one line inside the card (card 16px + 28px padding + 8px text padding per side) */
@media (max-width: 389px) { [data-cta-text] h2 { font-size: min(2.4rem, calc((100vw - 104px) * 0.132)) !important; } }

/* ---------- agents are clickable (hero tiles, CTA reels, industry rows) ---------- */
/* hero tiles link to the agent's case: an arrow chip in the caption says so on touch screens too */
[data-tile-go] { margin-left: auto; flex: 0 0 auto; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 9999px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: rgba(255,255,255,0.84); transition: background .42s cubic-bezier(.22,1,.36,1), border-color .42s cubic-bezier(.22,1,.36,1), color .42s cubic-bezier(.22,1,.36,1); }
[data-tile-go] svg { transition: transform .42s cubic-bezier(.22,1,.36,1); }
@media (hover: hover) and (pointer: fine) {
  a[data-tile]:hover [data-tile-go] { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3); color: #ffffff; }
  a[data-tile]:hover [data-tile-go] svg { transform: translateX(3px); }
}
/* touch: the press shows before the page changes */
@media (hover: none) { a[data-tile]:active, a[data-reel]:active { transform: scale(.985) !important; transition-duration: .16s !important; } }
/* industry rows on phones: code, launch time and icon on one line, the text below at full width
   (in three columns the description wrapped word by word in a ~110px strip) */
@media (max-width: 560px) {
  [data-agent-row] { grid-template-columns: 1fr auto !important; grid-template-areas: "code side" "text text"; row-gap: 8px !important; padding: 14px 16px 16px !important; }
  [data-agent-row] [data-row-code] { grid-area: code; }
  [data-agent-row] [data-row-side] { grid-area: side; }
  [data-agent-row] [data-row-text] { grid-area: text; }
}
