/* ===== GreyAI motion layer ===== */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 90; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--orange), var(--orange-2)); box-shadow: 0 0 12px var(--glow); pointer-events: none; }



/* Hero */
.hero h1 .line { display: block; }
.hero h1 .line.outline { color: #fff; filter: url(#text-outline); }
.hero-visual .layers { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.hero-visual .seams { position: absolute; right: -6%; bottom: -4%; height: 112%; width: auto; max-width: none; mix-blend-mode: screen; filter: saturate(2.8) contrast(1.6) brightness(1.1); opacity: 0; animation: seamPulse 4.2s ease-in-out infinite; pointer-events: none; }
.hero-visual .scan { position: absolute; left: 10%; right: 0; height: 2px; top: -5%; background: linear-gradient(90deg, transparent, rgba(255,107,53,.9), transparent); filter: blur(1px); opacity: 0; animation: scan 7s ease-in-out infinite 2s; mix-blend-mode: screen; pointer-events: none; }
.hero-visual .visor-glow { position: absolute; width: 42%; height: 30%; left: 45%; top: 25%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,69,0,.55), transparent); filter: blur(28px); opacity: .7; pointer-events: none; mix-blend-mode: screen; will-change: transform; }
.hero-visual .robot { animation: breathe 7s ease-in-out infinite; transform-origin: 60% 100%; }
@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.012); } }
@keyframes seamPulse { 0%, 100% { opacity: .04; } 50% { opacity: .55; } }
@keyframes scan { 0% { top: -5%; opacity: 0; } 8% { opacity: .5; } 45% { opacity: .35; } 55% { top: 105%; opacity: 0; } 100% { top: 105%; opacity: 0; } }
.hero-video { position: absolute; right: -6%; bottom: -4%; height: 112%; width: auto; max-width: none; object-fit: cover; opacity: 0; transition: opacity .9s var(--ease); -webkit-mask-image: radial-gradient(ellipse 60% 72% at 58% 50%, #000 48%, transparent 97%); mask-image: radial-gradient(ellipse 60% 72% at 58% 50%, #000 48%, transparent 97%); pointer-events: none; }
.hero-video.on { opacity: 1; }
.hero-visual.video-on .robot { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-visual.video-on .seams { animation: none; opacity: 0; transition: opacity 1.2s; }
.hero-visual.video-on .visor-glow { opacity: .45; }

/* Title word reveal */
.h2 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.h2 .w > span { display: inline-block; transform: translateY(110%); will-change: transform; }
.h2 .w.grad > span { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h2.split .grad { background: none; color: inherit; }

/* Tilt cards */
.tilt { position: relative; transform-style: preserve-3d; will-change: transform; transition: transform .15s linear; }
.tilt .spot { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,69,0,.18), transparent 60%); }
.tilt:hover .spot { opacity: 1; }
.tilt .spot-border { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), rgba(255,107,53,.8), transparent 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; padding: 1px; }
.tilt:hover .spot-border { opacity: 1; }

/* Process draw */
.steps::before { transform: scaleX(var(--draw, 0)); transform-origin: left center; transition: transform .6s var(--ease); }
.step .step-num { transition: background .4s, color .4s, box-shadow .4s, transform .4s var(--ease); }
.step.lit .step-num { background: var(--orange); color: #000; box-shadow: 0 0 0 6px var(--bg), 0 0 40px rgba(255,69,0,.6); transform: scale(1.06); }
@media (max-width: 960px) { .steps::before { transform: scaleY(var(--draw, 0)); transform-origin: center top; } }

/* Niches marquee */
.niches-marquee { overflow: hidden; margin-bottom: 24px; -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 16s linear infinite; padding: 6px 0; }
.niches-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Seams pulse on other renders */
.why-visual .seams, .cta-visual .seams { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; filter: saturate(2.6) contrast(1.5); opacity: 0; animation: seamPulse 5s ease-in-out infinite 1s; pointer-events: none; }
.why-visual .seams { left: 50%; top: 50%; transform: translate(-50%, -50%); height: 118%; width: auto; inset: auto; }
.cta-visual { will-change: transform; }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.intro .intro-logo { font-family: var(--font-display); font-weight: 800; font-size: clamp(34px, 9vw, 110px); letter-spacing: .28em; text-indent: .28em; color: #fff; display: flex; }
.intro .intro-logo span { display: inline-block; opacity: 0; transform: translateY(24px); }
.intro .intro-logo span.o { color: var(--orange); }
.intro .intro-scan { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--orange), transparent); box-shadow: 0 0 24px var(--orange); opacity: 0; }
.intro .intro-sub { position: absolute; bottom: 36px; left: 0; right: 0; text-align: center; font: 500 11px var(--font-mono); letter-spacing: .3em; text-transform: uppercase; color: var(--muted-2); opacity: 0; }
body.intro-lock { overflow: hidden; }

/* Spider */
.spider { position: fixed; bottom: 0; left: 0; width: 120px; height: 84px; z-index: 80; cursor: pointer; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0,0,0,.7)) drop-shadow(0 0 10px rgba(255,69,0,.35)); }
.spider svg { width: 100%; height: 100%; overflow: visible; }
.spider .leg { transform-box: fill-box; transform-origin: 100% 20%; }
.spider .leg.r { transform-origin: 0% 20%; }
.spider .leg.a { animation: legA .55s ease-in-out infinite alternate; }
.spider .leg.b { animation: legB .55s ease-in-out infinite alternate; }
.spider .body { animation: bodyBob .55s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.spider .shadow { animation: shadowPulse .55s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes shadowPulse { from { transform: scaleX(1); opacity: .6; } to { transform: scaleX(.9); opacity: .4; } }
.spider.still .leg, .spider.still .body { animation-play-state: paused; }
@keyframes legA { from { transform: rotate(-9deg); } to { transform: rotate(8deg); } }
@keyframes legB { from { transform: rotate(8deg); } to { transform: rotate(-9deg); } }
@keyframes bodyBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.spider-toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); z-index: 81; font: 500 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--orange); background: rgba(17,17,17,.9); border: 1px solid rgba(255,69,0,.4); padding: 10px 16px; border-radius: 999px; opacity: 0; transition: opacity .4s, transform .4s var(--ease); pointer-events: none; }
.spider-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fx-canvas { position: fixed; inset: 0; z-index: 82; pointer-events: none; }

