/* Medium29 Motion Lab — experimental layer inspired by scroll-driven editorial/3D portfolios */
:root{
  --motion-radius: clamp(28px,4vw,64px);
  --motion-ink:#060608;
  --motion-paper:#f3f4ef;
}

/* progress */
.motion-progress{position:fixed;left:0;top:0;height:2px;width:100%;z-index:1200;pointer-events:none;transform-origin:left;transform:scaleX(0);background:var(--accent);box-shadow:0 0 20px rgba(200,255,0,.45)}

/* Magnetic buttons keep layout stable; JS moves only the inner transform. */
.motion-magnet{will-change:transform;transform:translate3d(0,0,0)}

/* HOME — cinematic hero */
body.home-motion .hero{min-height:100svh;padding-top:7rem;padding-bottom:5rem;isolation:isolate}
body.home-motion .hero::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(6,6,8,.05) 0%,rgba(6,6,8,.08) 58%,rgba(6,6,8,.9) 100%);z-index:-1}
body.home-motion .hero-bg-grid{opacity:.55;transform:perspective(900px) rotateX(62deg) translateY(38%);transform-origin:center 80%;background-size:70px 70px;mask-image:linear-gradient(to bottom,transparent 0%,black 18%,black 70%,transparent 100%)}
body.home-motion .hero-copy{position:relative;z-index:3;max-width:1180px}
body.home-motion .hero-kicker{display:flex;align-items:center;gap:.65rem;color:#d7e2ea;text-transform:uppercase;letter-spacing:.18em;font-size:.7rem;margin-bottom:1.4rem;opacity:.82}
body.home-motion .hero-kicker::before{content:"";width:34px;height:1px;background:var(--accent)}
body.home-motion .hero h1{font-size:clamp(4.2rem,10.3vw,11rem);line-height:.79;letter-spacing:-.075em;max-width:none;margin:0;text-transform:uppercase;position:relative}
body.home-motion .hero h1 .line{display:block;overflow:hidden;padding:.035em 0}
body.home-motion .hero h1 .line:nth-child(2){padding-left:7vw}
body.home-motion .hero h1 .line:nth-child(3){padding-left:1vw}
body.home-motion .hero h1 .accent-word{background:linear-gradient(120deg,#c8ff00 5%,#f4ffd1 45%,#8fb500 100%);-webkit-background-clip:text;background-clip:text;color:transparent;font-style:normal}
body.home-motion .hero h1 .outline-word{-webkit-text-stroke:1.2px rgba(240,240,240,.34)}
body.home-motion .hero-meta{display:grid;grid-template-columns:minmax(240px,520px) auto;gap:2rem;align-items:end;margin-top:2.4rem;position:relative;z-index:3}
body.home-motion .hero-sub{margin:0;max-width:520px;color:#b7b7c2;font-size:clamp(.95rem,1.25vw,1.12rem)}
body.home-motion .hero-actions{justify-self:end;margin:0}
body.home-motion .hero-orbit-label{position:absolute;right:4rem;top:24%;width:128px;height:128px;border:1px solid rgba(255,255,255,.14);border-radius:50%;display:grid;place-items:center;z-index:4;backdrop-filter:blur(8px);background:rgba(6,6,8,.22);animation:orbitFloat 5s ease-in-out infinite}
body.home-motion .hero-orbit-label::before{content:"";position:absolute;inset:10px;border:1px dashed rgba(200,255,0,.32);border-radius:50%;animation:orbitSpin 12s linear infinite}
body.home-motion .hero-orbit-label span{font-family:'Syne',sans-serif;font-weight:800;text-align:center;font-size:.73rem;line-height:1.15;letter-spacing:.08em;text-transform:uppercase}
body.home-motion .hero-orbit-label b{display:block;color:var(--accent);font-size:1.35rem;letter-spacing:-.05em}
@keyframes orbitFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}
@keyframes orbitSpin{to{transform:rotate(360deg)}}

/* Scroll-reactive capability reel */
.motion-reel{background:var(--bg);padding:7rem 0 9rem;overflow:hidden;position:relative;border-top:1px solid var(--border)}
.motion-reel-head{padding:0 4rem 3rem;display:flex;justify-content:space-between;align-items:end;gap:2rem}
.motion-reel-head h2{font-family:'Syne',sans-serif;font-size:clamp(2.8rem,7vw,7rem);line-height:.9;letter-spacing:-.055em;text-transform:uppercase;max-width:900px}
.motion-reel-head p{color:var(--muted);max-width:300px;font-size:.9rem}
.motion-reel-row{display:flex;gap:14px;width:max-content;padding:7px 0;will-change:transform}
.motion-tile{width:clamp(270px,30vw,430px);aspect-ratio:1.55;border:1px solid rgba(255,255,255,.11);border-radius:30px;overflow:hidden;position:relative;background:linear-gradient(145deg,#0d0d12,#15151d);box-shadow:0 22px 65px rgba(0,0,0,.22)}
.motion-tile::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 45%,rgba(0,0,0,.72));pointer-events:none}
.motion-tile-top{position:absolute;top:15px;left:17px;right:17px;display:flex;justify-content:space-between;align-items:center;z-index:2;font-size:.64rem;letter-spacing:.12em;text-transform:uppercase;color:#d7e2ea}
.motion-tile-top i{width:8px;height:8px;background:var(--accent);border-radius:50%;box-shadow:0 0 18px rgba(200,255,0,.6)}
.motion-tile-title{position:absolute;left:20px;right:20px;bottom:18px;z-index:3;font-family:'Syne',sans-serif;font-size:clamp(1.25rem,2vw,2rem);line-height:1;letter-spacing:-.04em;text-transform:uppercase}
.motion-tile-art{position:absolute;inset:20% 7% 16%;border:1px solid rgba(255,255,255,.09);border-radius:22px;transform:perspective(700px) rotateX(8deg) rotateY(-8deg);transition:transform .6s cubic-bezier(.2,.8,.2,1);overflow:hidden;background:rgba(255,255,255,.018)}
.motion-tile:hover .motion-tile-art{transform:perspective(700px) rotateX(0) rotateY(0) scale(1.025)}
.motion-tile-art.browser::before{content:"";position:absolute;left:8%;right:8%;top:13%;height:12%;border-radius:100px;background:rgba(255,255,255,.07);box-shadow:0 48px 0 rgba(200,255,0,.12),0 78px 0 rgba(255,255,255,.05)}
.motion-tile-art.browser::after{content:"";position:absolute;width:46%;height:52%;right:8%;bottom:8%;border-radius:18px;background:linear-gradient(135deg,rgba(200,255,0,.24),rgba(200,255,0,.02));border:1px solid rgba(200,255,0,.22)}
.motion-tile-art.ads::before{content:"↑";position:absolute;left:12%;bottom:10%;font:800 clamp(4rem,8vw,8rem)/1 'Syne';color:rgba(200,255,0,.32);transform:rotate(18deg)}
.motion-tile-art.ads::after{content:"01  /  04  /  29";position:absolute;top:13%;right:8%;font-size:.67rem;letter-spacing:.18em;color:#d7e2ea;writing-mode:vertical-rl}
.motion-tile-art.signage::before{content:"";position:absolute;width:50%;height:72%;left:25%;top:9%;border:6px solid #24242e;border-radius:13px;background:radial-gradient(circle at 50% 35%,rgba(200,255,0,.35),transparent 26%),linear-gradient(160deg,#101017,#07070a);box-shadow:0 18px 40px rgba(0,0,0,.5)}
.motion-tile-art.signage::after{content:"M29";position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);font:800 2.2rem/1 'Syne';color:var(--accent)}
.motion-tile-art.seo::before{content:"";position:absolute;left:11%;right:11%;bottom:15%;height:58%;background:linear-gradient(to top,rgba(200,255,0,.22),rgba(200,255,0,0));clip-path:polygon(0 100%,0 78%,19% 70%,34% 76%,51% 42%,70% 50%,84% 18%,100% 0,100% 100%)}
.motion-tile-art.seo::after{content:"SEARCH / GROWTH";position:absolute;left:11%;top:13%;font:700 .67rem/1 'Syne';letter-spacing:.16em;color:#c8ff00}

/* Character reveal statement */
.motion-statement{min-height:100svh;display:grid;place-items:center;padding:10rem 8vw;background:var(--bg);overflow:hidden}
.motion-statement-inner{max-width:1160px;text-align:center;position:relative}
.motion-statement-label{color:var(--accent);text-transform:uppercase;letter-spacing:.2em;font-size:.72rem;margin-bottom:2rem}
.motion-statement-text{font-family:'Syne',sans-serif;font-size:clamp(2.15rem,5.35vw,6.1rem);font-weight:700;line-height:1.02;letter-spacing:-.055em;text-wrap:balance}
.motion-char{opacity:.16;transition:opacity .12s linear;color:#e8e8ec}
.motion-char.on{opacity:1}

/* Services becomes editorial rather than generic card grid */
body.home-motion .services-preview{background:var(--motion-paper);color:var(--motion-ink);border-radius:var(--motion-radius) var(--motion-radius) 0 0;padding-top:clamp(6rem,10vw,10rem);padding-bottom:clamp(5rem,8vw,8rem);z-index:2}
body.home-motion .services-preview .section-tag{color:#4b5f00}
body.home-motion .services-preview .section-title{font-size:clamp(3.8rem,10vw,10rem);text-transform:uppercase;line-height:.83;letter-spacing:-.075em;color:#060608;margin-bottom:0}
body.home-motion .services-preview .btn-ghost{color:#111;border-color:rgba(6,6,8,.2);cursor:none}
body.home-motion .services-preview .btn-ghost:hover{color:#000;border-color:#000}
body.home-motion .services-grid{display:block;border:0;background:none;margin-top:5rem}
body.home-motion .service-card{background:transparent!important;color:#060608;padding:2.3rem 0;display:grid;grid-template-columns:minmax(110px,18%) 1fr auto;align-items:center;gap:2rem;border-top:1px solid rgba(6,6,8,.18);overflow:visible;cursor:none}
body.home-motion .service-card:last-child{border-bottom:1px solid rgba(6,6,8,.18)}
body.home-motion .service-card::before{display:none}
body.home-motion .service-num{font:800 clamp(3.5rem,8vw,8rem)/.8 'Syne';letter-spacing:-.075em;color:#060608;margin:0}
body.home-motion .service-icon{grid-column:3;grid-row:1;width:64px;height:64px;border-radius:50%;font-size:1.35rem;background:#060608;color:#c8ff00;border:0;margin:0;box-shadow:none}
body.home-motion .service-card h3{grid-column:2;grid-row:1;font-size:clamp(1.4rem,3vw,3.2rem);text-transform:uppercase;margin:0}
body.home-motion .service-card p{grid-column:2;grid-row:2;color:rgba(6,6,8,.58);max-width:700px;margin:-1.15rem 0 0;font-size:clamp(.88rem,1.2vw,1rem)}

/* Sticky portfolio stack */
.motion-projects{background:var(--bg);padding:9rem 4rem 12rem;position:relative;border-radius:var(--motion-radius) var(--motion-radius) 0 0;margin-top:-1px;z-index:4}
.motion-projects-head{margin-bottom:6rem}
.motion-projects-head .eyebrow{font-size:.72rem;letter-spacing:.18em;color:var(--accent);text-transform:uppercase;margin-bottom:1rem}
.motion-projects-head h2{font:800 clamp(4rem,10vw,10rem)/.82 'Syne';letter-spacing:-.075em;text-transform:uppercase}
.motion-stack{max-width:1280px;margin:auto}
.motion-card-space{height:78vh;min-height:620px;position:relative}
.motion-project-card{position:sticky;top:100px;min-height:560px;border:1px solid rgba(215,226,234,.35);border-radius:var(--motion-radius);background:rgba(13,13,18,.97);padding:clamp(1.4rem,3vw,3rem);overflow:hidden;transform-origin:center top;will-change:transform;box-shadow:0 30px 80px rgba(0,0,0,.34)}
.motion-project-top{display:grid;grid-template-columns:auto 1fr auto;gap:2rem;align-items:start;margin-bottom:2rem;position:relative;z-index:2}
.motion-project-num{font:800 clamp(4rem,8vw,9rem)/.75 'Syne';letter-spacing:-.08em;color:#e8e8ec}
.motion-project-meta{padding-top:.4rem}
.motion-project-meta small{display:block;color:var(--accent);text-transform:uppercase;letter-spacing:.18em;font-size:.65rem;margin-bottom:.45rem}
.motion-project-meta h3{font:700 clamp(1.5rem,3.2vw,3.7rem)/.95 'Syne';letter-spacing:-.055em;text-transform:uppercase}
.motion-project-link{color:#d7e2ea;text-decoration:none;border:1px solid rgba(215,226,234,.45);border-radius:999px;padding:.65rem 1rem;text-transform:uppercase;letter-spacing:.12em;font-size:.65rem;white-space:nowrap}
.motion-project-visuals{height:350px;display:grid;grid-template-columns:40% 1fr;gap:12px;position:relative;z-index:2}
.motion-mini-col{display:grid;grid-template-rows:1fr 1.28fr;gap:12px}
.motion-shot{border-radius:clamp(20px,3vw,42px);border:1px solid rgba(255,255,255,.08);overflow:hidden;position:relative;background:linear-gradient(145deg,#171720,#0b0b0f)}
.motion-shot::before{content:"";position:absolute;inset:14%;border-radius:22px;border:1px solid rgba(255,255,255,.09);background:linear-gradient(145deg,rgba(200,255,0,.08),rgba(255,255,255,.018))}
.motion-shot.web.large::after{content:"WEB / EXPERIENCE";position:absolute;left:8%;bottom:8%;font:800 clamp(1.5rem,4vw,4.8rem)/.85 'Syne';letter-spacing:-.06em;color:rgba(200,255,0,.24)}
.motion-shot.marketing.large::after{content:"GROWTH";position:absolute;right:6%;bottom:6%;font:800 clamp(2rem,5vw,6rem)/.8 'Syne';letter-spacing:-.07em;color:rgba(200,255,0,.22);transform:rotate(-90deg);transform-origin:right bottom}
.motion-shot.signage.large::after{content:"DISPLAY";position:absolute;left:7%;top:12%;font:800 clamp(2rem,5vw,6rem)/.8 'Syne';letter-spacing:-.07em;color:rgba(200,255,0,.18)}
.motion-project-card::after{content:"";position:absolute;width:420px;height:420px;right:-100px;top:-120px;background:radial-gradient(circle,rgba(200,255,0,.08),transparent 70%);pointer-events:none}

/* page-wide tilt hook */
.motion-tilt{transform-style:preserve-3d;will-change:transform}

/* softer rounded sections on interior pages */
body:not(.home-motion) .page-hero{overflow:hidden}
body:not(.home-motion) .page-hero::after{content:"";position:absolute;width:520px;height:520px;border:1px solid rgba(200,255,0,.1);border-radius:50%;right:-190px;top:-200px;box-shadow:inset 0 0 120px rgba(200,255,0,.025);pointer-events:none;animation:orbitSpin 22s linear infinite}

@media(max-width:900px){
  .motion-progress{display:none}
  body.home-motion .hero{padding:6.4rem 1.25rem 3.5rem;justify-content:center}
  body.home-motion .hero h1{font-size:clamp(3.45rem,17vw,6.6rem);line-height:.82}
  body.home-motion .hero h1 .line:nth-child(2){padding-left:7vw}
  body.home-motion .hero-meta{grid-template-columns:1fr;margin-top:1.7rem;gap:1.6rem}
  body.home-motion .hero-actions{justify-self:start;width:100%}
  body.home-motion .hero-orbit-label{right:1.2rem;top:18%;width:82px;height:82px;opacity:.72}
  body.home-motion .hero-orbit-label span{font-size:.48rem} body.home-motion .hero-orbit-label b{font-size:.9rem}
  body.home-motion .hero-scroll{display:none}
  .motion-reel{padding:5.5rem 0 6.5rem}
  .motion-reel-head{padding:0 1.5rem 2.2rem;display:block}.motion-reel-head h2{font-size:clamp(3rem,13vw,5.5rem)}.motion-reel-head p{margin-top:1.1rem}
  .motion-tile{width:76vw;max-width:360px;border-radius:24px}
  .motion-statement{padding:7rem 1.5rem;min-height:78svh}.motion-statement-text{font-size:clamp(2.25rem,10vw,4rem)}
  body.home-motion .services-preview{padding-left:1.5rem;padding-right:1.5rem}
  body.home-motion .services-header{display:block}body.home-motion .services-preview .btn-ghost{margin-top:1.4rem}
  body.home-motion .services-grid{margin-top:3.2rem}
  body.home-motion .service-card{grid-template-columns:86px 1fr auto;gap:1rem;padding:1.75rem 0}
  body.home-motion .service-card h3{font-size:clamp(1.2rem,6vw,2rem)}
  body.home-motion .service-card p{grid-column:2/4;margin:-.35rem 0 0}
  body.home-motion .service-icon{width:48px;height:48px}
  .motion-projects{padding:6.5rem 1.25rem 8rem}
  .motion-projects-head{margin-bottom:4rem}.motion-projects-head h2{font-size:clamp(4rem,17vw,7rem)}
  .motion-card-space{height:72vh;min-height:560px}.motion-project-card{top:78px;min-height:500px;padding:1.25rem;border-radius:30px}
  .motion-project-top{grid-template-columns:auto 1fr;gap:1rem}.motion-project-link{display:none}.motion-project-num{font-size:clamp(3.4rem,15vw,5.5rem)}
  .motion-project-visuals{height:300px;grid-template-columns:1fr}.motion-mini-col{display:none}.motion-shot.large{border-radius:24px}
}

@media(max-width:540px){
  body.home-motion .hero-kicker{font-size:.58rem;letter-spacing:.12em}
  body.home-motion .hero-actions .btn-primary,body.home-motion .hero-actions .btn-ghost{width:auto;flex:1;min-width:140px;padding:.78rem 1rem;font-size:.82rem}
  .motion-statement-text{font-size:clamp(2rem,9.5vw,3rem)}
  body.home-motion .service-card{grid-template-columns:72px 1fr}.service-icon{display:none!important}body.home-motion .service-card p{grid-column:2}
}

@media(prefers-reduced-motion:reduce){
  .motion-progress{display:none}.motion-reel-row,.motion-project-card,.motion-magnet,.motion-tilt{transform:none!important}.motion-char{opacity:1!important}.hero-orbit-label,.hero-orbit-label::before,body:not(.home-motion) .page-hero::after{animation:none!important}
}