@media (hover: none), (pointer: coarse) { .tilt .spot, .tilt .spot-border { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-visual .seams, .hero-visual .scan, .hero-visual .robot, .why-visual .seams, .cta-visual .seams, .marquee-track, .spider .leg, .spider .body { animation: none !important; }
  .h2 .w > span { transform: none !important; }
  .spider, .intro { display: none !important; }
}

/* ===== Laptop scene (projects) ===== */
.lab { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: center; }
.lab-scene { position: relative; aspect-ratio: 4 / 3; min-height: 380px; perspective: 1400px; isolation: isolate; overflow: visible; }
.lab-glow { position: absolute; left: 62%; bottom: 6%; width: 70%; height: 50%; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255,69,0,.45), transparent); filter: blur(30px); pointer-events: none; }
.lab-hand { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 64%; mix-blend-mode: screen; transform: translateY(40px); opacity: 0; }
.laptop { position: absolute; left: 60%; bottom: 33%; width: 58%; transform: translateX(-50%); transform-style: preserve-3d; animation: labFloat 6s ease-in-out infinite; }
.laptop-screen { position: relative; transform-origin: 50% 100%; transform: rotateX(-96deg); transform-style: preserve-3d; }
.screen-bezel { position: relative; background: #0b0b0b; border: 1px solid rgba(255,107,53,.55); border-radius: 12px 12px 4px 4px; padding: 10px 10px 14px; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 80px rgba(0,0,0,.6), 0 0 40px rgba(255,69,0,.18); }
.screen-inner { position: relative; aspect-ratio: 16 / 9.6; overflow: hidden; border-radius: 6px; background: #050505; }
.screen-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity .7s var(--ease), transform .7s var(--ease); transform: scale(1.03); }
.screen-inner img.on { opacity: 1; transform: scale(1); }
.screen-glare { position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.08) 0%, transparent 35%, transparent 70%, rgba(255,107,53,.06) 100%); pointer-events: none; }
.screen-inner::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); pointer-events: none; mix-blend-mode: overlay; }
.screen-bezel .cam { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px var(--orange); transform: translateX(-50%); }
.laptop-base { position: relative; height: 10px; margin-top: -1px; background: linear-gradient(#1a1a1a, #0d0d0d); border: 1px solid rgba(255,255,255,.1); border-top-color: rgba(255,107,53,.4); border-radius: 0 0 10px 10px; transform-origin: 50% 0; transform: rotateX(70deg) scaleX(1.08); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.laptop-base .notch { position: absolute; left: 50%; top: -1px; width: 18%; height: 3px; transform: translateX(-50%); background: #222; border-radius: 0 0 4px 4px; }
@keyframes labFloat { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
.lab-panel { display: flex; flex-direction: column; gap: 10px; }
.lab-tab { position: relative; text-align: left; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; color: var(--text); cursor: pointer; font: inherit; transition: border-color .3s, background .3s, transform .3s var(--ease); overflow: hidden; }
.lab-tab:hover { border-color: rgba(255,255,255,.2); }
.lab-tab.active { border-color: rgba(255,69,0,.55); background: #141414; }
.lab-tab .badge { margin-bottom: 10px; }
.lab-tab h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 0 6px; }
.lab-tab p { margin: 0; color: var(--muted); font-size: 14px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s var(--ease), opacity .4s, margin .4s; }
.lab-tab.active p { max-height: 140px; opacity: 1; margin-top: 8px; }
.lab-tab .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); transform-origin: left; transform: scaleX(0); }
.lab-tab.active .bar { animation: labBar var(--lab-dur, 4.5s) linear forwards; }
@keyframes labBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 960px) { .lab { grid-template-columns: 1fr; gap: 20px; } .lab-scene { min-height: 280px; aspect-ratio: 16 / 11; } .laptop { width: 70%; left: 55%; bottom: 30%; } }
@media (prefers-reduced-motion: reduce) { .lab-hand { opacity: 1; transform: none; } .laptop-screen { transform: rotateX(-8deg); } .laptop { animation: none; } .lab-tab.active .bar { animation: none; transform: scaleX(1); } }

/* No-animation fallbacks (query ?noanim or reduced motion) */
body.noanim .lab-hand { opacity: 1; transform: none; }
body.noanim .laptop-screen { transform: rotateX(-8deg); }
body.noanim .laptop { animation: none; }
body.noanim .lab-tab.active .bar { animation: none; transform: scaleX(1); }
body.noanim .hero-visual .seams, body.noanim .hero-visual .scan, body.noanim .why-visual .seams, body.noanim .cta-visual .seams { animation: none; opacity: 0; }

/* Intro: CSS-driven so it never depends on JS timers */
.intro.run .intro-logo span { animation: introLetter .5s cubic-bezier(.2,.7,.2,1) forwards; }
.intro.run .intro-logo span:nth-child(1) { animation-delay: .10s; } .intro.run .intro-logo span:nth-child(2) { animation-delay: .16s; } .intro.run .intro-logo span:nth-child(3) { animation-delay: .22s; } .intro.run .intro-logo span:nth-child(4) { animation-delay: .28s; } .intro.run .intro-logo span:nth-child(5) { animation-delay: .34s; } .intro.run .intro-logo span:nth-child(6) { animation-delay: .40s; }
.intro.run .intro-scan { animation: introScan .9s .3s ease-in-out forwards; }
.intro.run .intro-sub { animation: introFade .4s .5s forwards; }
.intro.run { animation: introOut .7s 1.25s cubic-bezier(.76,0,.24,1) forwards; }
.intro:not(.run) { display: none; }
@keyframes introLetter { to { opacity: 1; transform: none; } }
@keyframes introScan { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes introFade { to { opacity: 1; } }
@keyframes introOut { to { clip-path: inset(0 0 100% 0); } }
body.noanim .h2 .w > span { transform: none !important; }

/* ===== Services laptop: full-width scene with a UI on screen ===== */
.lab--services { display: block; }
.lab--services .lab-scene { max-width: 980px; margin: 0 auto; aspect-ratio: 16 / 10; min-height: 0; }
.lab--services .laptop { left: 52%; bottom: 26%; width: 66%; }
.lab--services .lab-hand { object-position: 74% 70%; }
.lab--services .lab-glow { left: 58%; }
.screen-ui { display: flex; flex-direction: column; font-family: var(--font-body); }
.screen-ui .ui-top { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.08); background: #0a0a0a; flex: none; }
.screen-ui .ui-top i { width: 7px; height: 7px; border-radius: 50%; background: #2a2a2a; } .screen-ui .ui-top i:first-child { background: var(--orange); }
.screen-ui .ui-top span { margin-left: 8px; font: 500 9px var(--font-mono); letter-spacing: .08em; color: var(--muted-2); }
.screen-ui .ui-body { display: grid; grid-template-columns: 34% 1fr; flex: 1; min-height: 0; }
.ui-side { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid rgba(255,255,255,.08); background: #0c0c0c; }
.ui-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font: 500 11px var(--font-body); text-align: left; cursor: pointer; transition: background .25s, color .25s; }
.ui-item svg { width: 12px; height: 12px; flex: none; color: var(--muted-2); transition: color .25s; }
.ui-item:hover { color: var(--text); }
.ui-item.active { background: rgba(255,69,0,.14); color: var(--text); box-shadow: inset 2px 0 0 var(--orange); }
.ui-item.active svg { color: var(--orange); }
.ui-main { position: relative; padding: 14px 16px 22px; background: radial-gradient(90% 70% at 100% 0%, rgba(255,69,0,.12), transparent), #080808; }
.ui-pane { position: absolute; inset: 14px 16px 24px; opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); pointer-events: none; }
.ui-pane.on { opacity: 1; transform: none; pointer-events: auto; }
.ui-pane .ui-num { font: 500 9px var(--font-mono); letter-spacing: .14em; color: var(--orange); }
.ui-pane h4 { font-family: var(--font-display); font-weight: 700; font-size: clamp(12px, 1.5vw, 18px); margin: 6px 0 6px; color: var(--text); }
.ui-pane p { margin: 0; font-size: clamp(10px, 1.1vw, 13px); line-height: 1.45; color: var(--muted); }
.ui-dots { position: absolute; left: 16px; bottom: 9px; display: flex; gap: 5px; }
.ui-dots i { width: 14px; height: 2px; background: rgba(255,255,255,.15); border-radius: 2px; transition: background .3s; }
.ui-dots i.on { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.services-list { display: none; list-style: none; margin: 8px 0 0; padding: 0; }
.services-list li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.services-list li:last-child { border-bottom: 1px solid var(--line); }
.services-list b { color: var(--text); font-weight: 600; }
.services-more { margin: 18px 0 0; text-align: center; font-size: 15px; }
.services-more a { color: var(--muted); border-bottom: 1px solid rgba(255,255,255,.15); transition: color .2s, border-color .2s; }
.services-more a:hover { color: var(--orange-2); border-color: var(--orange-2); }
@media (max-width: 960px) {
  .lab--services .lab-scene { aspect-ratio: 4 / 3; }
  .lab--services .laptop { width: 86%; left: 48%; bottom: 24%; }
  .screen-ui .ui-body { grid-template-columns: 1fr; }
  .ui-side { display: none; }
  .ui-pane h4 { font-size: 15px; } .ui-pane p { font-size: 11px; }
  .services-list { display: block; }
  .services-more { text-align: left; }
}
@media (max-width: 600px) { .lab--services .lab-scene { aspect-ratio: 1 / 1; } .lab--services .laptop { width: 92%; left: 50%; bottom: 26%; } .lab--services .lab-hand { object-position: 70% 72%; opacity: 1; } .ui-pane p { font-size: 10px; } }

/* ===== v3: tablet in hand (overrides) ===== */
.lab--services .lab-scene { max-width: 1040px; aspect-ratio: 16 / 9.5; }
.lab--services .lab-hand { position: absolute; left: 50%; bottom: -6%; top: auto; width: 118%; height: auto; max-width: none; transform: translateX(-34%) translateY(60px); object-fit: contain; object-position: center; mix-blend-mode: normal; opacity: 0; z-index: 3; transition: transform 1s var(--ease), opacity .9s var(--ease); }
.lab--services .lab-glow { left: 50%; bottom: 10%; width: 60%; height: 55%; opacity: 0; transition: opacity 1.2s .3s; }
.lab--services .laptop { left: 50%; bottom: 31%; width: 72%; max-width: 760px; transform: translateX(-50%) scale(.92); opacity: 0; z-index: 2; animation: none; transition: transform .9s .25s var(--ease), opacity .7s .25s var(--ease); }
.lab--services .laptop-screen { transform: none !important; }
.lab--services .screen-bezel { border-radius: 22px; padding: 14px; border: 1px solid rgba(255,107,53,.5); background: linear-gradient(160deg, #141414, #080808); box-shadow: 0 0 0 1px rgba(0,0,0,.8), 0 40px 90px rgba(0,0,0,.65), 0 0 50px rgba(255,69,0,.18); }
.lab--services .screen-bezel .cam { top: 6px; bottom: auto; }
.lab--services .screen-inner { border-radius: 12px; aspect-ratio: 16 / 9.6; }
.screen-off { position: absolute; inset: 0; z-index: 5; background: #050505; pointer-events: none; }
.screen-off::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #fff; box-shadow: 0 0 18px #FF4500, 0 0 40px #FF4500; opacity: 0; transform: scaleX(0); }
.lab-scene.on .lab-hand { transform: translateX(-34%) translateY(0); opacity: 1; }
.lab-scene.on .lab-glow { opacity: 1; }
.lab-scene.on .laptop { transform: translateX(-50%) scale(1); opacity: 1; }
.lab-scene.on .screen-off { animation: screenOff .9s .9s cubic-bezier(.7,0,.3,1) forwards; }
.lab-scene.on .screen-off::after { animation: screenLine .9s .9s cubic-bezier(.7,0,.3,1) forwards; }
.screen-ui .ui-top, .screen-ui .ui-body { opacity: 0; transition: opacity .5s 1.75s; }
.lab-scene.on .screen-ui .ui-top, .lab-scene.on .screen-ui .ui-body { opacity: 1; }
@keyframes screenLine { 0% { opacity: 0; transform: scaleX(0); } 25% { opacity: 1; transform: scaleX(1); } 55% { opacity: 1; transform: scaleX(1) scaleY(1); } 100% { opacity: 0; transform: scaleX(1) scaleY(120); } }
@keyframes screenOff { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.ui-all ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ui-all li { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.ui-all li b { color: var(--text); font: 700 clamp(10px, 1.1vw, 13px) var(--font-display); }
.ui-all li span { color: var(--muted); font-size: clamp(9px, .95vw, 12px); }
.ui-all .ui-num { color: var(--orange); }
.ui-pane.ui-all h4 { display: none; }
body.noanim .lab-scene .lab-glow, body.noanim .screen-ui .ui-top, body.noanim .screen-ui .ui-body { opacity: 1; transition: none; }
body.noanim .screen-off { display: none; }
.lab-tab, .lab-panel { display: none; }
@media (max-width: 960px) {
  .lab--services .lab-scene { aspect-ratio: 1 / 1; max-width: none; }
  .lab--services .laptop { width: 92%; bottom: 34%; }
  .lab--services .lab-hand { width: 150%; bottom: -4%; transform: translateX(-36%) translateY(60px); }
  .lab-scene.on .lab-hand { transform: translateX(-36%) translateY(0); }
  .ui-all li { padding: 4px 0; } .ui-all li span { display: none; } .ui-all ul { gap: 2px; }
}
@media (max-width: 600px) { .lab--services .lab-scene { aspect-ratio: 5 / 6; } .lab--services .laptop { width: 96%; bottom: 36%; } .lab--services .lab-hand { width: 170%; bottom: -2%; } }

/* why-us mobile: face beside the heading, list below */
@media (max-width: 960px) {
  .why-grid > div:last-child .section-head { min-height: 230px; }
  .why-visual { top: -36px; right: -4%; width: 56%; height: 330px; opacity: .95; -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%); mask-image: linear-gradient(to bottom, #000 60%, transparent 100%); }
  .why-visual img.main { mix-blend-mode: normal; }
}

/* CTA mobile: hand right under the button */
@media (max-width: 960px) {
  .cta-visual { margin-top: -14px; height: 210px; -webkit-mask-image: none; mask-image: none; overflow: hidden; }
  .cta-visual img { position: absolute; right: -6%; top: -40px; bottom: auto; width: 112%; height: auto; mix-blend-mode: normal; }
}

/* hero mobile: robot cutout beside the lead */
@media (max-width: 960px) {
  .hero p.lead { max-width: 56%; }
  .hero-visual { opacity: .92; -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); }
  .hero-visual img.robot, .hero-visual .seams { right: -8%; mix-blend-mode: normal; }
  .hero-visual .seams { mix-blend-mode: screen; }
}

/* hero mobile: fixed-height robot, head centered on the lead paragraph */
@media (max-width: 960px) {
  .hero-visual { bottom: auto; height: 520px; }
  .hero-visual img.robot, .hero-visual .seams { right: -11vw; height: 100%; }
  .hero-visual .visor-glow { left: 48%; top: 22%; width: 40%; height: 18%; }
}

/* ===== v4 fixes ===== */
/* Why-us: text left, mirrored figure right, lines wrap */
.why-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.why-visual { order: 2; }
.why-visual img.main { transform: translate(-50%, -50%) scaleX(-1); }
.why-list li { padding-right: 6%; }
@media (max-width: 960px) {
  .why-grid > div:last-child .section-head { min-height: 0; }
  .why-list { position: relative; z-index: 1; }
  .why-list li { padding-right: 42%; font-size: 16px; padding-top: 18px; padding-bottom: 18px; }
  .why-visual { position: absolute; right: -4%; top: auto; bottom: 0; width: 46%; height: 72%; min-height: 0; opacity: 1; z-index: 0; -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); }
  .why-visual img.main { position: absolute; left: auto; right: 0; top: 0; height: 100%; width: auto; max-width: none; transform: scaleX(-1); object-fit: contain; object-position: top right; }
}
/* CTA: crop the hand to the palm on mobile, no empty space below */
@media (max-width: 960px) {
  .cta-visual { height: 150px; margin-top: -8px; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); }
  .cta-visual img { right: -24%; top: -60px; width: 118%; }
}
/* Tablet UI on mobile: single pane, full screen */
@media (max-width: 960px) {
  .screen-ui .ui-body { display: block; position: relative; flex: 1; min-height: 0; }
  .ui-side { display: none; }
  .ui-main { position: absolute; inset: 0; padding: 12px 14px 20px; }
  .ui-pane { inset: 12px 14px 22px; }
  .lab--services .lab-scene { aspect-ratio: 4 / 5; }
  .services-more { margin-top: 4px; }
}
@media (max-width: 600px) { .lab--services .lab-scene { aspect-ratio: 4 / 5; } }

/* ===== v5: real tablet-in-hand image + android chest screen for FAQ ===== */
.tab-scene { position: relative; overflow: hidden; aspect-ratio: 16 / 9; max-width: 980px; margin: 0 auto; min-height: 0; isolation: isolate; }
.tab-scene .lab-glow { left: 50%; bottom: 0; width: 70%; height: 60%; opacity: 0; transition: opacity 1.2s .3s; }
.tab-scene .tab-img { position: absolute; left: 50%; top: 50%; width: 100%; height: auto; max-width: none; transform: translate(-50%, -50%) translateY(40px); opacity: 0; transition: transform 1s var(--ease), opacity .9s var(--ease); z-index: 1; }
.tab-scene .tab-screen { position: absolute; left: 25.2%; top: 13.9%; width: 50%; height: 62.9%; opacity: 0; transition: opacity .6s 1.5s; z-index: 2; }
.tab-scene .screen-inner { position: absolute; inset: 0; background: transparent; border-radius: 4px; aspect-ratio: auto; overflow: hidden; }
.tab-scene .screen-inner::after { display: none; }
.tab-scene .screen-line { position: absolute; left: 4%; right: 4%; top: 50%; height: 2px; background: #fff; box-shadow: 0 0 18px #FF4500, 0 0 40px #FF4500; opacity: 0; transform: scaleX(0); z-index: 6; pointer-events: none; }
.tab-scene.on .lab-glow { opacity: 1; }
.tab-scene.on .tab-img { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
.tab-scene.on .tab-screen { opacity: 1; }
.tab-scene.on .screen-line { animation: screenLine .9s 1s cubic-bezier(.7,0,.3,1) forwards; }
.tab-scene .screen-ui .ui-top, .tab-scene .screen-ui .ui-body { opacity: 0; transition: opacity .5s 1.8s; }
.tab-scene.on .screen-ui .ui-top, .tab-scene.on .screen-ui .ui-body { opacity: 1; }
.tab-scene .screen-ui .ui-top { background: rgba(0,0,0,.35); }
.tab-scene .ui-side { background: rgba(0,0,0,.3); }
.tab-scene .ui-main { background: transparent; }
.tab-scene .ui-pane { inset: 12px 26% 20% 14px; }
.tab-scene .ui-dots { left: 14px; bottom: 9%; }
body.noanim .tab-scene .tab-img, body.noanim .tab-scene .tab-screen, body.noanim .tab-scene .lab-glow, body.noanim .tab-scene .screen-ui .ui-top, body.noanim .tab-scene .screen-ui .ui-body { opacity: 1; transition: none; }
body.noanim .tab-scene .tab-img { transform: translate(-50%, -50%); }
@media (max-width: 960px) {
  .tab-scene { aspect-ratio: auto; height: 440px; max-width: none; margin: 0 -24px; }
  .tab-scene .tab-img { width: 200%; transform: translate(-50.2%, -50%) translateY(40px); }
  .tab-scene.on .tab-img, body.noanim .tab-scene .tab-img { transform: translate(-50.2%, -50%); }
  .tab-scene .tab-screen { left: 0; width: 100%; height: 70.8vw; top: calc(220px - 40.6vw); }
  .tab-scene .ui-pane { inset: 10px 22% 22% 16px; }
  .tab-scene .ui-pane h4 { font-size: 17px; } .tab-scene .ui-pane p { font-size: 12px; }
  .tab-scene .ui-dots { left: 16px; bottom: 12%; }
  .services-more { margin-top: 6px; }
}
/* FAQ on the android chest */
.faq-robot { position: relative; max-width: 820px; margin: 0 auto; height: 780px; overflow: hidden; }
.faq-robot .torso { position: absolute; left: 50%; top: 0; height: 1150px; width: auto; max-width: none; transform: translateX(-50%); -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.faq-robot::before { content: ""; position: absolute; left: 50%; top: 20%; width: 60%; height: 60%; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255,69,0,.22), transparent); filter: blur(30px); pointer-events: none; }
.chest-screen { position: absolute; left: 50%; top: 372px; width: 56%; transform: translateX(-50%); background: linear-gradient(160deg, rgba(14,14,14,.97), rgba(5,5,5,.98)); border: 1px solid rgba(255,107,53,.6); border-radius: 14px; padding: 10px 18px; box-shadow: 0 0 0 1px #000, 0 0 44px rgba(255,69,0,.25), inset 0 0 50px rgba(0,0,0,.7); }
.chest-screen::before { content: ""; position: absolute; left: 50%; top: 5px; width: 36px; height: 2px; transform: translateX(-50%); background: var(--orange); box-shadow: 0 0 10px var(--orange); border-radius: 2px; }
.chest-screen .faq { max-width: none; }
.chest-screen .faq details { border-color: rgba(255,255,255,.1); }
.chest-screen .faq summary { font-size: 14px; padding: 12px 0; gap: 14px; }
.chest-screen .faq summary .plus { width: 26px; height: 26px; } .chest-screen .faq summary .plus svg { width: 13px; height: 13px; }
.chest-screen .faq .answer { font-size: 13px; padding: 0 40px 12px 0; }
@media (max-width: 960px) {
  .faq-robot { height: 640px; margin: 0 -24px; }
  .faq-robot .torso { height: 980px; }
  .chest-screen { top: 318px; width: 88%; padding: 8px 14px; }
  .chest-screen .faq summary { font-size: 14px; padding: 11px 0; }
}

/* hero video: pure-black source, blended, works on mobile too */
.hero-video { mix-blend-mode: screen; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 960px) {
  .hero-video { right: -11vw; bottom: auto; top: 0; height: 100%; width: auto; }
  .hero-visual.video-on .robot { opacity: 0; }
}

/* ===== v6 fixes ===== */
/* Hero video: iOS-safe compositing (no blend on <video>); glows and grid overlay sit above the video */
.hero-video { mix-blend-mode: normal; z-index: 1; }
.hero-visual .visor-glow { z-index: 2; mix-blend-mode: screen; }
.hero-visual .scan { z-index: 3; }
.hero-visual .layers::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .8s;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 64px 64px; background-attachment: fixed; }
.hero-visual.video-on .layers::after { opacity: 1; }
.hero-visual.video-on .robot, .hero-visual.video-on .seams { opacity: 0; }
/* CTA hand centered, fingers fully visible, cut at mid-wrist */
@media (max-width: 960px) {
  .cta-visual { height: 170px; margin-top: -6px; -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
  .cta-visual img { left: -21.5%; right: auto; top: -56px; width: 100%; }
}
/* Why-us: compact reasons, figure stretched to the list height (JS sets top/height) */
@media (max-width: 960px) {
  .why-list li { font-family: var(--font-body); font-weight: 600; font-size: 15px; line-height: 1.35; padding: 14px 0 14px 40px; padding-right: 44%; }
  .why-list li::before { top: 16px; font-size: 12px; }
  .why-visual { bottom: auto; height: auto; width: 46%; right: -3%; }
  .why-visual img.main { height: 100%; object-position: center right; }
}

/* ===== v7 fixes ===== */
/* Hero video geometry + soft edges (single-layer masks work on iOS) */
.hero-video { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 100%); }
.hero-glow { z-index: 1; mix-blend-mode: screen; }
@media (max-width: 960px) {
  .hero-visual { opacity: 1; height: 540px; }
  .hero-video { top: 44px; right: -3vw; height: 94%; }
  .hero-visual .visor-glow { left: 44%; top: 26%; }
}
/* Why-us (mobile): figure spans the full height of the four reasons */
@media (max-width: 960px) {
  .why-list li { padding-right: 50%; }
  .why-visual { width: 62%; right: -6%; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent 100%), linear-gradient(to right, transparent 0, #000 18%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, #000 85%, transparent 100%); }
  .why-visual img.main { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% top; transform: scaleX(-1); max-width: none; }
}
/* CTA: tighter top, hand rises into the button, button glows once */
@media (max-width: 960px) { .cta { padding-top: 0; } .faq-robot { height: 600px; } }
.cta-visual img { transition: transform 1.1s cubic-bezier(.2,.8,.2,1), opacity .8s; transform: translateY(120px); opacity: 0; }
.cta.on .cta-visual img { transform: translateY(0); opacity: 1; }
.cta.on .btn-primary { animation: btnGlow 1.4s .7s ease-out 1; }
@keyframes btnGlow { 0% { box-shadow: 0 10px 40px rgba(255,69,0,.35); } 40% { box-shadow: 0 0 0 6px rgba(255,107,53,.35), 0 10px 60px rgba(255,69,0,.8); transform: translateY(-2px); } 100% { box-shadow: 0 10px 40px rgba(255,69,0,.35); transform: none; } }
body.noanim .cta-visual img { transform: none; opacity: 1; transition: none; }
@media (min-width: 961px) { .cta-visual img { transform: none; opacity: 1; } }

/* ===== v8 fixes ===== */
/* Services: tablet image top-aligned, less empty space */
@media (max-width: 960px) {
  .tab-scene { height: auto; aspect-ratio: 16 / 13.2; }
  .tab-scene .tab-img { top: 0; transform: translate(-50.2%, -6%) translateY(30px); }
  .tab-scene.on .tab-img, body.noanim .tab-scene .tab-img { transform: translate(-50.2%, -6%); }
  .section-head { margin-bottom: 18px; }
}
/* Swipe hint on the last slide */
.ui-swipe { position: absolute; right: 14px; bottom: 9%; display: flex; align-items: center; gap: 4px; font: 500 9px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); opacity: 0; transform: translateX(6px); transition: opacity .5s, transform .5s; pointer-events: none; }
.ui-swipe i { width: 6px; height: 6px; border-right: 1px solid var(--orange); border-top: 1px solid var(--orange); transform: rotate(-135deg); opacity: .4; animation: swipeHint 1.4s ease-in-out infinite; }
.ui-swipe i:nth-child(2) { animation-delay: .15s; } .ui-swipe i:nth-child(3) { animation-delay: .3s; }
.ui-swipe span { margin-left: 6px; }
.tab-scene.done .ui-swipe { opacity: 1; transform: none; }
@keyframes swipeHint { 0%, 100% { opacity: .25; transform: rotate(-135deg) translate(0, 0); } 50% { opacity: 1; transform: rotate(-135deg) translate(2px, 2px); } }
.tab-screen { touch-action: pan-y; }
.tab-scene .ui-pane { user-select: none; -webkit-user-select: none; }
/* Marquee: JS-driven, draggable */
.niches-marquee { touch-action: pan-y; cursor: grab; }
.niches-marquee.dragging { cursor: grabbing; }
.niches-marquee .marquee-track.js { animation: none; }
/* Why-us (mobile): full-width reasons over a translucent figure */
@media (max-width: 960px) {
  .why-list li { padding-right: 0; font-size: 16px; line-height: 1.3; padding-top: 16px; padding-bottom: 16px; }
  .why-visual { opacity: .42; width: 64%; right: -8%; z-index: 0; }
  .why-list { position: relative; z-index: 1; }
}
/* FAQ: panel in flow so it can grow; torso behind */
.faq-robot { height: auto; min-height: 0; padding: 372px 0 40px; overflow: hidden; }
.faq-robot .torso { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 70%, transparent 100%); }
.chest-screen { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; }
@media (max-width: 960px) { .faq-robot { padding: 318px 0 32px; margin: 0 -24px; } .faq-robot .torso { height: 980px; } .chest-screen { width: 88%; } }
.cta { position: relative; z-index: 1; }

/* ===== v9: full-head torso (torso_cut.png 720x1000; head top 2.4%, chest screen top 40.6%, x 29.9%–70%) ===== */
.faq-robot .torso { height: 1250px; -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 72%, transparent 100%); }
.faq-robot { padding: 494px 0 40px; }
.chest-screen { width: 52%; }
@media (max-width: 960px) {
  .faq-robot { padding: 386px 0 32px; }
  .faq-robot .torso { height: 980px; }
  .chest-screen { width: 88%; }
}

/* ===== v10: "Нет вашей задачи" closer to the hand (~half a grid cell), slightly smaller project cards ===== */
@media (max-width: 960px) {
  .lab--services .tab-scene { aspect-ratio: auto; height: calc(105.75vw - 25px); }
}
.frame-shot { aspect-ratio: 16 / 8.8; }
.project-body { padding: 18px 20px 22px; }
.project .badge { margin-bottom: 11px; }
.project h3 { font-size: 18px; }
.project p { font-size: 14px; }
.projects { max-width: 1080px; margin: 0 auto; }
@media (max-width: 960px) { .projects { padding: 0 12px; } }

/* ===== v11: footer telegram icon ===== */
.footer .caption a.tg { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; }
.footer .caption a.tg svg { width: 13px; height: 13px; flex: none; color: var(--orange); }

/* ===== v12: tablet no longer clipped on mobile (scene overflow visible, image 190% so the rounded frame fits with ~17px side margins) ===== */
@media (max-width: 960px) {
  .lab--services .tab-scene { overflow: visible; height: calc(100.475vw - 22px); }
  .tab-scene .tab-img { width: 190%; }
}

/* ===== v13: kill the ghost figure in "Почему мы" (unmirrored .seams copy), no horizontal page scroll on phones ===== */
.why-visual .seams { transform: translate(-50%, -50%) scaleX(-1); }
.why-visual .seams { display: none; } /* desktop too: GSAP parallax moves only img.main, the copy drifted away */
main, footer { overflow-x: clip; }
html { overflow-x: hidden; }
@media (max-width: 960px) { .why-grid { grid-template-columns: 1fr; } }

/* ===== v9: desktop hero video, soft edges on all sides (no black rectangle) ===== */
@media (min-width: 961px) {
  .hero-video {
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 58%, transparent 100%);
  }
}
/* why-us glow: keep it fully inside the clipped box so it fades softly, no straight edges */
.why-visual::before { left: 0; top: 8%; width: 75%; height: 84%; background: radial-gradient(closest-side, rgba(255,69,0,.32), rgba(255,69,0,.12) 55%, transparent); filter: blur(30px); }
/* hero video (mobile): soft fade on every edge, no straight black line by the buttons; orange glow sits behind the robot, not peeking above it */
@media (max-width: 960px) {
  .hero-video {
    -webkit-mask-image: radial-gradient(ellipse 72% 58% at 64% 52%, #000 38%, rgba(0,0,0,.6) 60%, transparent 86%);
    mask-image: radial-gradient(ellipse 72% 58% at 64% 52%, #000 38%, rgba(0,0,0,.6) 60%, transparent 86%);
  }
  .hero-glow { background: radial-gradient(80% 45% at 100% 42%, rgba(255,69,0,.30) 0%, rgba(255,69,0,.10) 45%, transparent 75%); }
}
@media (max-width: 960px) { .hero-edge { display: none; } } /* thin orange line on the right screen edge */
@media (max-width: 960px) { .hero-glow { background: radial-gradient(85% 50% at 100% 42%, rgba(255,69,0,.48) 0%, rgba(255,69,0,.18) 45%, transparent 78%); } } /* stronger right glow */
